Index: third_party/WebKit/Source/web/tests/sim/SimCompositor.cpp |
diff --git a/third_party/WebKit/Source/web/tests/sim/SimCompositor.cpp b/third_party/WebKit/Source/web/tests/sim/SimCompositor.cpp |
index 74429dd963a6b6bd2bb75dd1cdb6dbc38f58af76..7582c9d39b06288fceb16d7ad865c14c62599ca5 100644 |
--- a/third_party/WebKit/Source/web/tests/sim/SimCompositor.cpp |
+++ b/third_party/WebKit/Source/web/tests/sim/SimCompositor.cpp |
@@ -7,8 +7,10 @@ |
#include "core/frame/FrameView.h" |
#include "core/layout/api/LayoutViewItem.h" |
#include "core/layout/compositing/CompositedLayerMapping.h" |
+#include "core/layout/compositing/PaintLayerCompositor.h" |
#include "core/paint/PaintLayer.h" |
#include "platform/graphics/ContentLayerDelegate.h" |
+#include "platform/graphics/GraphicsLayer.h" |
#include "public/platform/WebRect.h" |
#include "web/WebLocalFrameImpl.h" |
#include "web/WebViewImpl.h" |
@@ -17,6 +19,7 @@ |
namespace blink { |
+/* |
static void paintLayers(PaintLayer& layer, SimDisplayItemList& displayList) |
Sami
2016/09/07 14:48:43
Probably meant to delete this completely?
szager1
2016/09/07 16:53:01
Yep, done.
|
{ |
if (layer.isAllowedToQueryCompositingState() && layer.compositingState() == PaintsIntoOwnBacking) { |
@@ -31,15 +34,33 @@ static void paintLayers(PaintLayer& layer, SimDisplayItemList& displayList) |
for (PaintLayer* child = layer.firstChild(); child; child = child->nextSibling()) |
paintLayers(*child, displayList); |
} |
+*/ |
-static void paintFrames(LocalFrame& root, SimDisplayItemList& displayList) |
+static void paintLayers(GraphicsLayer& layer, SimDisplayItemList& displayList) |
{ |
- for (Frame* frame = &root; frame; frame = frame->tree().traverseNext(&root)) { |
- if (!frame->isLocalFrame()) |
- continue; |
- PaintLayer* layer = toLocalFrame(frame)->view()->layoutViewItem().layer(); |
- paintLayers(*layer, displayList); |
+ if (layer.drawsContent() && layer.hasTrackedPaintInvalidations()) { |
+ ContentLayerDelegate* delegate = layer.contentLayerDelegateForTesting(); |
+ delegate->paintContents(&displayList); |
+ layer.resetTrackedPaintInvalidations(); |
+ } |
+ |
+ if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { |
chrishtr
2016/09/07 16:40:49
I don't think you need this conditional.
szager1
2016/09/07 16:53:01
Done.
|
+ if (GraphicsLayer* maskLayer = layer.maskLayer()) |
+ paintLayers(*maskLayer, displayList); |
+ if (GraphicsLayer* contentsClippingMaskLayer = layer.contentsClippingMaskLayer()) |
+ paintLayers(*contentsClippingMaskLayer, displayList); |
+ if (GraphicsLayer* replicaLayer = layer.replicaLayer()) |
+ paintLayers(*replicaLayer, displayList); |
} |
+ |
+ for (auto child : layer.children()) |
+ paintLayers(*child, displayList); |
+} |
+ |
+static void paintFrames(LocalFrame& root, SimDisplayItemList& displayList) |
+{ |
+ GraphicsLayer* layer = root.view()->layoutViewItem().compositor()->rootGraphicsLayer(); |
+ paintLayers(*layer, displayList); |
} |
SimCompositor::SimCompositor() |