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

Unified Diff: cc/resources/picture_layer_tiling.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: add-test-case Created 6 years, 2 months 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 side-by-side diff with in-line comments
Download patch
Index: cc/resources/picture_layer_tiling.cc
diff --git a/cc/resources/picture_layer_tiling.cc b/cc/resources/picture_layer_tiling.cc
index 4dc46e0820b04062bbb8621ed8ef32985a51d4bc..c04218450873f5e8ce7a298ab9b5e57f1f5cc5a9 100644
--- a/cc/resources/picture_layer_tiling.cc
+++ b/cc/resources/picture_layer_tiling.cc
@@ -148,7 +148,8 @@ Tile* PictureLayerTiling::CreateTile(int i,
}
void PictureLayerTiling::CreateMissingTilesInLiveTilesRect() {
- const PictureLayerTiling* twin_tiling = client_->GetTwinTiling(this);
+ const PictureLayerTiling* twin_tiling =
+ client_->GetPendingOrActiveTwinTiling(this);
bool include_borders = false;
for (TilingData::Iterator iter(
&tiling_data_, live_tiles_rect_, include_borders);
@@ -225,7 +226,8 @@ void PictureLayerTiling::UpdateTilesToCurrentPile(
// If the layer grew, the live_tiles_rect_ is not changed, but a new row
// and/or column of tiles may now exist inside the same live_tiles_rect_.
- const PictureLayerTiling* twin_tiling = client_->GetTwinTiling(this);
+ const PictureLayerTiling* twin_tiling =
+ client_->GetPendingOrActiveTwinTiling(this);
if (after_right > before_right) {
DCHECK_EQ(after_right, before_right + 1);
for (int j = before_top; j <= after_bottom; ++j)
@@ -629,7 +631,8 @@ void PictureLayerTiling::SetLiveTilesRect(
RemoveTileAt(iter.index_x(), iter.index_y(), recycled_twin);
}
- const PictureLayerTiling* twin_tiling = client_->GetTwinTiling(this);
+ const PictureLayerTiling* twin_tiling =
+ client_->GetPendingOrActiveTwinTiling(this);
// Iterate to allocate new tiles for all regions with newly exposed area.
for (TilingData::DifferenceIterator iter(&tiling_data_,
@@ -717,7 +720,8 @@ bool PictureLayerTiling::IsTileRequiredForActivation(const Tile* tile) const {
if (client_->RequiresHighResToDraw())
return true;
- const PictureLayerTiling* twin_tiling = client_->GetTwinTiling(this);
+ const PictureLayerTiling* twin_tiling =
+ client_->GetPendingOrActiveTwinTiling(this);
if (!twin_tiling)
return true;
@@ -740,7 +744,8 @@ bool PictureLayerTiling::IsTileRequiredForActivation(const Tile* tile) const {
void PictureLayerTiling::UpdateTileAndTwinPriority(Tile* tile) const {
UpdateTilePriority(tile);
- const PictureLayerTiling* twin_tiling = client_->GetTwinTiling(this);
+ const PictureLayerTiling* twin_tiling =
+ client_->GetPendingOrActiveTwinTiling(this);
if (!tile->is_shared() || !twin_tiling) {
WhichTree tree = client_->GetTree();
WhichTree twin_tree = tree == ACTIVE_TREE ? PENDING_TREE : ACTIVE_TREE;

Powered by Google App Engine
This is Rietveld 408576698