| 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 30 matching lines...) Expand all Loading... |
| 41 const gfx::Size& content_bounds) const OVERRIDE; | 41 const gfx::Size& content_bounds) const OVERRIDE; |
| 42 | 42 |
| 43 using PictureLayerImpl::AddTiling; | 43 using PictureLayerImpl::AddTiling; |
| 44 using PictureLayerImpl::CleanUpTilingsOnActiveLayer; | 44 using PictureLayerImpl::CleanUpTilingsOnActiveLayer; |
| 45 using PictureLayerImpl::CanHaveTilings; | 45 using PictureLayerImpl::CanHaveTilings; |
| 46 using PictureLayerImpl::MarkVisibleResourcesAsRequired; | 46 using PictureLayerImpl::MarkVisibleResourcesAsRequired; |
| 47 using PictureLayerImpl::DoPostCommitInitializationIfNeeded; | 47 using PictureLayerImpl::DoPostCommitInitializationIfNeeded; |
| 48 using PictureLayerImpl::MinimumContentsScale; | 48 using PictureLayerImpl::MinimumContentsScale; |
| 49 using PictureLayerImpl::SanityCheckTilingState; | 49 using PictureLayerImpl::SanityCheckTilingState; |
| 50 | 50 |
| 51 using PictureLayerImpl::UpdateIdealScales; |
| 52 using PictureLayerImpl::MaximumTilingContentsScale; |
| 53 using PictureLayerImpl::ManageTilings; |
| 54 |
| 51 void SetNeedsPostCommitInitialization() { | 55 void SetNeedsPostCommitInitialization() { |
| 52 needs_post_commit_initialization_ = true; | 56 needs_post_commit_initialization_ = true; |
| 53 } | 57 } |
| 54 | 58 |
| 55 bool needs_post_commit_initialization() const { | 59 bool needs_post_commit_initialization() const { |
| 56 return needs_post_commit_initialization_; | 60 return needs_post_commit_initialization_; |
| 57 } | 61 } |
| 58 | 62 |
| 59 float raster_page_scale() const { return raster_page_scale_; } | 63 float raster_page_scale() const { return raster_page_scale_; } |
| 60 void set_raster_page_scale(float scale) { raster_page_scale_ = scale; } | 64 void set_raster_page_scale(float scale) { raster_page_scale_ = scale; } |
| (...skipping 22 matching lines...) Expand all Loading... |
| 83 } | 87 } |
| 84 | 88 |
| 85 void set_fixed_tile_size(const gfx::Size& size) { fixed_tile_size_ = size; } | 89 void set_fixed_tile_size(const gfx::Size& size) { fixed_tile_size_ = size; } |
| 86 | 90 |
| 87 void CreateDefaultTilingsAndTiles(); | 91 void CreateDefaultTilingsAndTiles(); |
| 88 void SetAllTilesVisible(); | 92 void SetAllTilesVisible(); |
| 89 void SetAllTilesReady(); | 93 void SetAllTilesReady(); |
| 90 void SetAllTilesReadyInTiling(PictureLayerTiling* tiling); | 94 void SetAllTilesReadyInTiling(PictureLayerTiling* tiling); |
| 91 void ResetAllTilesPriorities(); | 95 void ResetAllTilesPriorities(); |
| 92 | 96 |
| 97 void ScaleAndManageTilings(bool animating_transform_to_screen, |
| 98 float maximum_animation_contents_scale) { |
| 99 UpdateIdealScales(); |
| 100 if (CanHaveTilings()) { |
| 101 ManageTilings(animating_transform_to_screen, |
| 102 maximum_animation_contents_scale); |
| 103 } |
| 104 } |
| 105 |
| 93 protected: | 106 protected: |
| 94 FakePictureLayerImpl( | 107 FakePictureLayerImpl( |
| 95 LayerTreeImpl* tree_impl, | 108 LayerTreeImpl* tree_impl, |
| 96 int id, | 109 int id, |
| 97 scoped_refptr<PicturePileImpl> pile); | 110 scoped_refptr<PicturePileImpl> pile); |
| 98 FakePictureLayerImpl(LayerTreeImpl* tree_impl, | 111 FakePictureLayerImpl(LayerTreeImpl* tree_impl, |
| 99 int id, | 112 int id, |
| 100 scoped_refptr<PicturePileImpl> pile, | 113 scoped_refptr<PicturePileImpl> pile, |
| 101 const gfx::Size& layer_bounds); | 114 const gfx::Size& layer_bounds); |
| 102 FakePictureLayerImpl(LayerTreeImpl* tree_impl, int id); | 115 FakePictureLayerImpl(LayerTreeImpl* tree_impl, int id); |
| 103 | 116 |
| 104 private: | 117 private: |
| 105 gfx::Size fixed_tile_size_; | 118 gfx::Size fixed_tile_size_; |
| 106 | 119 |
| 107 size_t append_quads_count_; | 120 size_t append_quads_count_; |
| 108 }; | 121 }; |
| 109 | 122 |
| 110 } // namespace cc | 123 } // namespace cc |
| 111 | 124 |
| 112 #endif // CC_TEST_FAKE_PICTURE_LAYER_IMPL_H_ | 125 #endif // CC_TEST_FAKE_PICTURE_LAYER_IMPL_H_ |
| OLD | NEW |