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

Unified Diff: cc/layers/layer.cc

Issue 2822303003: cc : Compute subtree has copy requests before property tree building (Closed)
Patch Set: . Created 3 years, 8 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 72a530a3bf3f15434f20742c1e569175560f6963..30e1d5cc2195355b923483d203986508de870e7f 100644
--- a/cc/layers/layer.cc
+++ b/cc/layers/layer.cc
@@ -93,6 +93,7 @@ Layer::Layer()
may_contain_video_(false),
is_scroll_clip_layer_(false),
needs_show_scrollbars_(false),
+ subtree_has_copy_request_(false),
safe_opaque_background_color_(0),
num_unclipped_descendants_(0) {}
@@ -362,6 +363,20 @@ void Layer::RequestCopyOfOutput(std::unique_ptr<CopyOutputRequest> request) {
SetSubtreePropertyChanged();
SetPropertyTreesNeedRebuild();
SetNeedsCommit();
+ if (layer_tree_host_)
+ layer_tree_host_->SetHasCopyRequest(true);
+}
+
+void Layer::SetSubtreeHasCopyRequest(bool subtree_has_copy_request) {
+ subtree_has_copy_request_ = subtree_has_copy_request;
+}
+
+bool Layer::SubtreeHasCopyRequest() const {
+ DCHECK(layer_tree_host_);
+ // When the copy request is pushed to effect tree, we reset layer tree host's
+ // has_copy_request but do not clear subtree_has_copy_request on individual
+ // layers.
+ return layer_tree_host_->has_copy_request() && subtree_has_copy_request_;
}
void Layer::SetBackgroundColor(SkColor background_color) {
@@ -1436,10 +1451,10 @@ void Layer::SetMutableProperties(uint32_t properties) {
SetNeedsCommit();
}
-int Layer::num_copy_requests_in_target_subtree() {
+bool Layer::has_copy_requests_in_target_subtree() {
return layer_tree_host_->property_trees()
->effect_tree.Node(effect_tree_index())
- ->num_copy_requests_in_subtree;
+ ->subtree_has_copy_request;
}
gfx::Transform Layer::ScreenSpaceTransform() const {
« no previous file with comments | « cc/layers/layer.h ('k') | cc/layers/layer_impl.h » ('j') | cc/trees/draw_property_utils.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698