OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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_IMPL_H_ | 5 #ifndef CC_TEST_FAKE_PICTURE_LAYER_IMPL_H_ |
6 #define CC_TEST_FAKE_PICTURE_LAYER_IMPL_H_ | 6 #define CC_TEST_FAKE_PICTURE_LAYER_IMPL_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "cc/layers/picture_layer_impl.h" | 9 #include "cc/layers/picture_layer_impl.h" |
10 | 10 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 | 48 |
49 virtual bool HasValidTilePriorities() const override; | 49 virtual bool HasValidTilePriorities() const override; |
50 void set_has_valid_tile_priorities(bool has_valid_priorities) { | 50 void set_has_valid_tile_priorities(bool has_valid_priorities) { |
51 has_valid_tile_priorities_ = has_valid_priorities; | 51 has_valid_tile_priorities_ = has_valid_priorities; |
52 use_set_valid_tile_priorities_flag_ = true; | 52 use_set_valid_tile_priorities_flag_ = true; |
53 } | 53 } |
54 | 54 |
55 using PictureLayerImpl::AddTiling; | 55 using PictureLayerImpl::AddTiling; |
56 using PictureLayerImpl::CleanUpTilingsOnActiveLayer; | 56 using PictureLayerImpl::CleanUpTilingsOnActiveLayer; |
57 using PictureLayerImpl::CanHaveTilings; | 57 using PictureLayerImpl::CanHaveTilings; |
58 using PictureLayerImpl::MarkVisibleResourcesAsRequired; | |
59 using PictureLayerImpl::DoPostCommitInitializationIfNeeded; | 58 using PictureLayerImpl::DoPostCommitInitializationIfNeeded; |
60 using PictureLayerImpl::MinimumContentsScale; | 59 using PictureLayerImpl::MinimumContentsScale; |
61 using PictureLayerImpl::GetViewportForTilePriorityInContentSpace; | 60 using PictureLayerImpl::GetViewportForTilePriorityInContentSpace; |
62 using PictureLayerImpl::SanityCheckTilingState; | 61 using PictureLayerImpl::SanityCheckTilingState; |
63 using PictureLayerImpl::GetRecycledTwinLayer; | 62 using PictureLayerImpl::GetRecycledTwinLayer; |
64 | 63 |
65 using PictureLayerImpl::UpdateIdealScales; | 64 using PictureLayerImpl::UpdateIdealScales; |
66 using PictureLayerImpl::MaximumTilingContentsScale; | 65 using PictureLayerImpl::MaximumTilingContentsScale; |
67 | 66 |
68 void SetNeedsPostCommitInitialization() { | 67 void SetNeedsPostCommitInitialization() { |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 void SetAllTilesReadyInTiling(PictureLayerTiling* tiling); | 103 void SetAllTilesReadyInTiling(PictureLayerTiling* tiling); |
105 void SetTileReady(Tile* tile); | 104 void SetTileReady(Tile* tile); |
106 void ResetAllTilesPriorities(); | 105 void ResetAllTilesPriorities(); |
107 PictureLayerTilingSet* GetTilings() { return tilings_.get(); } | 106 PictureLayerTilingSet* GetTilings() { return tilings_.get(); } |
108 | 107 |
109 size_t release_resources_count() const { return release_resources_count_; } | 108 size_t release_resources_count() const { return release_resources_count_; } |
110 void reset_release_resources_count() { release_resources_count_ = 0; } | 109 void reset_release_resources_count() { release_resources_count_ = 0; } |
111 | 110 |
112 virtual void ReleaseResources() override; | 111 virtual void ReleaseResources() override; |
113 | 112 |
| 113 bool only_used_low_res_last_append_quads() const { |
| 114 return only_used_low_res_last_append_quads_; |
| 115 } |
| 116 |
114 protected: | 117 protected: |
115 FakePictureLayerImpl( | 118 FakePictureLayerImpl( |
116 LayerTreeImpl* tree_impl, | 119 LayerTreeImpl* tree_impl, |
117 int id, | 120 int id, |
118 scoped_refptr<PicturePileImpl> pile); | 121 scoped_refptr<PicturePileImpl> pile); |
119 FakePictureLayerImpl(LayerTreeImpl* tree_impl, | 122 FakePictureLayerImpl(LayerTreeImpl* tree_impl, |
120 int id, | 123 int id, |
121 scoped_refptr<PicturePileImpl> pile, | 124 scoped_refptr<PicturePileImpl> pile, |
122 const gfx::Size& layer_bounds); | 125 const gfx::Size& layer_bounds); |
123 FakePictureLayerImpl(LayerTreeImpl* tree_impl, int id); | 126 FakePictureLayerImpl(LayerTreeImpl* tree_impl, int id); |
124 | 127 |
125 private: | 128 private: |
126 gfx::Size fixed_tile_size_; | 129 gfx::Size fixed_tile_size_; |
127 | 130 |
128 size_t append_quads_count_; | 131 size_t append_quads_count_; |
129 size_t did_become_active_call_count_; | 132 size_t did_become_active_call_count_; |
130 bool has_valid_tile_priorities_; | 133 bool has_valid_tile_priorities_; |
131 bool use_set_valid_tile_priorities_flag_; | 134 bool use_set_valid_tile_priorities_flag_; |
132 size_t release_resources_count_; | 135 size_t release_resources_count_; |
133 }; | 136 }; |
134 | 137 |
135 } // namespace cc | 138 } // namespace cc |
136 | 139 |
137 #endif // CC_TEST_FAKE_PICTURE_LAYER_IMPL_H_ | 140 #endif // CC_TEST_FAKE_PICTURE_LAYER_IMPL_H_ |
OLD | NEW |