| 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 "config.h" | 5 #include "config.h" |
| 6 | 6 |
| 7 #include "CCDebugRectHistory.h" | 7 #include "CCDebugRectHistory.h" |
| 8 | 8 |
| 9 #include "CCDamageTracker.h" | 9 #include "CCDamageTracker.h" |
| 10 #include "CCLayerImpl.h" | 10 #include "CCLayerImpl.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 | 63 |
| 64 for (unsigned i = 0; i < layer->children().size(); ++i) | 64 for (unsigned i = 0; i < layer->children().size(); ++i) |
| 65 savePaintRects(layer->children()[i]); | 65 savePaintRects(layer->children()[i]); |
| 66 } | 66 } |
| 67 | 67 |
| 68 void CCDebugRectHistory::savePropertyChangedRects(const std::vector<CCLayerImpl*
>& renderSurfaceLayerList) | 68 void CCDebugRectHistory::savePropertyChangedRects(const std::vector<CCLayerImpl*
>& renderSurfaceLayerList) |
| 69 { | 69 { |
| 70 for (int surfaceIndex = renderSurfaceLayerList.size() - 1; surfaceIndex >= 0
; --surfaceIndex) { | 70 for (int surfaceIndex = renderSurfaceLayerList.size() - 1; surfaceIndex >= 0
; --surfaceIndex) { |
| 71 CCLayerImpl* renderSurfaceLayer = renderSurfaceLayerList[surfaceIndex]; | 71 CCLayerImpl* renderSurfaceLayer = renderSurfaceLayerList[surfaceIndex]; |
| 72 CCRenderSurface* renderSurface = renderSurfaceLayer->renderSurface(); | 72 CCRenderSurface* renderSurface = renderSurfaceLayer->renderSurface(); |
| 73 ASSERT(renderSurface); | 73 DCHECK(renderSurface); |
| 74 | 74 |
| 75 const std::vector<CCLayerImpl*>& layerList = renderSurface->layerList(); | 75 const std::vector<CCLayerImpl*>& layerList = renderSurface->layerList(); |
| 76 for (unsigned layerIndex = 0; layerIndex < layerList.size(); ++layerInde
x) { | 76 for (unsigned layerIndex = 0; layerIndex < layerList.size(); ++layerInde
x) { |
| 77 CCLayerImpl* layer = layerList[layerIndex]; | 77 CCLayerImpl* layer = layerList[layerIndex]; |
| 78 | 78 |
| 79 if (CCLayerTreeHostCommon::renderSurfaceContributesToTarget<CCLayerI
mpl>(layer, renderSurfaceLayer->id())) | 79 if (CCLayerTreeHostCommon::renderSurfaceContributesToTarget<CCLayerI
mpl>(layer, renderSurfaceLayer->id())) |
| 80 continue; | 80 continue; |
| 81 | 81 |
| 82 if (layer->layerIsAlwaysDamaged()) | 82 if (layer->layerIsAlwaysDamaged()) |
| 83 continue; | 83 continue; |
| 84 | 84 |
| 85 if (layer->layerPropertyChanged() || layer->layerSurfacePropertyChan
ged()) | 85 if (layer->layerPropertyChanged() || layer->layerSurfacePropertyChan
ged()) |
| 86 m_debugRects.append(CCDebugRect(PropertyChangedRectType, CCMathU
til::mapClippedRect(layer->screenSpaceTransform(), FloatRect(FloatPoint::zero(),
layer->contentBounds())))); | 86 m_debugRects.append(CCDebugRect(PropertyChangedRectType, CCMathU
til::mapClippedRect(layer->screenSpaceTransform(), FloatRect(FloatPoint::zero(),
layer->contentBounds())))); |
| 87 } | 87 } |
| 88 } | 88 } |
| 89 } | 89 } |
| 90 | 90 |
| 91 void CCDebugRectHistory::saveSurfaceDamageRects(const std::vector<CCLayerImpl* >
& renderSurfaceLayerList) | 91 void CCDebugRectHistory::saveSurfaceDamageRects(const std::vector<CCLayerImpl* >
& renderSurfaceLayerList) |
| 92 { | 92 { |
| 93 for (int surfaceIndex = renderSurfaceLayerList.size() - 1; surfaceIndex >= 0
; --surfaceIndex) { | 93 for (int surfaceIndex = renderSurfaceLayerList.size() - 1; surfaceIndex >= 0
; --surfaceIndex) { |
| 94 CCLayerImpl* renderSurfaceLayer = renderSurfaceLayerList[surfaceIndex]; | 94 CCLayerImpl* renderSurfaceLayer = renderSurfaceLayerList[surfaceIndex]; |
| 95 CCRenderSurface* renderSurface = renderSurfaceLayer->renderSurface(); | 95 CCRenderSurface* renderSurface = renderSurfaceLayer->renderSurface(); |
| 96 ASSERT(renderSurface); | 96 DCHECK(renderSurface); |
| 97 | 97 |
| 98 m_debugRects.append(CCDebugRect(SurfaceDamageRectType, CCMathUtil::mapCl
ippedRect(renderSurface->screenSpaceTransform(), renderSurface->damageTracker()-
>currentDamageRect()))); | 98 m_debugRects.append(CCDebugRect(SurfaceDamageRectType, CCMathUtil::mapCl
ippedRect(renderSurface->screenSpaceTransform(), renderSurface->damageTracker()-
>currentDamageRect()))); |
| 99 } | 99 } |
| 100 } | 100 } |
| 101 | 101 |
| 102 void CCDebugRectHistory::saveScreenSpaceRects(const std::vector<CCLayerImpl* >&
renderSurfaceLayerList) | 102 void CCDebugRectHistory::saveScreenSpaceRects(const std::vector<CCLayerImpl* >&
renderSurfaceLayerList) |
| 103 { | 103 { |
| 104 for (int surfaceIndex = renderSurfaceLayerList.size() - 1; surfaceIndex >= 0
; --surfaceIndex) { | 104 for (int surfaceIndex = renderSurfaceLayerList.size() - 1; surfaceIndex >= 0
; --surfaceIndex) { |
| 105 CCLayerImpl* renderSurfaceLayer = renderSurfaceLayerList[surfaceIndex]; | 105 CCLayerImpl* renderSurfaceLayer = renderSurfaceLayerList[surfaceIndex]; |
| 106 CCRenderSurface* renderSurface = renderSurfaceLayer->renderSurface(); | 106 CCRenderSurface* renderSurface = renderSurfaceLayer->renderSurface(); |
| 107 ASSERT(renderSurface); | 107 DCHECK(renderSurface); |
| 108 | 108 |
| 109 m_debugRects.append(CCDebugRect(ScreenSpaceRectType, CCMathUtil::mapClip
pedRect(renderSurface->screenSpaceTransform(), renderSurface->contentRect()))); | 109 m_debugRects.append(CCDebugRect(ScreenSpaceRectType, CCMathUtil::mapClip
pedRect(renderSurface->screenSpaceTransform(), renderSurface->contentRect()))); |
| 110 | 110 |
| 111 if (renderSurfaceLayer->replicaLayer()) | 111 if (renderSurfaceLayer->replicaLayer()) |
| 112 m_debugRects.append(CCDebugRect(ReplicaScreenSpaceRectType, CCMathUt
il::mapClippedRect(renderSurface->replicaScreenSpaceTransform(), renderSurface->
contentRect()))); | 112 m_debugRects.append(CCDebugRect(ReplicaScreenSpaceRectType, CCMathUt
il::mapClippedRect(renderSurface->replicaScreenSpaceTransform(), renderSurface->
contentRect()))); |
| 113 } | 113 } |
| 114 } | 114 } |
| 115 | 115 |
| 116 void CCDebugRectHistory::saveOccludingRects(const Vector<IntRect>& occludingRect
s) | 116 void CCDebugRectHistory::saveOccludingRects(const Vector<IntRect>& occludingRect
s) |
| 117 { | 117 { |
| 118 for (size_t i = 0; i < occludingRects.size(); ++i) | 118 for (size_t i = 0; i < occludingRects.size(); ++i) |
| 119 m_debugRects.append(CCDebugRect(OccludingRectType, occludingRects[i])); | 119 m_debugRects.append(CCDebugRect(OccludingRectType, occludingRects[i])); |
| 120 } | 120 } |
| 121 | 121 |
| 122 } // namespace cc | 122 } // namespace cc |
| 123 | 123 |
| OLD | NEW |