Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Side by Side Diff: cc/test/fake_picture_layer_impl.cc

Issue 676953003: cc: Always keep the PictureLayerImpl::twin_layer_ pointer valid. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: twins: anothercheck Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/test/fake_picture_layer_impl.h ('k') | cc/test/fake_picture_layer_tiling_client.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 PictureLayerTiling* tiling = tilings_->tiling_at(i); 90 PictureLayerTiling* tiling = tilings_->tiling_at(i);
91 if (tiling->resolution() == LOW_RESOLUTION) { 91 if (tiling->resolution() == LOW_RESOLUTION) {
92 // There should be only one low res tiling. 92 // There should be only one low res tiling.
93 CHECK(!result); 93 CHECK(!result);
94 result = tiling; 94 result = tiling;
95 } 95 }
96 } 96 }
97 return result; 97 return result;
98 } 98 }
99 99
100 void FakePictureLayerImpl::SetPile(scoped_refptr<PicturePileImpl> pile) {
101 pile_.swap(pile);
102 if (tilings()) {
103 for (size_t i = 0; i < num_tilings(); ++i) {
104 tilings()->tiling_at(i)->UpdateTilesToCurrentPile(Region(),
105 pile_->tiling_size());
106 }
107 }
108 }
109
100 void FakePictureLayerImpl::SetAllTilesVisible() { 110 void FakePictureLayerImpl::SetAllTilesVisible() {
101 WhichTree tree = 111 WhichTree tree =
102 layer_tree_impl()->IsActiveTree() ? ACTIVE_TREE : PENDING_TREE; 112 layer_tree_impl()->IsActiveTree() ? ACTIVE_TREE : PENDING_TREE;
103 113
104 for (size_t tiling_idx = 0; tiling_idx < tilings_->num_tilings(); 114 for (size_t tiling_idx = 0; tiling_idx < tilings_->num_tilings();
105 ++tiling_idx) { 115 ++tiling_idx) {
106 PictureLayerTiling* tiling = tilings_->tiling_at(tiling_idx); 116 PictureLayerTiling* tiling = tilings_->tiling_at(tiling_idx);
107 std::vector<Tile*> tiles = tiling->AllTilesForTesting(); 117 std::vector<Tile*> tiles = tiling->AllTilesForTesting();
108 for (size_t tile_idx = 0; tile_idx < tiles.size(); ++tile_idx) { 118 for (size_t tile_idx = 0; tile_idx < tiles.size(); ++tile_idx) {
109 Tile* tile = tiles[tile_idx]; 119 Tile* tile = tiles[tile_idx];
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 ? has_valid_tile_priorities_ 189 ? has_valid_tile_priorities_
180 : PictureLayerImpl::HasValidTilePriorities(); 190 : PictureLayerImpl::HasValidTilePriorities();
181 } 191 }
182 192
183 void FakePictureLayerImpl::ReleaseResources() { 193 void FakePictureLayerImpl::ReleaseResources() {
184 PictureLayerImpl::ReleaseResources(); 194 PictureLayerImpl::ReleaseResources();
185 ++release_resources_count_; 195 ++release_resources_count_;
186 } 196 }
187 197
188 } // namespace cc 198 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/fake_picture_layer_impl.h ('k') | cc/test/fake_picture_layer_tiling_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698