| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #include "web/tests/sim/SimCompositor.h" | 6 #include "web/tests/sim/SimCompositor.h" |
| 7 | 7 |
| 8 #include "core/frame/FrameView.h" | 8 #include "core/frame/FrameView.h" |
| 9 #include "core/layout/LayoutView.h" | 9 #include "core/layout/LayoutView.h" |
| 10 #include "core/layout/compositing/CompositedLayerMapping.h" | 10 #include "core/layout/compositing/CompositedLayerMapping.h" |
| 11 #include "core/paint/PaintLayer.h" | 11 #include "core/paint/PaintLayer.h" |
| 12 #include "platform/graphics/ContentLayerDelegate.h" | 12 #include "platform/graphics/ContentLayerDelegate.h" |
| 13 #include "public/platform/WebRect.h" | 13 #include "public/platform/WebRect.h" |
| 14 #include "web/WebLocalFrameImpl.h" | 14 #include "web/WebLocalFrameImpl.h" |
| 15 #include "web/WebViewImpl.h" | 15 #include "web/WebViewImpl.h" |
| 16 #include "web/tests/sim/SimDisplayItemList.h" | 16 #include "web/tests/sim/SimDisplayItemList.h" |
| 17 #include "wtf/CurrentTime.h" | 17 #include "wtf/CurrentTime.h" |
| 18 | 18 |
| 19 namespace blink { | 19 namespace blink { |
| 20 | 20 |
| 21 static void paintLayers(PaintLayer& layer, SimDisplayItemList& displayList) | 21 static void paintLayers(PaintLayer& layer, SimDisplayItemList& displayList) |
| 22 { | 22 { |
| 23 if (layer.isAllowedToQueryCompositingState() && layer.compositingState() ==
PaintsIntoOwnBacking) { | 23 if (layer.isAllowedToQueryCompositingState() && layer.compositingState() ==
PaintsIntoOwnBacking) { |
| 24 CompositedLayerMapping* mapping = layer.compositedLayerMapping(); | 24 CompositedLayerMapping* mapping = layer.compositedLayerMapping(); |
| 25 GraphicsLayer* graphicsLayer = mapping->mainGraphicsLayer(); | 25 GraphicsLayer* graphicsLayer = mapping->mainGraphicsLayer(); |
| 26 if (graphicsLayer->hasTrackedPaintInvalidations()) { | 26 if (graphicsLayer->hasTrackedPaintInvalidations()) { |
| 27 ContentLayerDelegate* delegate = graphicsLayer->contentLayerDelegate
ForTesting(); | 27 ContentLayerDelegate* delegate = graphicsLayer->contentLayerDelegate
ForTesting(); |
| 28 delegate->paintContents(&displayList, WebRect(0, 0, layer.size().wid
th(), layer.size().height())); | 28 delegate->paintContents(&displayList); |
| 29 graphicsLayer->resetTrackedPaintInvalidations(); | 29 graphicsLayer->resetTrackedPaintInvalidations(); |
| 30 } | 30 } |
| 31 } | 31 } |
| 32 for (PaintLayer* child = layer.firstChild(); child; child = child->nextSibli
ng()) | 32 for (PaintLayer* child = layer.firstChild(); child; child = child->nextSibli
ng()) |
| 33 paintLayers(*child, displayList); | 33 paintLayers(*child, displayList); |
| 34 } | 34 } |
| 35 | 35 |
| 36 static void paintFrames(LocalFrame& root, SimDisplayItemList& displayList) | 36 static void paintFrames(LocalFrame& root, SimDisplayItemList& displayList) |
| 37 { | 37 { |
| 38 for (Frame* frame = &root; frame; frame = frame->tree().traverseNext(&root))
{ | 38 for (Frame* frame = &root; frame; frame = frame->tree().traverseNext(&root))
{ |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 | 91 |
| 92 LocalFrame* root = m_webViewImpl->mainFrameImpl()->frame(); | 92 LocalFrame* root = m_webViewImpl->mainFrameImpl()->frame(); |
| 93 | 93 |
| 94 SimDisplayItemList displayList; | 94 SimDisplayItemList displayList; |
| 95 paintFrames(*root, displayList); | 95 paintFrames(*root, displayList); |
| 96 | 96 |
| 97 return displayList; | 97 return displayList; |
| 98 } | 98 } |
| 99 | 99 |
| 100 } // namespace blink | 100 } // namespace blink |
| OLD | NEW |