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

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: Call SavePaintProps when needed in tests Created 7 years, 4 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/contents_scaling_layer.cc ('k') | cc/layers/nine_patch_layer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/layer.cc
diff --git a/cc/layers/layer.cc b/cc/layers/layer.cc
index 1079aecd471d178170661faa5d37272f111518d9..aa4a002dff41294c5799627a77fccf72889a4437 100644
--- a/cc/layers/layer.cc
+++ b/cc/layers/layer.cc
@@ -730,10 +730,16 @@ static void PostCopyCallbackToMainThread(
void Layer::PushPropertiesTo(LayerImpl* layer) {
DCHECK(layer_tree_host_);
+ // 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_);
@@ -845,11 +851,16 @@ 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(layer_tree_host_);
+ DCHECK_EQ(layer_tree_host_->source_frame_number(),
+ paint_properties_.source_frame_number) <<
+ "SavePaintProperties must be called for any layer that is painted.";
return false;
}
« no previous file with comments | « cc/layers/contents_scaling_layer.cc ('k') | cc/layers/nine_patch_layer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698