| 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" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 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 |
| 32 SharedQuadState* QuadCuller::useSharedQuadState(scoped_ptr<SharedQuadState> shar
edQuadState) | 32 SharedQuadState* QuadCuller::useSharedQuadState(scoped_ptr<SharedQuadState> shar
edQuadState) |
| 33 { | 33 { |
| 34 sharedQuadState->id = m_sharedQuadStateList.size(); | |
| 35 | |
| 36 // FIXME: If all quads are culled for the sharedQuadState, we can drop it fr
om the list. | 34 // FIXME: If all quads are culled for the sharedQuadState, we can drop it fr
om the list. |
| 37 m_currentSharedQuadState = sharedQuadState.get(); | 35 m_currentSharedQuadState = sharedQuadState.get(); |
| 38 m_sharedQuadStateList.append(sharedQuadState.Pass()); | 36 m_sharedQuadStateList.append(sharedQuadState.Pass()); |
| 39 return m_currentSharedQuadState; | 37 return m_currentSharedQuadState; |
| 40 } | 38 } |
| 41 | 39 |
| 42 static inline bool appendQuadInternal(scoped_ptr<DrawQuad> drawQuad, const gfx::
Rect& culledRect, QuadList& quadList, const OcclusionTrackerImpl& occlusionTrack
er, LayerImpl* layer, bool createDebugBorderQuads) | 40 static inline bool appendQuadInternal(scoped_ptr<DrawQuad> drawQuad, const gfx::
Rect& culledRect, QuadList& quadList, const OcclusionTrackerImpl& occlusionTrack
er, LayerImpl* layer, bool createDebugBorderQuads) |
| 43 { | 41 { |
| 44 bool keepQuad = !culledRect.IsEmpty(); | 42 bool keepQuad = !culledRect.IsEmpty(); |
| 45 if (keepQuad) | 43 if (keepQuad) |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 culledRect = m_occlusionTracker->unoccludedContributingSurfaceContentRec
t(m_layer, false, drawQuad->rect, &hasOcclusionFromOutsideTargetSurface); | 76 culledRect = m_occlusionTracker->unoccludedContributingSurfaceContentRec
t(m_layer, false, drawQuad->rect, &hasOcclusionFromOutsideTargetSurface); |
| 79 else | 77 else |
| 80 culledRect = m_occlusionTracker->unoccludedContentRect(m_layer->renderTa
rget(), drawQuad->rect, drawQuad->quadTransform(), implDrawTransformIsUnknown, d
rawQuad->clippedRectInTarget(), &hasOcclusionFromOutsideTargetSurface); | 78 culledRect = m_occlusionTracker->unoccludedContentRect(m_layer->renderTa
rget(), drawQuad->rect, drawQuad->quadTransform(), implDrawTransformIsUnknown, d
rawQuad->clippedRectInTarget(), &hasOcclusionFromOutsideTargetSurface); |
| 81 | 79 |
| 82 appendQuadsData.hadOcclusionFromOutsideTargetSurface |= hasOcclusionFromOuts
ideTargetSurface; | 80 appendQuadsData.hadOcclusionFromOutsideTargetSurface |= hasOcclusionFromOuts
ideTargetSurface; |
| 83 | 81 |
| 84 return appendQuadInternal(drawQuad.Pass(), culledRect, m_quadList, *m_occlus
ionTracker, m_layer, m_showCullingWithDebugBorderQuads); | 82 return appendQuadInternal(drawQuad.Pass(), culledRect, m_quadList, *m_occlus
ionTracker, m_layer, m_showCullingWithDebugBorderQuads); |
| 85 } | 83 } |
| 86 | 84 |
| 87 } // namespace cc | 85 } // namespace cc |
| OLD | NEW |