GPU workaround to simulate Out of Memory errors with large textures
[chromium-blink-merge.git] / cc / debug / micro_benchmark_impl.h
blob4f3f74f651688ce84ccaeda5b93b72d643872c2e
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CC_DEBUG_MICRO_BENCHMARK_IMPL_H_
6 #define CC_DEBUG_MICRO_BENCHMARK_IMPL_H_
8 #include "base/callback.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "cc/base/cc_export.h"
12 namespace base {
13 class Value;
14 class MessageLoopProxy;
15 } // namespace base
17 namespace cc {
19 class LayerTreeHostImpl;
20 class LayerImpl;
21 class PictureLayerImpl;
22 class CC_EXPORT MicroBenchmarkImpl {
23 public:
24 typedef base::Callback<void(scoped_ptr<base::Value>)> DoneCallback;
26 explicit MicroBenchmarkImpl(
27 const DoneCallback& callback,
28 scoped_refptr<base::MessageLoopProxy> origin_loop);
29 virtual ~MicroBenchmarkImpl();
31 bool IsDone() const;
32 virtual void DidCompleteCommit(LayerTreeHostImpl* host);
34 virtual void RunOnLayer(LayerImpl* layer);
35 virtual void RunOnLayer(PictureLayerImpl* layer);
37 protected:
38 void NotifyDone(scoped_ptr<base::Value> result);
40 private:
41 DoneCallback callback_;
42 bool is_done_;
43 scoped_refptr<base::MessageLoopProxy> origin_loop_;
46 } // namespace cc
48 #endif // CC_DEBUG_MICRO_BENCHMARK_IMPL_H_