Index: cc/layers/layer.h |
diff --git a/cc/layers/layer.h b/cc/layers/layer.h |
index ab897a8ac9914ab08085ab45aa8b1ea8fa4ababf..76b5cc2ca0104c886469703f376ae06fa49ae71e 100644 |
--- a/cc/layers/layer.h |
+++ b/cc/layers/layer.h |
@@ -331,7 +331,7 @@ class CC_EXPORT Layer : public base::RefCounted<Layer>, |
virtual void SetLayerTreeHost(LayerTreeHost* host); |
- bool HasDelegatedContent() const { return false; } |
+ virtual bool HasDelegatedContent() const; |
bool HasContributingDelegatedRenderPasses() const { return false; } |
void SetIsDrawable(bool is_drawable); |
@@ -350,8 +350,12 @@ class CC_EXPORT Layer : public base::RefCounted<Layer>, |
(mask_layer_.get() || replica_layer_->mask_layer_.get()); |
} |
- // These methods typically need to be overwritten by derived classes. |
+ int NumDescendantsThatDrawContent() const; |
+ |
+ // This is only virtual for tests. |
danakj
2014/08/06 14:57:07
IIRC you're going to look into removing this virtu
awoloszyn
2014/08/08 15:53:20
Done.
|
virtual bool DrawsContent() const; |
+ |
+ // This methods typically need to be overwritten by derived classes. |
virtual void SavePaintProperties(); |
// Returns true iff any resources were updated that need to be committed. |
virtual bool Update(ResourceUpdateQueue* queue, |
@@ -486,6 +490,14 @@ class CC_EXPORT Layer : public base::RefCounted<Layer>, |
// unused resources on the impl thread are returned before commit completes. |
void SetNextCommitWaitsForActivation(); |
+ // Will recalculate whether we draw content and set draws_content_ |
danakj
2014/08/06 14:57:07
s/we draw/the layer draws/
awoloszyn
2014/08/08 15:53:20
Done.
|
+ // appropriately. |
+ void UpdateDrawsContent(bool has_drawable_content); |
+ virtual bool HasDrawableContent() const; |
+ |
+ // Called when our number of drawable descendants changes. |
danakj
2014/08/06 14:57:07
s/our/the layer's/
awoloszyn
2014/08/08 15:53:20
Done.
|
+ void AddDrawableDescendants(int num); |
+ |
void AddDependentNeedsPushProperties(); |
void RemoveDependentNeedsPushProperties(); |
bool parent_should_know_need_push_properties() const { |
@@ -579,6 +591,7 @@ class CC_EXPORT Layer : public base::RefCounted<Layer>, |
// transformed relative to this layer, defines the maximum scroll offset for |
// this layer. |
int scroll_clip_layer_id_; |
+ int num_descendants_that_draw_content_; |
bool should_scroll_on_main_thread_ : 1; |
bool have_wheel_event_handlers_ : 1; |
bool have_scroll_event_handlers_ : 1; |
@@ -587,6 +600,7 @@ class CC_EXPORT Layer : public base::RefCounted<Layer>, |
bool is_root_for_isolated_group_ : 1; |
bool is_container_for_fixed_position_layers_ : 1; |
bool is_drawable_ : 1; |
+ bool draws_content_ : 1; |
bool hide_layer_and_subtree_ : 1; |
bool masks_to_bounds_ : 1; |
bool contents_opaque_ : 1; |