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

Unified Diff: cc/layer.cc

Issue 11316171: Don't create render passes for transparent images. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 8 years, 1 month 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/layer.h ('k') | cc/layer_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layer.cc
diff --git a/cc/layer.cc b/cc/layer.cc
index c7b7ebc503b02e3e7190777985bf67d880a685e7..242ad765ed55ec51053e471195c8530c80ad0e2e 100644
--- a/cc/layer.cc
+++ b/cc/layer.cc
@@ -698,13 +698,17 @@ void Layer::createRenderSurface()
setRenderTarget(this);
}
-bool Layer::descendantDrawsContent()
+int Layer::descendantsDrawContent()
{
+ int result = 0;
for (size_t i = 0; i < m_children.size(); ++i) {
- if (m_children[i]->drawsContent() || m_children[i]->descendantDrawsContent())
- return true;
+ if (m_children[i]->drawsContent())
+ ++result;
+ result += m_children[i]->descendantsDrawContent();
+ if (result > 1)
+ return result;
}
- return false;
+ return result;
}
int Layer::id() const
« no previous file with comments | « cc/layer.h ('k') | cc/layer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698