diff options
author | vmpstr <vmpstr@chromium.org> | 2015-05-26 15:41:34 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-05-26 22:43:01 +0000 |
commit | e480760fcbb3f3b551297cb76a638295e8c3fe13 (patch) | |
tree | 89756e33ce7bbca15639851fc77d9a2d24f399fc | |
parent | ab54ae9446c61335e47e7bedd3c8dded9bef1c3b (diff) | |
download | chromium_src-e480760fcbb3f3b551297cb76a638295e8c3fe13.zip chromium_src-e480760fcbb3f3b551297cb76a638295e8c3fe13.tar.gz chromium_src-e480760fcbb3f3b551297cb76a638295e8c3fe13.tar.bz2 |
cc: Don't invalidate pending tree tilings on commit.
Since we're not sharing tiles, there should be no tiles on the pending
tree when we're committing. That means we can skip region iteration
and scaling.
R=danakj
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel
Review URL: https://codereview.chromium.org/1150713003
Cr-Commit-Position: refs/heads/master@{#331463}
-rw-r--r-- | cc/tiles/picture_layer_tiling_set.cc | 8 | ||||
-rw-r--r-- | cc/tiles/picture_layer_tiling_set_unittest.cc | 6 |
2 files changed, 13 insertions, 1 deletions
diff --git a/cc/tiles/picture_layer_tiling_set.cc b/cc/tiles/picture_layer_tiling_set.cc index 1a69814..416eefc 100644 --- a/cc/tiles/picture_layer_tiling_set.cc +++ b/cc/tiles/picture_layer_tiling_set.cc @@ -139,8 +139,14 @@ void PictureLayerTilingSet::UpdateTilingsToCurrentRasterSourceForCommit( // Invalidate tiles and update them to the new raster source. for (PictureLayerTiling* tiling : tilings_) { + DCHECK_IMPLIES(tree_ == PENDING_TREE, !tiling->has_tiles()); tiling->SetRasterSourceAndResize(raster_source); - tiling->Invalidate(layer_invalidation); + + // We can commit on either active or pending trees, but only active one can + // have tiles at this point. + if (tree_ == ACTIVE_TREE) + tiling->Invalidate(layer_invalidation); + // This is needed for cases where the live tiles rect didn't change but // recordings exist in the raster source that did not exist on the last // raster source. diff --git a/cc/tiles/picture_layer_tiling_set_unittest.cc b/cc/tiles/picture_layer_tiling_set_unittest.cc index 2d0a1b2..f5fc167 100644 --- a/cc/tiles/picture_layer_tiling_set_unittest.cc +++ b/cc/tiles/picture_layer_tiling_set_unittest.cc @@ -334,6 +334,12 @@ TEST(PictureLayerTilingSetTest, TileSizeChange) { EXPECT_EQ(tile_size1, tile->content_rect().size()); // Update to a new source frame with a new tile size. + // Note that setting a new raster source can typically only happen after + // activation, since we can't set the raster source twice on the pending tree + // without activating. For test, just remove and add a new tiling instead. + pending_set->RemoveAllTilings(); + pending_set->AddTiling(1.f, pile); + pending_set->tiling_at(0)->set_resolution(HIGH_RESOLUTION); pending_client.SetTileSize(tile_size2); pending_set->UpdateTilingsToCurrentRasterSourceForCommit(pile.get(), Region(), 1.f, 1.f); |