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

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: cleaned up and rebased 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(LayerTreeImpl* treeImpl, int id) 15 DelegatedRendererLayerImpl::DelegatedRendererLayerImpl(LayerTreeImpl* treeImpl, int id)
16 : LayerImpl(treeImpl, id) 16 : LayerImpl(treeImpl, 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 bool DelegatedRendererLayerImpl::hasDelegatedContent() const
26 { 26 {
27 // FIXME: This could possibly return false even though there are some 27 return !m_renderPassesInDrawOrder.isEmpty();
28 // quads present as they could all be from a single layer (or set of
29 // layers without children). If this happens, then make a test that
30 // ensures the opacity is being changed on quads in the root RenderPass
31 // when this layer doesn't own a RenderSurfaceImpl.
32 return m_renderPassesInDrawOrder.isEmpty() ? 0 : 2;
33 } 28 }
34 29
35 bool DelegatedRendererLayerImpl::hasContributingDelegatedRenderPasses() const 30 bool DelegatedRendererLayerImpl::hasContributingDelegatedRenderPasses() const
36 { 31 {
37 // The root RenderPass for the layer is merged with its target 32 // The root RenderPass for the layer is merged with its target
38 // RenderPass in each frame. So we only have extra RenderPasses 33 // RenderPass in each frame. So we only have extra RenderPasses
39 // to merge when we have a non-root RenderPass present. 34 // to merge when we have a non-root RenderPass present.
40 return m_renderPassesInDrawOrder.size() > 1; 35 return m_renderPassesInDrawOrder.size() > 1;
41 } 36 }
42 37
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 quadSink.append(copyQuad.Pass(), appendQuadsData); 167 quadSink.append(copyQuad.Pass(), appendQuadsData);
173 } 168 }
174 } 169 }
175 170
176 const char* DelegatedRendererLayerImpl::layerTypeAsString() const 171 const char* DelegatedRendererLayerImpl::layerTypeAsString() const
177 { 172 {
178 return "DelegatedRendererLayer"; 173 return "DelegatedRendererLayer";
179 } 174 }
180 175
181 } // namespace cc 176 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698