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_PICTURE_LAYER_H_ | 5 #ifndef CC_TEST_FAKE_PICTURE_LAYER_H_ |
6 #define CC_TEST_FAKE_PICTURE_LAYER_H_ | 6 #define CC_TEST_FAKE_PICTURE_LAYER_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "cc/layers/picture_layer.h" | 10 #include "cc/layers/picture_layer.h" |
11 | 11 |
12 namespace cc { | 12 namespace cc { |
13 class DelayedRasterTrigger; | |
13 | 14 |
14 class FakePictureLayer : public PictureLayer { | 15 class FakePictureLayer : public PictureLayer { |
15 public: | 16 public: |
16 static scoped_refptr<FakePictureLayer> Create(ContentLayerClient* client) { | 17 static scoped_refptr<FakePictureLayer> Create(ContentLayerClient* client) { |
17 return make_scoped_refptr(new FakePictureLayer(client)); | 18 return make_scoped_refptr(new FakePictureLayer(client)); |
18 } | 19 } |
19 | 20 |
20 scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; | 21 scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; |
21 | 22 |
22 size_t update_count() const { return update_count_; } | 23 size_t update_count() const { return update_count_; } |
23 void reset_update_count() { update_count_ = 0; } | 24 void reset_update_count() { update_count_ = 0; } |
24 | 25 |
25 size_t push_properties_count() const { return push_properties_count_; } | 26 size_t push_properties_count() const { return push_properties_count_; } |
26 void reset_push_properties_count() { push_properties_count_ = 0; } | 27 void reset_push_properties_count() { push_properties_count_ = 0; } |
27 | 28 |
28 void set_always_update_resources(bool always_update_resources) { | 29 void set_always_update_resources(bool always_update_resources) { |
29 always_update_resources_ = always_update_resources; | 30 always_update_resources_ = always_update_resources; |
30 } | 31 } |
31 | 32 |
32 bool Update(ResourceUpdateQueue* queue, | 33 bool Update(ResourceUpdateQueue* queue, |
33 const OcclusionTracker<Layer>* occlusion) override; | 34 const OcclusionTracker<Layer>* occlusion) override; |
34 | 35 |
35 void PushPropertiesTo(LayerImpl* layer) override; | 36 void PushPropertiesTo(LayerImpl* layer) override; |
36 | 37 |
37 void OnOutputSurfaceCreated() override; | 38 void OnOutputSurfaceCreated() override; |
38 size_t output_surface_created_count() const { | 39 size_t output_surface_created_count() const { |
39 return output_surface_created_count_; | 40 return output_surface_created_count_; |
40 } | 41 } |
41 | 42 |
43 void SetUseDelayedRaster(DelayedRasterTrigger* trigger) { | |
44 delayed_raster_trigger_ = trigger; | |
45 } | |
46 | |
47 protected: | |
48 scoped_refptr<PicturePileImpl> CreatePicturePileImpl() override; | |
49 | |
42 private: | 50 private: |
43 explicit FakePictureLayer(ContentLayerClient* client); | 51 explicit FakePictureLayer(ContentLayerClient* client); |
44 ~FakePictureLayer() override; | 52 ~FakePictureLayer() override; |
45 | 53 |
46 size_t update_count_; | 54 size_t update_count_; |
47 size_t push_properties_count_; | 55 size_t push_properties_count_; |
56 size_t output_surface_created_count_; | |
48 bool always_update_resources_; | 57 bool always_update_resources_; |
49 size_t output_surface_created_count_; | 58 DelayedRasterTrigger* delayed_raster_trigger_; |
reveman
2014/11/10 23:43:02
Could this simply be a "base::WaitableEvent* pictu
| |
50 }; | 59 }; |
51 | 60 |
52 } // namespace cc | 61 } // namespace cc |
53 | 62 |
54 #endif // CC_TEST_FAKE_PICTURE_LAYER_H_ | 63 #endif // CC_TEST_FAKE_PICTURE_LAYER_H_ |
OLD | NEW |