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

Unified Diff: cc/layers/layer.cc

Issue 23530003: cc: Block commit on activate by setting a flag on LayerTreeHost. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: blockcommit: fix flake 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/layer.h ('k') | cc/layers/texture_layer.h » ('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 8cb61d9ef8949f921a5695dd8aafdf654f65104f..e7cf7557d8f67b6db3c28acaa745bacada0fa93f 100644
--- a/cc/layers/layer.cc
+++ b/cc/layers/layer.cc
@@ -152,14 +152,11 @@ void Layer::SetNeedsFullTreeSync() {
layer_tree_host_->SetNeedsFullTreeSync();
}
-bool Layer::IsPropertyChangeAllowed() const {
+void Layer::SetNextCommitWaitsForActivation() {
if (!layer_tree_host_)
- return true;
-
- if (!layer_tree_host_->settings().strict_layer_property_change_checking)
- return true;
+ return;
- return !layer_tree_host_->in_paint_layer_contents();
+ layer_tree_host_->SetNextCommitWaitsForActivation();
}
void Layer::SetNeedsPushProperties() {
@@ -187,6 +184,16 @@ void Layer::RemoveDependentNeedsPushProperties() {
parent_->RemoveDependentNeedsPushProperties();
}
+bool Layer::IsPropertyChangeAllowed() const {
+ if (!layer_tree_host_)
+ return true;
+
+ if (!layer_tree_host_->settings().strict_layer_property_change_checking)
+ return true;
+
+ return !layer_tree_host_->in_paint_layer_contents();
+}
+
gfx::Rect Layer::LayerRectToContentRect(const gfx::RectF& layer_rect) const {
gfx::RectF content_rect =
gfx::ScaleRect(layer_rect, contents_scale_x(), contents_scale_y());
@@ -196,10 +203,6 @@ gfx::Rect Layer::LayerRectToContentRect(const gfx::RectF& layer_rect) const {
return gfx::ToEnclosingRect(content_rect);
}
-bool Layer::BlocksPendingCommit() const {
- return false;
-}
-
skia::RefPtr<SkPicture> Layer::GetPicture() const {
return skia::RefPtr<SkPicture>();
}
@@ -208,20 +211,6 @@ bool Layer::CanClipSelf() const {
return false;
}
-bool Layer::BlocksPendingCommitRecursive() const {
- if (BlocksPendingCommit())
- return true;
- if (mask_layer() && mask_layer()->BlocksPendingCommitRecursive())
- return true;
- if (replica_layer() && replica_layer()->BlocksPendingCommitRecursive())
- return true;
- for (size_t i = 0; i < children_.size(); ++i) {
- if (children_[i]->BlocksPendingCommitRecursive())
- return true;
- }
- return false;
-}
-
void Layer::SetParent(Layer* layer) {
DCHECK(!layer || !layer->HasAncestor(this));
« no previous file with comments | « cc/layers/layer.h ('k') | cc/layers/texture_layer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698