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

Side by Side Diff: cc/resources/picture_layer_tiling.cc

Issue 678773002: cc: Always use invalidation on the pending tree when deciding to share (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: getpendinginvalidation: . 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/resources/picture_layer_tiling.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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/resources/picture_layer_tiling.h" 5 #include "cc/resources/picture_layer_tiling.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <limits> 9 #include <limits>
10 #include <set> 10 #include <set>
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 gfx::Rect tile_rect = paint_rect; 119 gfx::Rect tile_rect = paint_rect;
120 tile_rect.set_size(tiling_data_.max_texture_size()); 120 tile_rect.set_size(tiling_data_.max_texture_size());
121 121
122 // Check our twin for a valid tile. 122 // Check our twin for a valid tile.
123 if (twin_tiling && 123 if (twin_tiling &&
124 tiling_data_.max_texture_size() == 124 tiling_data_.max_texture_size() ==
125 twin_tiling->tiling_data_.max_texture_size()) { 125 twin_tiling->tiling_data_.max_texture_size()) {
126 if (Tile* candidate_tile = twin_tiling->TileAt(i, j)) { 126 if (Tile* candidate_tile = twin_tiling->TileAt(i, j)) {
127 gfx::Rect rect = 127 gfx::Rect rect =
128 gfx::ScaleToEnclosingRect(paint_rect, 1.0f / contents_scale_); 128 gfx::ScaleToEnclosingRect(paint_rect, 1.0f / contents_scale_);
129 if (!client_->GetInvalidation()->Intersects(rect)) { 129 const Region* invalidation = client_->GetPendingInvalidation();
130 if (!invalidation || !invalidation->Intersects(rect)) {
130 DCHECK(!candidate_tile->is_shared()); 131 DCHECK(!candidate_tile->is_shared());
131 DCHECK_EQ(i, candidate_tile->tiling_i_index()); 132 DCHECK_EQ(i, candidate_tile->tiling_i_index());
132 DCHECK_EQ(j, candidate_tile->tiling_j_index()); 133 DCHECK_EQ(j, candidate_tile->tiling_j_index());
133 candidate_tile->set_shared(true); 134 candidate_tile->set_shared(true);
134 tiles_[key] = candidate_tile; 135 tiles_[key] = candidate_tile;
135 return candidate_tile; 136 return candidate_tile;
136 } 137 }
137 } 138 }
138 } 139 }
139 140
(...skipping 1086 matching lines...) Expand 10 before | Expand all | Expand 10 after
1226 DCHECK(*this); 1227 DCHECK(*this);
1227 do { 1228 do {
1228 ++current_eviction_tiles_index_; 1229 ++current_eviction_tiles_index_;
1229 } while (current_eviction_tiles_index_ != eviction_tiles_->size() && 1230 } while (current_eviction_tiles_index_ != eviction_tiles_->size() &&
1230 !(*eviction_tiles_)[current_eviction_tiles_index_]->HasResources()); 1231 !(*eviction_tiles_)[current_eviction_tiles_index_]->HasResources());
1231 1232
1232 return *this; 1233 return *this;
1233 } 1234 }
1234 1235
1235 } // namespace cc 1236 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/picture_layer_tiling.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