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

Unified Diff: cc/layers/picture_layer_impl.cc

Issue 683113005: Update from chromium https://crrev.com/302282 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: 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
« no previous file with comments | « cc/layers/picture_layer_impl.h ('k') | cc/layers/picture_layer_impl_unittest.cc » ('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 7fd7730be24e32de49cf1a87552ea33e8858320f..c3c7ca021104ba5f2468b233838d45beee16c845 100644
--- a/cc/layers/picture_layer_impl.cc
+++ b/cc/layers/picture_layer_impl.cc
@@ -122,7 +122,7 @@ void PictureLayerImpl::PushPropertiesTo(LayerImpl* base_layer) {
twin_layer_ = layer_impl;
layer_impl->twin_layer_ = this;
- layer_impl->pile_ = pile_;
+ layer_impl->UpdatePile(pile_);
DCHECK(!pile_->is_solid_color() || !tilings_->num_tilings());
// Tilings would be expensive to push, so we swap.
@@ -158,6 +158,16 @@ void PictureLayerImpl::PushPropertiesTo(LayerImpl* base_layer) {
needs_push_properties_ = true;
}
+void PictureLayerImpl::UpdatePile(scoped_refptr<PicturePileImpl> pile) {
+ bool could_have_tilings = CanHaveTilings();
+ pile_.swap(pile);
+
+ // Need to call UpdateTiles again if CanHaveTilings changed.
+ if (could_have_tilings != CanHaveTilings()) {
+ layer_tree_impl()->set_needs_update_draw_properties();
+ }
+}
+
void PictureLayerImpl::AppendQuads(RenderPass* render_pass,
const Occlusion& occlusion_in_content_space,
AppendQuadsData* append_quads_data) {
« no previous file with comments | « cc/layers/picture_layer_impl.h ('k') | cc/layers/picture_layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698