Keeping track of descendants that draw content instead of recalcualting
This is a required for removing Render Surface creation from CalcDrawProps.
BUG=386788
Review URL: https://codereview.chromium.org/373113003
Cr-Commit-Position: refs/heads/master@{#288740}
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@288740 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/cc/layers/surface_layer.cc b/cc/layers/surface_layer.cc
index f345b742..3ca179f2 100644
--- a/cc/layers/surface_layer.cc
+++ b/cc/layers/surface_layer.cc
@@ -19,6 +19,7 @@
void SurfaceLayer::SetSurfaceId(SurfaceId surface_id) {
surface_id_ = surface_id;
+ UpdateDrawsContent(HasDrawableContent());
SetNeedsPushProperties();
}
@@ -26,8 +27,8 @@
return SurfaceLayerImpl::Create(tree_impl, id()).PassAs<LayerImpl>();
}
-bool SurfaceLayer::DrawsContent() const {
- return !surface_id_.is_null() && Layer::DrawsContent();
+bool SurfaceLayer::HasDrawableContent() const {
+ return !surface_id_.is_null() && Layer::HasDrawableContent();
}
void SurfaceLayer::PushPropertiesTo(LayerImpl* layer) {