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

Unified Diff: cc/layer_impl.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_impl.h ('k') | cc/layer_iterator_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layer_impl.cc
diff --git a/cc/layer_impl.cc b/cc/layer_impl.cc
index 81bc49f01aafb4a2ea926f0412e3764a5c786d8a..42391038db4d400dc257977e47ab13d3a7a0f123 100644
--- a/cc/layer_impl.cc
+++ b/cc/layer_impl.cc
@@ -112,13 +112,17 @@ void LayerImpl::createRenderSurface()
setRenderTarget(this);
}
-bool LayerImpl::descendantDrawsContent()
+int LayerImpl::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;
}
scoped_ptr<SharedQuadState> LayerImpl::createSharedQuadState() const
« no previous file with comments | « cc/layer_impl.h ('k') | cc/layer_iterator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698