OLD | NEW |
---|---|
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CC_TEST_FAKE_CONTENT_LAYER_H_ | 5 #ifndef CC_TEST_FAKE_CONTENT_LAYER_H_ |
6 #define CC_TEST_FAKE_CONTENT_LAYER_H_ | 6 #define CC_TEST_FAKE_CONTENT_LAYER_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "cc/layers/content_layer.h" | 9 #include "cc/layers/content_layer.h" |
10 #include "cc/resources/content_layer_updater.h" | |
10 | 11 |
11 namespace cc { | 12 namespace cc { |
12 | 13 |
14 class FakeContentLayerUpdater : public ContentLayerUpdater { | |
15 public: | |
16 gfx::Rect content_rect() const OVERRIDE; | |
danakj
2013/12/02 15:06:52
you can just do "using ContentLayerUpdater::conten
| |
17 }; | |
18 | |
13 class FakeContentLayer : public ContentLayer { | 19 class FakeContentLayer : public ContentLayer { |
14 public: | 20 public: |
15 static scoped_refptr<FakeContentLayer> Create(ContentLayerClient* client) { | 21 static scoped_refptr<FakeContentLayer> Create(ContentLayerClient* client) { |
16 return make_scoped_refptr(new FakeContentLayer(client)); | 22 return make_scoped_refptr(new FakeContentLayer(client)); |
17 } | 23 } |
18 | 24 |
19 virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) | 25 virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) |
20 OVERRIDE; | 26 OVERRIDE; |
21 | 27 |
22 size_t update_count() const { return update_count_; } | 28 size_t update_count() const { return update_count_; } |
23 void reset_update_count() { update_count_ = 0; } | 29 void reset_update_count() { update_count_ = 0; } |
24 | 30 |
25 size_t push_properties_count() const { return push_properties_count_; } | 31 size_t push_properties_count() const { return push_properties_count_; } |
26 void reset_push_properties_count() { push_properties_count_ = 0; } | 32 void reset_push_properties_count() { push_properties_count_ = 0; } |
27 | 33 |
34 virtual FakeContentLayerUpdater* Updater() const; | |
danakj
2013/12/02 15:06:52
How about instead, make this LastPaintRect(), and
| |
35 | |
28 virtual bool Update( | 36 virtual bool Update( |
29 ResourceUpdateQueue* queue, | 37 ResourceUpdateQueue* queue, |
30 const OcclusionTracker* occlusion) OVERRIDE; | 38 const OcclusionTracker* occlusion) OVERRIDE; |
31 | 39 |
32 void set_always_update_resources(bool always_update_resources) { | 40 void set_always_update_resources(bool always_update_resources) { |
33 always_update_resources_ = always_update_resources; | 41 always_update_resources_ = always_update_resources; |
34 } | 42 } |
35 | 43 |
36 virtual void PushPropertiesTo(LayerImpl* layer) OVERRIDE; | 44 virtual void PushPropertiesTo(LayerImpl* layer) OVERRIDE; |
37 | 45 |
(...skipping 10 matching lines...) Expand all Loading... | |
48 | 56 |
49 size_t update_count_; | 57 size_t update_count_; |
50 size_t push_properties_count_; | 58 size_t push_properties_count_; |
51 size_t output_surface_created_count_; | 59 size_t output_surface_created_count_; |
52 bool always_update_resources_; | 60 bool always_update_resources_; |
53 }; | 61 }; |
54 | 62 |
55 } // namespace cc | 63 } // namespace cc |
56 | 64 |
57 #endif // CC_TEST_FAKE_CONTENT_LAYER_H_ | 65 #endif // CC_TEST_FAKE_CONTENT_LAYER_H_ |
OLD | NEW |