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

Unified Diff: cc/layers/layer_impl.cc

Issue 373113003: Keeping track of descendants that draw content instead of recalcualting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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_impl.h ('k') | cc/layers/layer_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/layer_impl.cc
diff --git a/cc/layers/layer_impl.cc b/cc/layers/layer_impl.cc
index bd9a2d7b21e220c3ff93f4e866d2599d8b709a6f..e6e60f5f3ef7cc1e474c2b5c4a2aef192906b3b7 100644
--- a/cc/layers/layer_impl.cc
+++ b/cc/layers/layer_impl.cc
@@ -64,6 +64,7 @@ LayerImpl::LayerImpl(LayerTreeImpl* tree_impl, int id)
background_color_(0),
opacity_(1.0),
blend_mode_(SkXfermode::kSrcOver_Mode),
+ num_descendants_that_draw_content_(0),
draw_depth_(0.f),
needs_push_properties_(false),
num_dependents_need_push_properties_(0),
@@ -176,6 +177,13 @@ void LayerImpl::SetScrollChildren(std::set<LayerImpl*>* children) {
SetNeedsPushProperties();
}
+void LayerImpl::SetNumDescendantsThatDrawContent(int num_descendants) {
+ if (num_descendants_that_draw_content_ == num_descendants)
+ return;
+ num_descendants_that_draw_content_ = num_descendants;
+ SetNeedsPushProperties();
+}
+
void LayerImpl::SetClipParent(LayerImpl* ancestor) {
if (clip_parent_ == ancestor)
return;
@@ -532,6 +540,7 @@ void LayerImpl::PushPropertiesTo(LayerImpl* layer) {
scroll_offset_, layer->ScrollDelta() - layer->sent_scroll_delta());
layer->SetSentScrollDelta(gfx::Vector2d());
layer->Set3dSortingContextId(sorting_context_id_);
+ layer->SetNumDescendantsThatDrawContent(num_descendants_that_draw_content_);
LayerImpl* scroll_parent = NULL;
if (scroll_parent_) {
@@ -1521,6 +1530,10 @@ void LayerImpl::RunMicroBenchmark(MicroBenchmarkImpl* benchmark) {
benchmark->RunOnLayer(this);
}
+int LayerImpl::NumDescendantsThatDrawContent() const {
+ return num_descendants_that_draw_content_;
+}
+
void LayerImpl::NotifyAnimationFinished(
base::TimeTicks monotonic_time,
Animation::TargetProperty target_property) {
« no previous file with comments | « cc/layers/layer_impl.h ('k') | cc/layers/layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698