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

Side by Side Diff: cc/delegated_renderer_layer_impl.cc

Issue 11419284: Move second internal recursion to a precomputation in layer_tree_host_common.cc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/delegated_renderer_layer_impl.h" 5 #include "cc/delegated_renderer_layer_impl.h"
6 6
7 #include "cc/append_quads_data.h" 7 #include "cc/append_quads_data.h"
8 #include "cc/math_util.h" 8 #include "cc/math_util.h"
9 #include "cc/quad_sink.h" 9 #include "cc/quad_sink.h"
10 #include "cc/render_pass_draw_quad.h" 10 #include "cc/render_pass_draw_quad.h"
11 #include "cc/render_pass_sink.h" 11 #include "cc/render_pass_sink.h"
12 12
13 namespace cc { 13 namespace cc {
14 14
15 DelegatedRendererLayerImpl::DelegatedRendererLayerImpl(int id) 15 DelegatedRendererLayerImpl::DelegatedRendererLayerImpl(int id)
16 : LayerImpl(id) 16 : LayerImpl(id)
17 { 17 {
18 } 18 }
19 19
20 DelegatedRendererLayerImpl::~DelegatedRendererLayerImpl() 20 DelegatedRendererLayerImpl::~DelegatedRendererLayerImpl()
21 { 21 {
22 clearRenderPasses(); 22 clearRenderPasses();
23 } 23 }
24 24
25 int DelegatedRendererLayerImpl::descendantsDrawContent() 25 int DelegatedRendererLayerImpl::numDescendantsThatDrawContent()
26 { 26 {
27 // FIXME: This could possibly return false even though there are some 27 // FIXME: This could eventually return an exact layer count even though
28 // quads present as they could all be from a single layer (or set of 28 // there are some quads present as they could all be from a single layer
29 // layers without children). If this happens, then make a test that 29 // (or set of layers without children). If this happens, then make a test
30 // ensures the opacity is being changed on quads in the root RenderPass 30 // that ensures the opacity is being changed on quads in the root
31 // when this layer doesn't own a RenderSurfaceImpl. 31 // RenderPass when this layer doesn't own a RenderSurfaceImpl.
32 return m_renderPassesInDrawOrder.isEmpty() ? 0 : 2; 32 return m_renderPassesInDrawOrder.isEmpty() ? 0 : 2;
33 } 33 }
34 34
35 bool DelegatedRendererLayerImpl::hasContributingDelegatedRenderPasses() const 35 bool DelegatedRendererLayerImpl::hasContributingDelegatedRenderPasses() const
36 { 36 {
37 // The root RenderPass for the layer is merged with its target 37 // The root RenderPass for the layer is merged with its target
38 // RenderPass in each frame. So we only have extra RenderPasses 38 // RenderPass in each frame. So we only have extra RenderPasses
39 // to merge when we have a non-root RenderPass present. 39 // to merge when we have a non-root RenderPass present.
40 return m_renderPassesInDrawOrder.size() > 1; 40 return m_renderPassesInDrawOrder.size() > 1;
41 } 41 }
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 quadSink.append(copyQuad.Pass(), appendQuadsData); 172 quadSink.append(copyQuad.Pass(), appendQuadsData);
173 } 173 }
174 } 174 }
175 175
176 const char* DelegatedRendererLayerImpl::layerTypeAsString() const 176 const char* DelegatedRendererLayerImpl::layerTypeAsString() const
177 { 177 {
178 return "DelegatedRendererLayer"; 178 return "DelegatedRendererLayer";
179 } 179 }
180 180
181 } // namespace cc 181 } // namespace cc
OLDNEW
« no previous file with comments | « cc/delegated_renderer_layer_impl.h ('k') | cc/layer.h » ('j') | cc/layer.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698