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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 | 130 |
131 void FakePictureLayerImpl::SetRasterSourceOnPending( | 131 void FakePictureLayerImpl::SetRasterSourceOnPending( |
132 scoped_refptr<RasterSource> raster_source, | 132 scoped_refptr<RasterSource> raster_source, |
133 const Region& invalidation) { | 133 const Region& invalidation) { |
134 DCHECK(layer_tree_impl()->IsPendingTree()); | 134 DCHECK(layer_tree_impl()->IsPendingTree()); |
135 Region invalidation_temp = invalidation; | 135 Region invalidation_temp = invalidation; |
136 const PictureLayerTilingSet* pending_set = nullptr; | 136 const PictureLayerTilingSet* pending_set = nullptr; |
137 UpdateRasterSource(raster_source, &invalidation_temp, pending_set); | 137 UpdateRasterSource(raster_source, &invalidation_temp, pending_set); |
138 } | 138 } |
139 | 139 |
| 140 void FakePictureLayerImpl::SetIsDrawnRenderSurfaceLayerListMember(bool is) { |
| 141 draw_properties().last_drawn_render_surface_layer_list_id = |
| 142 is ? layer_tree_impl()->current_render_surface_list_id() |
| 143 : layer_tree_impl()->current_render_surface_list_id() - 1; |
| 144 } |
| 145 |
140 void FakePictureLayerImpl::CreateAllTiles() { | 146 void FakePictureLayerImpl::CreateAllTiles() { |
141 for (size_t i = 0; i < num_tilings(); ++i) | 147 for (size_t i = 0; i < num_tilings(); ++i) |
142 tilings_->tiling_at(i)->CreateAllTilesForTesting(); | 148 tilings_->tiling_at(i)->CreateAllTilesForTesting(); |
143 } | 149 } |
144 | 150 |
145 void FakePictureLayerImpl::SetAllTilesVisible() { | 151 void FakePictureLayerImpl::SetAllTilesVisible() { |
146 WhichTree tree = | 152 WhichTree tree = |
147 layer_tree_impl()->IsActiveTree() ? ACTIVE_TREE : PENDING_TREE; | 153 layer_tree_impl()->IsActiveTree() ? ACTIVE_TREE : PENDING_TREE; |
148 | 154 |
149 for (size_t tiling_idx = 0; tiling_idx < tilings_->num_tilings(); | 155 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( | 272 return CountTilesRequired( |
267 &PictureLayerTiling::IsTileRequiredForDrawIfVisible); | 273 &PictureLayerTiling::IsTileRequiredForDrawIfVisible); |
268 } | 274 } |
269 | 275 |
270 void FakePictureLayerImpl::ReleaseResources() { | 276 void FakePictureLayerImpl::ReleaseResources() { |
271 PictureLayerImpl::ReleaseResources(); | 277 PictureLayerImpl::ReleaseResources(); |
272 ++release_resources_count_; | 278 ++release_resources_count_; |
273 } | 279 } |
274 | 280 |
275 } // namespace cc | 281 } // namespace cc |
OLD | NEW |