OLD | NEW |
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/quad_culler.h" | 5 #include "cc/quad_culler.h" |
6 | 6 |
7 #include "cc/append_quads_data.h" | 7 #include "cc/append_quads_data.h" |
8 #include "cc/debug_border_draw_quad.h" | 8 #include "cc/debug_border_draw_quad.h" |
9 #include "cc/debug_colors.h" | 9 #include "cc/debug_colors.h" |
10 #include "cc/layer_impl.h" | 10 #include "cc/layer_impl.h" |
11 #include "cc/occlusion_tracker.h" | 11 #include "cc/occlusion_tracker.h" |
12 #include "cc/overdraw_metrics.h" | 12 #include "cc/overdraw_metrics.h" |
13 #include "cc/render_pass.h" | 13 #include "cc/render_pass.h" |
14 #include "third_party/skia/include/core/SkColor.h" | 14 #include "third_party/skia/include/core/SkColor.h" |
15 #include <public/WebTransformationMatrix.h> | 15 #include <public/WebTransformationMatrix.h> |
16 | 16 |
17 using namespace std; | 17 using namespace std; |
18 | 18 |
19 namespace cc { | 19 namespace cc { |
20 | 20 |
21 QuadCuller::QuadCuller(QuadList& quadList, SharedQuadStateList& sharedQuadStateL
ist, const LayerImpl* layer, const OcclusionTrackerImpl* occlusionTracker, bool
showCullingWithDebugBorderQuads, bool forSurface) | 21 QuadCuller::QuadCuller(QuadList& quadList, SharedQuadStateList& sharedQuadStateL
ist, const LayerImpl* layer, const OcclusionTrackerImpl& occlusionTracker, bool
showCullingWithDebugBorderQuads, bool forSurface) |
22 : m_quadList(quadList) | 22 : m_quadList(quadList) |
23 , m_sharedQuadStateList(sharedQuadStateList) | 23 , m_sharedQuadStateList(sharedQuadStateList) |
24 , m_currentSharedQuadState(0) | 24 , m_currentSharedQuadState(0) |
25 , m_layer(layer) | 25 , m_layer(layer) |
26 , m_occlusionTracker(occlusionTracker) | 26 , m_occlusionTracker(occlusionTracker) |
27 , m_showCullingWithDebugBorderQuads(showCullingWithDebugBorderQuads) | 27 , m_showCullingWithDebugBorderQuads(showCullingWithDebugBorderQuads) |
28 , m_forSurface(forSurface) | 28 , m_forSurface(forSurface) |
29 { | 29 { |
30 } | 30 } |
31 | 31 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 { | 66 { |
67 DCHECK(drawQuad->shared_quad_state == m_currentSharedQuadState); | 67 DCHECK(drawQuad->shared_quad_state == m_currentSharedQuadState); |
68 DCHECK(!m_sharedQuadStateList.isEmpty()); | 68 DCHECK(!m_sharedQuadStateList.isEmpty()); |
69 DCHECK(m_sharedQuadStateList.last() == m_currentSharedQuadState); | 69 DCHECK(m_sharedQuadStateList.last() == m_currentSharedQuadState); |
70 | 70 |
71 gfx::Rect culledRect; | 71 gfx::Rect culledRect; |
72 bool hasOcclusionFromOutsideTargetSurface; | 72 bool hasOcclusionFromOutsideTargetSurface; |
73 bool implDrawTransformIsUnknown = false; | 73 bool implDrawTransformIsUnknown = false; |
74 | 74 |
75 if (m_forSurface) | 75 if (m_forSurface) |
76 culledRect = m_occlusionTracker->unoccludedContributingSurfaceContentRec
t(m_layer, false, drawQuad->rect, &hasOcclusionFromOutsideTargetSurface); | 76 culledRect = m_occlusionTracker.unoccludedContributingSurfaceContentRect
(m_layer, false, drawQuad->rect, &hasOcclusionFromOutsideTargetSurface); |
77 else | 77 else |
78 culledRect = m_occlusionTracker->unoccludedContentRect(m_layer->renderTa
rget(), drawQuad->rect, drawQuad->quadTransform(), implDrawTransformIsUnknown, d
rawQuad->clippedRectInTarget(), &hasOcclusionFromOutsideTargetSurface); | 78 culledRect = m_occlusionTracker.unoccludedContentRect(m_layer->renderTar
get(), drawQuad->rect, drawQuad->quadTransform(), implDrawTransformIsUnknown, dr
awQuad->clippedRectInTarget(), &hasOcclusionFromOutsideTargetSurface); |
79 | 79 |
80 appendQuadsData.hadOcclusionFromOutsideTargetSurface |= hasOcclusionFromOuts
ideTargetSurface; | 80 appendQuadsData.hadOcclusionFromOutsideTargetSurface |= hasOcclusionFromOuts
ideTargetSurface; |
81 | 81 |
82 return appendQuadInternal(drawQuad.Pass(), culledRect, m_quadList, *m_occlus
ionTracker, m_layer, m_showCullingWithDebugBorderQuads); | 82 return appendQuadInternal(drawQuad.Pass(), culledRect, m_quadList, m_occlusi
onTracker, m_layer, m_showCullingWithDebugBorderQuads); |
83 } | 83 } |
84 | 84 |
85 } // namespace cc | 85 } // namespace cc |
OLD | NEW |