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

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: Simpler to dcheck in TiledLayer 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..cda2eacab5496fd88a258ecd759b1b69aa220b32 100644
--- a/cc/layers/layer.cc
+++ b/cc/layers/layer.cc
@@ -55,7 +55,8 @@ Layer::Layer()
draw_checkerboard_for_missing_tiles_(false),
force_render_surface_(false),
replica_layer_(NULL),
- raster_scale_(0.f) {
+ raster_scale_(0.f),
+ saved_paint_properties_(false) {
if (layer_id_ < 0) {
s_next_layer_id = 1;
layer_id_ = s_next_layer_id++;
@@ -729,7 +730,8 @@ void Layer::PushPropertiesTo(LayerImpl* layer) {
layer->SetAnchorPoint(anchor_point_);
layer->SetAnchorPointZ(anchor_point_z_);
layer->SetBackgroundColor(background_color_);
- layer->SetBounds(paint_properties_.bounds);
+ layer->SetBounds(saved_paint_properties_ ? paint_properties_.bounds
+ : bounds_);
layer->SetContentBounds(content_bounds());
layer->SetContentsScale(contents_scale_x(), contents_scale_y());
layer->SetDebugName(debug_name_);
@@ -825,6 +827,8 @@ void Layer::PushPropertiesTo(LayerImpl* layer) {
// crbug.com/259088
needs_push_properties_ = layer_animation_controller_->has_any_animation();
num_dependents_need_push_properties_ = 0;
+
+ saved_paint_properties_ = false;
}
scoped_ptr<LayerImpl> Layer::CreateLayerImpl(LayerTreeImpl* tree_impl) {
@@ -839,10 +843,12 @@ 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_;
+ saved_paint_properties_ = true;
}
bool Layer::Update(ResourceUpdateQueue* queue,
const OcclusionTracker* occlusion) {
+ DCHECK(saved_paint_properties_);
enne (OOO) 2013/08/02 17:00:48 This seems like something that could be easily ski
danakj 2013/08/02 21:57:28 Done.
return false;
}
« no previous file with comments | « cc/layers/layer.h ('k') | cc/layers/nine_patch_layer.cc » ('j') | cc/layers/picture_layer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698