summaryrefslogtreecommitdiffstats
path: root/cc/layer.cc
diff options
context:
space:
mode:
authorshawnsingh@google.com <shawnsingh@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-12 22:49:36 +0000
committershawnsingh@google.com <shawnsingh@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-12 22:49:36 +0000
commitb5b1fce737f34da448e675023e92d881648de290 (patch)
treed5821c82be24ddfec096756d3b7c6d5c89fddfcc /cc/layer.cc
parentfb817ecdfedf75117cf88b8f71eae6963e75bd47 (diff)
downloadchromium_src-b5b1fce737f34da448e675023e92d881648de290.zip
chromium_src-b5b1fce737f34da448e675023e92d881648de290.tar.gz
chromium_src-b5b1fce737f34da448e675023e92d881648de290.tar.bz2
Move second internal recursion to a precomputation in layer_tree_host_common.cc
Asymptotically, the recursive algorithm in calculateDrawTransforms is O(n^2) because of a secondary recursion that occurs for every layer in subtreeShouldRenderToSeparateSurface. This patch moves the internal secondary recursion into a pre-walk, caching the meaningful result of that recursion, so that the algorithm is O(2 * n). Review URL: https://codereview.chromium.org/11419284 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@172682 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/layer.cc')
-rw-r--r--cc/layer.cc13
1 files changed, 0 insertions, 13 deletions
diff --git a/cc/layer.cc b/cc/layer.cc
index dea9e45..7164a54 100644
--- a/cc/layer.cc
+++ b/cc/layer.cc
@@ -700,19 +700,6 @@ void Layer::createRenderSurface()
m_drawProperties.render_target = this;
}
-int Layer::descendantsDrawContent()
-{
- int result = 0;
- for (size_t i = 0; i < m_children.size(); ++i) {
- if (m_children[i]->drawsContent())
- ++result;
- result += m_children[i]->descendantsDrawContent();
- if (result > 1)
- return result;
- }
- return result;
-}
-
int Layer::id() const
{
return m_layerId;