| 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 15 matching lines...) Expand all Loading... |
| 26 // Create layer from a pile that only covers part of the layer. | 26 // Create layer from a pile that only covers part of the layer. |
| 27 static scoped_ptr<FakePictureLayerImpl> CreateWithPartialPile( | 27 static scoped_ptr<FakePictureLayerImpl> CreateWithPartialPile( |
| 28 LayerTreeImpl* tree_impl, | 28 LayerTreeImpl* tree_impl, |
| 29 int id, | 29 int id, |
| 30 scoped_refptr<PicturePileImpl> pile, | 30 scoped_refptr<PicturePileImpl> pile, |
| 31 const gfx::Size& layer_bounds) { | 31 const gfx::Size& layer_bounds) { |
| 32 return make_scoped_ptr( | 32 return make_scoped_ptr( |
| 33 new FakePictureLayerImpl(tree_impl, id, pile, layer_bounds)); | 33 new FakePictureLayerImpl(tree_impl, id, pile, layer_bounds)); |
| 34 } | 34 } |
| 35 | 35 |
| 36 virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) | 36 scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; |
| 37 override; | 37 void AppendQuads(RenderPass* render_pass, |
| 38 virtual void AppendQuads(RenderPass* render_pass, | 38 const Occlusion& occlusion_in_content_space, |
| 39 const Occlusion& occlusion_in_content_space, | 39 AppendQuadsData* append_quads_data) override; |
| 40 AppendQuadsData* append_quads_data) override; | 40 gfx::Size CalculateTileSize(const gfx::Size& content_bounds) const override; |
| 41 virtual gfx::Size CalculateTileSize( | |
| 42 const gfx::Size& content_bounds) const override; | |
| 43 | 41 |
| 44 virtual void DidBecomeActive() override; | 42 void DidBecomeActive() override; |
| 45 size_t did_become_active_call_count() { | 43 size_t did_become_active_call_count() { |
| 46 return did_become_active_call_count_; | 44 return did_become_active_call_count_; |
| 47 } | 45 } |
| 48 | 46 |
| 49 virtual bool HasValidTilePriorities() const override; | 47 bool HasValidTilePriorities() const override; |
| 50 void set_has_valid_tile_priorities(bool has_valid_priorities) { | 48 void set_has_valid_tile_priorities(bool has_valid_priorities) { |
| 51 has_valid_tile_priorities_ = has_valid_priorities; | 49 has_valid_tile_priorities_ = has_valid_priorities; |
| 52 use_set_valid_tile_priorities_flag_ = true; | 50 use_set_valid_tile_priorities_flag_ = true; |
| 53 } | 51 } |
| 54 | 52 |
| 55 using PictureLayerImpl::AddTiling; | 53 using PictureLayerImpl::AddTiling; |
| 56 using PictureLayerImpl::CleanUpTilingsOnActiveLayer; | 54 using PictureLayerImpl::CleanUpTilingsOnActiveLayer; |
| 57 using PictureLayerImpl::CanHaveTilings; | 55 using PictureLayerImpl::CanHaveTilings; |
| 58 using PictureLayerImpl::DoPostCommitInitializationIfNeeded; | 56 using PictureLayerImpl::DoPostCommitInitializationIfNeeded; |
| 59 using PictureLayerImpl::MinimumContentsScale; | 57 using PictureLayerImpl::MinimumContentsScale; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 void SetAllTilesVisible(); | 99 void SetAllTilesVisible(); |
| 102 void SetAllTilesReady(); | 100 void SetAllTilesReady(); |
| 103 void SetAllTilesReadyInTiling(PictureLayerTiling* tiling); | 101 void SetAllTilesReadyInTiling(PictureLayerTiling* tiling); |
| 104 void SetTileReady(Tile* tile); | 102 void SetTileReady(Tile* tile); |
| 105 void ResetAllTilesPriorities(); | 103 void ResetAllTilesPriorities(); |
| 106 PictureLayerTilingSet* GetTilings() { return tilings_.get(); } | 104 PictureLayerTilingSet* GetTilings() { return tilings_.get(); } |
| 107 | 105 |
| 108 size_t release_resources_count() const { return release_resources_count_; } | 106 size_t release_resources_count() const { return release_resources_count_; } |
| 109 void reset_release_resources_count() { release_resources_count_ = 0; } | 107 void reset_release_resources_count() { release_resources_count_ = 0; } |
| 110 | 108 |
| 111 virtual void ReleaseResources() override; | 109 void ReleaseResources() override; |
| 112 | 110 |
| 113 bool only_used_low_res_last_append_quads() const { | 111 bool only_used_low_res_last_append_quads() const { |
| 114 return only_used_low_res_last_append_quads_; | 112 return only_used_low_res_last_append_quads_; |
| 115 } | 113 } |
| 116 | 114 |
| 117 protected: | 115 protected: |
| 118 FakePictureLayerImpl( | 116 FakePictureLayerImpl( |
| 119 LayerTreeImpl* tree_impl, | 117 LayerTreeImpl* tree_impl, |
| 120 int id, | 118 int id, |
| 121 scoped_refptr<PicturePileImpl> pile); | 119 scoped_refptr<PicturePileImpl> pile); |
| 122 FakePictureLayerImpl(LayerTreeImpl* tree_impl, | 120 FakePictureLayerImpl(LayerTreeImpl* tree_impl, |
| 123 int id, | 121 int id, |
| 124 scoped_refptr<PicturePileImpl> pile, | 122 scoped_refptr<PicturePileImpl> pile, |
| 125 const gfx::Size& layer_bounds); | 123 const gfx::Size& layer_bounds); |
| 126 FakePictureLayerImpl(LayerTreeImpl* tree_impl, int id); | 124 FakePictureLayerImpl(LayerTreeImpl* tree_impl, int id); |
| 127 | 125 |
| 128 private: | 126 private: |
| 129 gfx::Size fixed_tile_size_; | 127 gfx::Size fixed_tile_size_; |
| 130 | 128 |
| 131 size_t append_quads_count_; | 129 size_t append_quads_count_; |
| 132 size_t did_become_active_call_count_; | 130 size_t did_become_active_call_count_; |
| 133 bool has_valid_tile_priorities_; | 131 bool has_valid_tile_priorities_; |
| 134 bool use_set_valid_tile_priorities_flag_; | 132 bool use_set_valid_tile_priorities_flag_; |
| 135 size_t release_resources_count_; | 133 size_t release_resources_count_; |
| 136 }; | 134 }; |
| 137 | 135 |
| 138 } // namespace cc | 136 } // namespace cc |
| 139 | 137 |
| 140 #endif // CC_TEST_FAKE_PICTURE_LAYER_IMPL_H_ | 138 #endif // CC_TEST_FAKE_PICTURE_LAYER_IMPL_H_ |
| OLD | NEW |