summaryrefslogtreecommitdiffstats
path: root/cc/layers
diff options
context:
space:
mode:
authorenne <enne@chromium.org>2015-09-22 00:45:38 -0700
committerCommit bot <commit-bot@chromium.org>2015-09-22 07:46:25 +0000
commitf6ec8ed9184e75502fff67325e9fd03aed61aec4 (patch)
tree2c5123574b262505833e780ae8c205948ef2cd98 /cc/layers
parentad0c0ac625cc4bb6edbb80e41131ecabbc1b0a92 (diff)
downloadchromium_src-f6ec8ed9184e75502fff67325e9fd03aed61aec4.zip
chromium_src-f6ec8ed9184e75502fff67325e9fd03aed61aec4.tar.gz
chromium_src-f6ec8ed9184e75502fff67325e9fd03aed61aec4.tar.bz2
cc: Synchronize num copy requests to LayerImpl
With this change, precalculate meta-information no longer needs to be run for property trees on the compositor thread. Since we don't have a property tree-only mode yet, we can't do this in practice yet, but it will be useful for one-off benchmarking. Property trees currently only need two pieces of meta-information (num unclipped descendants for building property trees on the main thread, and num copy requests). Both of these could move to the effect tree in the future. R=weiliangc@chromium.org,ajuma@chromium.org CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1335383003 Cr-Commit-Position: refs/heads/master@{#350125}
Diffstat (limited to 'cc/layers')
-rw-r--r--cc/layers/draw_properties.cc1
-rw-r--r--cc/layers/draw_properties.h4
-rw-r--r--cc/layers/layer.cc2
-rw-r--r--cc/layers/layer.h1
-rw-r--r--cc/layers/layer_impl.cc3
-rw-r--r--cc/layers/layer_impl.h11
6 files changed, 16 insertions, 6 deletions
diff --git a/cc/layers/draw_properties.cc b/cc/layers/draw_properties.cc
index da0d41e..19c5245 100644
--- a/cc/layers/draw_properties.cc
+++ b/cc/layers/draw_properties.cc
@@ -12,7 +12,6 @@ DrawProperties::DrawProperties()
can_use_lcd_text(false),
render_target(nullptr),
num_unclipped_descendants(0),
- layer_or_descendant_has_copy_request(false),
layer_or_descendant_has_input_handler(false),
has_child_with_a_scroll_parent(false),
last_drawn_render_surface_layer_list_id(0),
diff --git a/cc/layers/draw_properties.h b/cc/layers/draw_properties.h
index a84876f..3177dc0 100644
--- a/cc/layers/draw_properties.h
+++ b/cc/layers/draw_properties.h
@@ -65,10 +65,6 @@ struct CC_EXPORT DrawProperties {
// does not include our clip children because they are clipped by us.
size_t num_unclipped_descendants;
- // If true, the layer or some layer in its sub-tree has a CopyOutputRequest
- // present on it.
- bool layer_or_descendant_has_copy_request;
-
// If true, the layer or one of its descendants has a wheel or touch handler.
bool layer_or_descendant_has_input_handler;
diff --git a/cc/layers/layer.cc b/cc/layers/layer.cc
index 62362f5..c9e5369 100644
--- a/cc/layers/layer.cc
+++ b/cc/layers/layer.cc
@@ -1211,6 +1211,8 @@ void Layer::PushPropertiesTo(LayerImpl* layer) {
layer->SetShouldFlattenTransform(should_flatten_transform_);
layer->set_should_flatten_transform_from_property_tree(
should_flatten_transform_from_property_tree_);
+ layer->set_num_layer_or_descendant_with_copy_request(
+ num_layer_or_descendants_with_copy_request_);
layer->set_is_clipped(is_clipped_);
layer->set_draw_blend_mode(draw_blend_mode_);
layer->SetUseParentBackfaceVisibility(use_parent_backface_visibility_);
diff --git a/cc/layers/layer.h b/cc/layers/layer.h
index b4794d2..e134554 100644
--- a/cc/layers/layer.h
+++ b/cc/layers/layer.h
@@ -494,6 +494,7 @@ class CC_EXPORT Layer : public base::RefCounted<Layer>,
}
void DidBeginTracing();
+ // TODO(weiliangc): this should move to the effect tree.
void set_num_layer_or_descendant_with_copy_request(
int num_layer_or_descendants_with_copy_request) {
num_layer_or_descendants_with_copy_request_ =
diff --git a/cc/layers/layer_impl.cc b/cc/layers/layer_impl.cc
index 49eaf8c..4f75c67 100644
--- a/cc/layers/layer_impl.cc
+++ b/cc/layers/layer_impl.cc
@@ -85,6 +85,7 @@ LayerImpl::LayerImpl(LayerTreeImpl* tree_impl,
num_dependents_need_push_properties_(0),
sorting_context_id_(0),
current_draw_mode_(DRAW_MODE_NONE),
+ num_layer_or_descendants_with_copy_request_(0),
frame_timing_requests_dirty_(false),
visited_(false),
layer_or_descendant_is_drawn_(false),
@@ -644,6 +645,8 @@ void LayerImpl::PushPropertiesTo(LayerImpl* layer) {
layer->SetStackingOrderChanged(stacking_order_changed_);
layer->SetDebugInfo(debug_info_);
+ layer->set_num_layer_or_descendant_with_copy_request(
+ num_layer_or_descendants_with_copy_request_);
if (frame_timing_requests_dirty_) {
layer->SetFrameTimingRequests(frame_timing_requests_);
diff --git a/cc/layers/layer_impl.h b/cc/layers/layer_impl.h
index 5755a75..5a2da10b 100644
--- a/cc/layers/layer_impl.h
+++ b/cc/layers/layer_impl.h
@@ -674,9 +674,17 @@ class CC_EXPORT LayerImpl : public LayerAnimationValueObserver,
void set_sorted_for_recursion(bool sorted_for_recursion) {
sorted_for_recursion_ = sorted_for_recursion;
}
-
bool sorted_for_recursion() { return sorted_for_recursion_; }
+ void set_num_layer_or_descendant_with_copy_request(
+ int num_layer_or_descendants_with_copy_request) {
+ num_layer_or_descendants_with_copy_request_ =
+ num_layer_or_descendants_with_copy_request;
+ }
+ int num_layer_or_descendants_with_copy_request() {
+ return num_layer_or_descendants_with_copy_request_;
+ }
+
void UpdatePropertyTreeForScrollingAndAnimationIfNeeded();
float GetIdealContentsScale() const;
@@ -865,6 +873,7 @@ class CC_EXPORT LayerImpl : public LayerAnimationValueObserver,
scoped_ptr<RenderSurfaceImpl> render_surface_;
std::vector<FrameTimingRequest> frame_timing_requests_;
+ int num_layer_or_descendants_with_copy_request_;
bool frame_timing_requests_dirty_;
bool visited_;
bool layer_or_descendant_is_drawn_;