summaryrefslogtreecommitdiffstats
path: root/cc/layers
diff options
context:
space:
mode:
authorboliu@chromium.org <boliu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-28 22:04:38 +0000
committerboliu@chromium.org <boliu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-28 22:04:38 +0000
commitabe5134c4fca11b98e4f8eea59843b459b68e103 (patch)
treec30436a743cd49a0c2e6b31184345860d9b5e193 /cc/layers
parent0d784792f432a058824d332d3cd7f4f2617f2092 (diff)
downloadchromium_src-abe5134c4fca11b98e4f8eea59843b459b68e103.zip
chromium_src-abe5134c4fca11b98e4f8eea59843b459b68e103.tar.gz
chromium_src-abe5134c4fca11b98e4f8eea59843b459b68e103.tar.bz2
cc: Fix DCHECK in PictureLayer::PushPropertiesTo
The DCHECK will only hold if PictureLayer::Update is called in that frame. DrawContents is not enough since there are other cases in LayerTreeHostCommon::LayerShouldBeSkipped that causes Update to be skipped. Instead keep track of the frame number when Update was and compare it to the current frame number. BUG=311311 Review URL: https://codereview.chromium.org/42653002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@231421 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/layers')
-rw-r--r--cc/layers/picture_layer.cc10
-rw-r--r--cc/layers/picture_layer.h2
2 files changed, 9 insertions, 3 deletions
diff --git a/cc/layers/picture_layer.cc b/cc/layers/picture_layer.cc
index 03f76f4..bc311a3 100644
--- a/cc/layers/picture_layer.cc
+++ b/cc/layers/picture_layer.cc
@@ -20,7 +20,8 @@ PictureLayer::PictureLayer(ContentLayerClient* client)
: client_(client),
pile_(make_scoped_refptr(new PicturePile())),
instrumentation_object_tracker_(id()),
- is_mask_(false) {
+ is_mask_(false),
+ update_source_frame_number_(-1) {
}
PictureLayer::~PictureLayer() {
@@ -44,8 +45,10 @@ void PictureLayer::PushPropertiesTo(LayerImpl* base_layer) {
// may disagree and either one could have been pushed to layer_impl.
pile_->Resize(gfx::Size());
pile_->UpdateRecordedRegion();
- } else if (DrawsContent()) {
- DCHECK(paint_properties().bounds == pile_->size());
+ } else if (update_source_frame_number_ ==
+ layer_tree_host()->source_frame_number()) {
+ // If update called, then pile size must match bounds pushed to impl layer.
+ DCHECK_EQ(layer_impl->bounds().ToString(), pile_->size().ToString());
}
layer_impl->SetIsMask(is_mask_);
@@ -88,6 +91,7 @@ bool PictureLayer::Update(ResourceUpdateQueue* queue,
"source_frame_number",
layer_tree_host()->source_frame_number());
+ update_source_frame_number_ = layer_tree_host()->source_frame_number();
bool updated = Layer::Update(queue, occlusion);
pile_->Resize(paint_properties().bounds);
diff --git a/cc/layers/picture_layer.h b/cc/layers/picture_layer.h
index f67ca91..e1e4a9c 100644
--- a/cc/layers/picture_layer.h
+++ b/cc/layers/picture_layer.h
@@ -56,6 +56,8 @@ class CC_EXPORT PictureLayer : public Layer {
Region pile_invalidation_;
bool is_mask_;
+ int update_source_frame_number_;
+
DISALLOW_COPY_AND_ASSIGN(PictureLayer);
};