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/resources/tile.h" | 8 #include "cc/resources/tile.h" |
9 #include "cc/trees/layer_tree_impl.h" | 9 #include "cc/trees/layer_tree_impl.h" |
10 | 10 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 | 79 |
80 void FakePictureLayerImpl::PushPropertiesTo(LayerImpl* layer_impl) { | 80 void FakePictureLayerImpl::PushPropertiesTo(LayerImpl* layer_impl) { |
81 FakePictureLayerImpl* picture_layer_impl = | 81 FakePictureLayerImpl* picture_layer_impl = |
82 static_cast<FakePictureLayerImpl*>(layer_impl); | 82 static_cast<FakePictureLayerImpl*>(layer_impl); |
83 picture_layer_impl->fixed_tile_size_ = fixed_tile_size_; | 83 picture_layer_impl->fixed_tile_size_ = fixed_tile_size_; |
84 PictureLayerImpl::PushPropertiesTo(layer_impl); | 84 PictureLayerImpl::PushPropertiesTo(layer_impl); |
85 } | 85 } |
86 | 86 |
87 void FakePictureLayerImpl::AppendQuads( | 87 void FakePictureLayerImpl::AppendQuads( |
88 RenderPass* render_pass, | 88 RenderPass* render_pass, |
89 const Occlusion& occlusion_in_content_space, | |
90 AppendQuadsData* append_quads_data) { | 89 AppendQuadsData* append_quads_data) { |
91 PictureLayerImpl::AppendQuads( | 90 PictureLayerImpl::AppendQuads(render_pass, append_quads_data); |
92 render_pass, occlusion_in_content_space, append_quads_data); | |
93 ++append_quads_count_; | 91 ++append_quads_count_; |
94 } | 92 } |
95 | 93 |
96 gfx::Size FakePictureLayerImpl::CalculateTileSize( | 94 gfx::Size FakePictureLayerImpl::CalculateTileSize( |
97 const gfx::Size& content_bounds) const { | 95 const gfx::Size& content_bounds) const { |
98 if (fixed_tile_size_.IsEmpty()) { | 96 if (fixed_tile_size_.IsEmpty()) { |
99 return PictureLayerImpl::CalculateTileSize(content_bounds); | 97 return PictureLayerImpl::CalculateTileSize(content_bounds); |
100 } | 98 } |
101 | 99 |
102 return fixed_tile_size_; | 100 return fixed_tile_size_; |
(...skipping 27 matching lines...) Expand all Loading... |
130 | 128 |
131 void FakePictureLayerImpl::SetRasterSourceOnPending( | 129 void FakePictureLayerImpl::SetRasterSourceOnPending( |
132 scoped_refptr<RasterSource> raster_source, | 130 scoped_refptr<RasterSource> raster_source, |
133 const Region& invalidation) { | 131 const Region& invalidation) { |
134 DCHECK(layer_tree_impl()->IsPendingTree()); | 132 DCHECK(layer_tree_impl()->IsPendingTree()); |
135 Region invalidation_temp = invalidation; | 133 Region invalidation_temp = invalidation; |
136 const PictureLayerTilingSet* pending_set = nullptr; | 134 const PictureLayerTilingSet* pending_set = nullptr; |
137 UpdateRasterSource(raster_source, &invalidation_temp, pending_set); | 135 UpdateRasterSource(raster_source, &invalidation_temp, pending_set); |
138 } | 136 } |
139 | 137 |
| 138 void FakePictureLayerImpl::SetIsDrawnRenderSurfaceLayerListMember(bool is) { |
| 139 draw_properties().last_drawn_render_surface_layer_list_id = |
| 140 is ? layer_tree_impl()->current_render_surface_list_id() |
| 141 : layer_tree_impl()->current_render_surface_list_id() - 1; |
| 142 } |
| 143 |
140 void FakePictureLayerImpl::CreateAllTiles() { | 144 void FakePictureLayerImpl::CreateAllTiles() { |
141 for (size_t i = 0; i < num_tilings(); ++i) | 145 for (size_t i = 0; i < num_tilings(); ++i) |
142 tilings_->tiling_at(i)->CreateAllTilesForTesting(); | 146 tilings_->tiling_at(i)->CreateAllTilesForTesting(); |
143 } | 147 } |
144 | 148 |
145 void FakePictureLayerImpl::SetAllTilesVisible() { | 149 void FakePictureLayerImpl::SetAllTilesVisible() { |
146 WhichTree tree = | 150 WhichTree tree = |
147 layer_tree_impl()->IsActiveTree() ? ACTIVE_TREE : PENDING_TREE; | 151 layer_tree_impl()->IsActiveTree() ? ACTIVE_TREE : PENDING_TREE; |
148 | 152 |
149 for (size_t tiling_idx = 0; tiling_idx < tilings_->num_tilings(); | 153 for (size_t tiling_idx = 0; tiling_idx < tilings_->num_tilings(); |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 return CountTilesRequired( | 270 return CountTilesRequired( |
267 &PictureLayerTiling::IsTileRequiredForDrawIfVisible); | 271 &PictureLayerTiling::IsTileRequiredForDrawIfVisible); |
268 } | 272 } |
269 | 273 |
270 void FakePictureLayerImpl::ReleaseResources() { | 274 void FakePictureLayerImpl::ReleaseResources() { |
271 PictureLayerImpl::ReleaseResources(); | 275 PictureLayerImpl::ReleaseResources(); |
272 ++release_resources_count_; | 276 ++release_resources_count_; |
273 } | 277 } |
274 | 278 |
275 } // namespace cc | 279 } // namespace cc |
OLD | NEW |