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

Unified Diff: cc/layers/picture_layer.cc

Issue 706203003: Update from https://crrev.com/303153 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/layers/layer_impl_unittest.cc ('k') | cc/layers/picture_layer_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/picture_layer.cc
diff --git a/cc/layers/picture_layer.cc b/cc/layers/picture_layer.cc
index f608ba7ae92e6eb6863084ea963dc0c08f5b6956..c56ff8be082b67dbf33e8db8193481efc99b2307 100644
--- a/cc/layers/picture_layer.cc
+++ b/cc/layers/picture_layer.cc
@@ -35,16 +35,22 @@ void PictureLayer::PushPropertiesTo(LayerImpl* base_layer) {
Layer::PushPropertiesTo(base_layer);
PictureLayerImpl* layer_impl = static_cast<PictureLayerImpl*>(base_layer);
- if (layer_impl->bounds().IsEmpty()) {
- // Update may not get called for an empty layer, so resize here instead.
- // Using layer_impl because either bounds() or paint_properties().bounds
- // may disagree and either one could have been pushed to layer_impl.
+ int source_frame_number = layer_tree_host()->source_frame_number();
+ gfx::Size impl_bounds = layer_impl->bounds();
+ gfx::Size pile_bounds = pile_.tiling_size();
+
+ // If update called, then pile size must match bounds pushed to impl layer.
+ DCHECK_IMPLIES(update_source_frame_number_ == source_frame_number,
+ impl_bounds == pile_bounds)
+ << " bounds " << impl_bounds.ToString() << " pile "
+ << pile_bounds.ToString();
+
+ if (update_source_frame_number_ != source_frame_number &&
+ pile_bounds != impl_bounds) {
+ // Update may not get called for the layer (if it's not in the viewport
+ // for example, even though it has resized making the pile no longer
+ // valid. In this case just destroy the pile.
pile_.SetEmptyBounds();
- } else {
- // If update called, then pile size must match bounds pushed to impl layer.
- DCHECK_IMPLIES(
- update_source_frame_number_ == layer_tree_host()->source_frame_number(),
- layer_impl->bounds().ToString() == pile_.tiling_size().ToString());
}
// Unlike other properties, invalidation must always be set on layer_impl.
« no previous file with comments | « cc/layers/layer_impl_unittest.cc ('k') | cc/layers/picture_layer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698