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 #if USE(ACCELERATED_COMPOSITING) | 7 #if USE(ACCELERATED_COMPOSITING) |
8 #include "CCDebugRectHistory.h" | 8 #include "CCDebugRectHistory.h" |
9 | 9 |
10 #include "CCDamageTracker.h" | 10 #include "CCDamageTracker.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 // regardless of whether this layer is skipped for actual drawing or not. Th
erefore | 47 // regardless of whether this layer is skipped for actual drawing or not. Th
erefore |
48 // we traverse recursively over all layers, not just the render surface list
. | 48 // we traverse recursively over all layers, not just the render surface list
. |
49 | 49 |
50 if (!layer->updateRect().isEmpty() && layer->drawsContent()) { | 50 if (!layer->updateRect().isEmpty() && layer->drawsContent()) { |
51 FloatRect updateContentRect = layer->updateRect(); | 51 FloatRect updateContentRect = layer->updateRect(); |
52 updateContentRect.scale(layer->contentBounds().width() / static_cast<flo
at>(layer->bounds().width()), layer->contentBounds().height() / static_cast<floa
t>(layer->bounds().height())); | 52 updateContentRect.scale(layer->contentBounds().width() / static_cast<flo
at>(layer->bounds().width()), layer->contentBounds().height() / static_cast<floa
t>(layer->bounds().height())); |
53 m_debugRects.append(CCDebugRect(PaintRectType, CCMathUtil::mapClippedRec
t(layer->screenSpaceTransform(), updateContentRect))); | 53 m_debugRects.append(CCDebugRect(PaintRectType, CCMathUtil::mapClippedRec
t(layer->screenSpaceTransform(), updateContentRect))); |
54 } | 54 } |
55 | 55 |
56 for (unsigned i = 0; i < layer->children().size(); ++i) | 56 for (unsigned i = 0; i < layer->children().size(); ++i) |
57 savePaintRects(layer->children()[i].get()); | 57 savePaintRects(layer->children()[i]); |
58 } | 58 } |
59 | 59 |
60 void CCDebugRectHistory::savePropertyChangedRects(const Vector<CCLayerImpl*>& re
nderSurfaceLayerList) | 60 void CCDebugRectHistory::savePropertyChangedRects(const Vector<CCLayerImpl*>& re
nderSurfaceLayerList) |
61 { | 61 { |
62 for (int surfaceIndex = renderSurfaceLayerList.size() - 1; surfaceIndex >= 0
; --surfaceIndex) { | 62 for (int surfaceIndex = renderSurfaceLayerList.size() - 1; surfaceIndex >= 0
; --surfaceIndex) { |
63 CCLayerImpl* renderSurfaceLayer = renderSurfaceLayerList[surfaceIndex]; | 63 CCLayerImpl* renderSurfaceLayer = renderSurfaceLayerList[surfaceIndex]; |
64 CCRenderSurface* renderSurface = renderSurfaceLayer->renderSurface(); | 64 CCRenderSurface* renderSurface = renderSurfaceLayer->renderSurface(); |
65 ASSERT(renderSurface); | 65 ASSERT(renderSurface); |
66 | 66 |
67 const Vector<CCLayerImpl*>& layerList = renderSurface->layerList(); | 67 const Vector<CCLayerImpl*>& layerList = renderSurface->layerList(); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 | 107 |
108 void CCDebugRectHistory::saveOccludingRects(const Vector<IntRect>& occludingRect
s) | 108 void CCDebugRectHistory::saveOccludingRects(const Vector<IntRect>& occludingRect
s) |
109 { | 109 { |
110 for (size_t i = 0; i < occludingRects.size(); ++i) | 110 for (size_t i = 0; i < occludingRects.size(); ++i) |
111 m_debugRects.append(CCDebugRect(OccludingRectType, occludingRects[i])); | 111 m_debugRects.append(CCDebugRect(OccludingRectType, occludingRects[i])); |
112 } | 112 } |
113 | 113 |
114 } // namespace cc | 114 } // namespace cc |
115 | 115 |
116 #endif // USE(ACCELERATED_COMPOSITING) | 116 #endif // USE(ACCELERATED_COMPOSITING) |
OLD | NEW |