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

Unified Diff: cc/layers/layer.cc

Issue 21839004: cc: Push valid property values when CalcDrawProps skips layer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: pushpaintprops: stuff Created 7 years, 5 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/layers/layer.cc
diff --git a/cc/layers/layer.cc b/cc/layers/layer.cc
index dd150e38598fbe6c739644929154ebf8d83d8e13..2e778a576d3042fb2554a0c3cc06410cde976c8a 100644
--- a/cc/layers/layer.cc
+++ b/cc/layers/layer.cc
@@ -726,10 +726,16 @@ static void PostCopyCallbackToMainThread(
}
void Layer::PushPropertiesTo(LayerImpl* layer) {
+ // If we did not SavePaintProperties() for the layer this frame, then push the
+ // real property values, not the paint property values.
+ bool use_paint_properties = paint_properties_.source_frame_number ==
+ layer_tree_host_->source_frame_number();
+
layer->SetAnchorPoint(anchor_point_);
layer->SetAnchorPointZ(anchor_point_z_);
layer->SetBackgroundColor(background_color_);
- layer->SetBounds(paint_properties_.bounds);
+ layer->SetBounds(use_paint_properties ? paint_properties_.bounds
+ : bounds_);
layer->SetContentBounds(content_bounds());
layer->SetContentsScale(contents_scale_x(), contents_scale_y());
layer->SetDebugName(debug_name_);
@@ -839,10 +845,14 @@ void Layer::SavePaintProperties() {
// TODO(reveman): Save all layer properties that we depend on not
// changing until PushProperties() has been called. crbug.com/231016
paint_properties_.bounds = bounds_;
+ paint_properties_.source_frame_number =
+ layer_tree_host_->source_frame_number();
}
bool Layer::Update(ResourceUpdateQueue* queue,
const OcclusionTracker* occlusion) {
+ DCHECK_EQ(layer_tree_host_->source_frame_number(),
+ paint_properties_.source_frame_number);
return false;
}

Powered by Google App Engine
This is Rietveld 408576698