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

Unified Diff: cc/layers/layer.h

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, 5 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.h
diff --git a/cc/layers/layer.h b/cc/layers/layer.h
index ab897a8ac9914ab08085ab45aa8b1ea8fa4ababf..77f66be57019e1fecd2a62a5c3646ad722f873c5 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);
@@ -352,6 +352,7 @@ class CC_EXPORT Layer : public base::RefCounted<Layer>,
// These methods typically need to be overwritten by derived classes.
virtual bool DrawsContent() const;
+ int NumDescendantsThatDrawContent() const;
danakj 2014/07/14 20:22:02 move this up above the // These methods need to be
awoloszyn 2014/07/16 20:44:20 Done.
virtual void SavePaintProperties();
// Returns true iff any resources were updated that need to be committed.
virtual bool Update(ResourceUpdateQueue* queue,
@@ -486,6 +487,14 @@ class CC_EXPORT Layer : public base::RefCounted<Layer>,
// unused resources on the impl thread are returned before commit completes.
void SetNextCommitWaitsForActivation();
+ // Will relcalculate whether or not we draw content and set draws_content_
+ // appropriately.
+ void UpdateDrawsContent();
+ virtual bool HasDrawableContent() const;
+
+ // Called when our number of drawable descendants changes.
+ void AddDrawableDescendants(int num);
+
void AddDependentNeedsPushProperties();
void RemoveDependentNeedsPushProperties();
bool parent_should_know_need_push_properties() const {
@@ -579,6 +588,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 +597,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;

Powered by Google App Engine
This is Rietveld 408576698