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

Unified Diff: cc/layers/picture_layer_impl.cc

Issue 1041893003: cc: Separate tiling set functionality into explicit separate functions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update Created 5 years, 9 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
« no previous file with comments | « no previous file | cc/resources/picture_layer_tiling.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/picture_layer_impl.cc
diff --git a/cc/layers/picture_layer_impl.cc b/cc/layers/picture_layer_impl.cc
index e60d425f6c9d2bd554a605701f00bf3ea6060e11..c8d7efae4eecf2ff8b2bb9e2b65a6cb0f74c1e5c 100644
--- a/cc/layers/picture_layer_impl.cc
+++ b/cc/layers/picture_layer_impl.cc
@@ -541,9 +541,15 @@ void PictureLayerImpl::UpdateRasterSource(
// We could do this after doing UpdateTiles, which would avoid doing this for
// tilings that are going to disappear on the pending tree (if scale changed).
// But that would also be more complicated, so we just do it here for now.
- tilings_->UpdateTilingsToCurrentRasterSource(
- raster_source_, pending_set, invalidation_, MinimumContentsScale(),
- MaximumContentsScale());
+ if (pending_set) {
+ tilings_->UpdateTilingsToCurrentRasterSourceForActivation(
+ raster_source_, pending_set, invalidation_, MinimumContentsScale(),
+ MaximumContentsScale());
+ } else {
+ tilings_->UpdateTilingsToCurrentRasterSourceForCommit(
+ raster_source_, invalidation_, MinimumContentsScale(),
+ MaximumContentsScale());
+ }
}
void PictureLayerImpl::UpdateCanUseLCDTextAfterCommit() {
@@ -562,10 +568,12 @@ void PictureLayerImpl::UpdateCanUseLCDTextAfterCommit() {
// a new one must be created and all tiles recreated.
scoped_refptr<RasterSource> new_raster_source =
raster_source_->CreateCloneWithoutLCDText();
+ raster_source_.swap(new_raster_source);
+
// Synthetically invalidate everything.
gfx::Rect bounds_rect(bounds());
- Region invalidation(bounds_rect);
- UpdateRasterSource(new_raster_source, &invalidation, nullptr);
+ invalidation_ = Region(bounds_rect);
+ tilings_->UpdateRasterSourceDueToLCDChange(raster_source_, invalidation_);
SetUpdateRect(bounds_rect);
DCHECK(!RasterSourceUsesLCDText());
« no previous file with comments | « no previous file | cc/resources/picture_layer_tiling.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698