Chromium Code Reviews| Index: cc/layers/layer_impl.cc |
| diff --git a/cc/layers/layer_impl.cc b/cc/layers/layer_impl.cc |
| index 7a23e6618a9dd8dba589f35c5e2e9f08a56e2d31..750cf45b65612771f5e7d1a467097328272ab4f0 100644 |
| --- a/cc/layers/layer_impl.cc |
| +++ b/cc/layers/layer_impl.cc |
| @@ -63,6 +63,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), |
| @@ -175,6 +176,10 @@ void LayerImpl::SetScrollChildren(std::set<LayerImpl*>* children) { |
| SetNeedsPushProperties(); |
| } |
| +void LayerImpl::SetNumDescendantsThatDrawContent(int num_descendants) { |
| + num_descendants_that_draw_content_ = num_descendants; |
|
danakj
2014/07/14 20:22:02
You need to call SetNeedsPushProperties() to ensur
awoloszyn
2014/07/16 20:44:20
Done.
|
| +} |
| + |
| void LayerImpl::SetClipParent(LayerImpl* ancestor) { |
| if (clip_parent_ == ancestor) |
| return; |
| @@ -531,6 +536,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_) { |
| @@ -1495,6 +1501,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) { |