| 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 #include "cc/test/fake_picture_layer_impl.h" | 5 #include "cc/test/fake_picture_layer_impl.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 #include "cc/tiles/tile.h" | 8 #include "cc/tiles/tile.h" |
| 9 #include "cc/trees/layer_tree_impl.h" | 9 #include "cc/trees/layer_tree_impl.h" |
| 10 | 10 |
| 11 namespace cc { | 11 namespace cc { |
| 12 | 12 |
| 13 FakePictureLayerImpl::FakePictureLayerImpl( | 13 FakePictureLayerImpl::FakePictureLayerImpl( |
| 14 LayerTreeImpl* tree_impl, | 14 LayerTreeImpl* tree_impl, |
| 15 int id, | 15 int id, |
| 16 scoped_refptr<RasterSource> raster_source, | 16 scoped_refptr<DisplayListRasterSource> raster_source, |
| 17 bool is_mask) | 17 bool is_mask) |
| 18 : PictureLayerImpl(tree_impl, | 18 : PictureLayerImpl(tree_impl, |
| 19 id, | 19 id, |
| 20 is_mask, | 20 is_mask, |
| 21 new LayerImpl::SyncedScrollOffset), | 21 new LayerImpl::SyncedScrollOffset), |
| 22 append_quads_count_(0), | 22 append_quads_count_(0), |
| 23 did_become_active_call_count_(0), | 23 did_become_active_call_count_(0), |
| 24 has_valid_tile_priorities_(false), | 24 has_valid_tile_priorities_(false), |
| 25 use_set_valid_tile_priorities_flag_(false), | 25 use_set_valid_tile_priorities_flag_(false), |
| 26 release_resources_count_(0) { | 26 release_resources_count_(0) { |
| 27 SetBounds(raster_source->GetSize()); | 27 SetBounds(raster_source->GetSize()); |
| 28 SetRasterSourceOnPending(raster_source, Region()); | 28 SetRasterSourceOnPending(raster_source, Region()); |
| 29 } | 29 } |
| 30 | 30 |
| 31 FakePictureLayerImpl::FakePictureLayerImpl( | 31 FakePictureLayerImpl::FakePictureLayerImpl( |
| 32 LayerTreeImpl* tree_impl, | 32 LayerTreeImpl* tree_impl, |
| 33 int id, | 33 int id, |
| 34 scoped_refptr<RasterSource> raster_source, | 34 scoped_refptr<DisplayListRasterSource> raster_source, |
| 35 bool is_mask, | 35 bool is_mask, |
| 36 const gfx::Size& layer_bounds) | 36 const gfx::Size& layer_bounds) |
| 37 : PictureLayerImpl(tree_impl, | 37 : PictureLayerImpl(tree_impl, |
| 38 id, | 38 id, |
| 39 is_mask, | 39 is_mask, |
| 40 new LayerImpl::SyncedScrollOffset), | 40 new LayerImpl::SyncedScrollOffset), |
| 41 append_quads_count_(0), | 41 append_quads_count_(0), |
| 42 did_become_active_call_count_(0), | 42 did_become_active_call_count_(0), |
| 43 has_valid_tile_priorities_(false), | 43 has_valid_tile_priorities_(false), |
| 44 use_set_valid_tile_priorities_flag_(false), | 44 use_set_valid_tile_priorities_flag_(false), |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 if (tiling->resolution() == LOW_RESOLUTION) { | 118 if (tiling->resolution() == LOW_RESOLUTION) { |
| 119 // There should be only one low res tiling. | 119 // There should be only one low res tiling. |
| 120 CHECK(!result); | 120 CHECK(!result); |
| 121 result = tiling; | 121 result = tiling; |
| 122 } | 122 } |
| 123 } | 123 } |
| 124 return result; | 124 return result; |
| 125 } | 125 } |
| 126 | 126 |
| 127 void FakePictureLayerImpl::SetRasterSourceOnPending( | 127 void FakePictureLayerImpl::SetRasterSourceOnPending( |
| 128 scoped_refptr<RasterSource> raster_source, | 128 scoped_refptr<DisplayListRasterSource> raster_source, |
| 129 const Region& invalidation) { | 129 const Region& invalidation) { |
| 130 DCHECK(layer_tree_impl()->IsPendingTree()); | 130 DCHECK(layer_tree_impl()->IsPendingTree()); |
| 131 Region invalidation_temp = invalidation; | 131 Region invalidation_temp = invalidation; |
| 132 const PictureLayerTilingSet* pending_set = nullptr; | 132 const PictureLayerTilingSet* pending_set = nullptr; |
| 133 set_gpu_raster_max_texture_size(layer_tree_impl()->device_viewport_size()); | 133 set_gpu_raster_max_texture_size(layer_tree_impl()->device_viewport_size()); |
| 134 UpdateRasterSource(raster_source, &invalidation_temp, pending_set); | 134 UpdateRasterSource(raster_source, &invalidation_temp, pending_set); |
| 135 } | 135 } |
| 136 | 136 |
| 137 void FakePictureLayerImpl::SetIsDrawnRenderSurfaceLayerListMember(bool is) { | 137 void FakePictureLayerImpl::SetIsDrawnRenderSurfaceLayerListMember(bool is) { |
| 138 draw_properties().last_drawn_render_surface_layer_list_id = | 138 draw_properties().last_drawn_render_surface_layer_list_id = |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 | 235 |
| 236 return CountTilesRequired(&PictureLayerTiling::IsTileRequiredForDraw); | 236 return CountTilesRequired(&PictureLayerTiling::IsTileRequiredForDraw); |
| 237 } | 237 } |
| 238 | 238 |
| 239 void FakePictureLayerImpl::ReleaseResources() { | 239 void FakePictureLayerImpl::ReleaseResources() { |
| 240 PictureLayerImpl::ReleaseResources(); | 240 PictureLayerImpl::ReleaseResources(); |
| 241 ++release_resources_count_; | 241 ++release_resources_count_; |
| 242 } | 242 } |
| 243 | 243 |
| 244 } // namespace cc | 244 } // namespace cc |
| OLD | NEW |