Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(910)

Unified Diff: third_party/WebKit/Source/web/tests/sim/SimCompositor.cpp

Issue 2315083002: Fix GraphicsLayer traversal in SimCompositor (Closed)
Patch Set: Drop unneeded #include Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/web/tests/FrameThrottlingTest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..c7f84893b1350fc8c079a87c9657c86330d72342 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,29 +19,29 @@
namespace blink {
-static void paintLayers(PaintLayer& layer, SimDisplayItemList& displayList)
+static void paintLayers(GraphicsLayer& layer, SimDisplayItemList& displayList)
{
- if (layer.isAllowedToQueryCompositingState() && layer.compositingState() == PaintsIntoOwnBacking) {
- CompositedLayerMapping* mapping = layer.compositedLayerMapping();
- GraphicsLayer* graphicsLayer = mapping->mainGraphicsLayer();
- if (graphicsLayer->hasTrackedPaintInvalidations()) {
- ContentLayerDelegate* delegate = graphicsLayer->contentLayerDelegateForTesting();
- delegate->paintContents(&displayList);
- graphicsLayer->resetTrackedPaintInvalidations();
- }
+ if (layer.drawsContent() && layer.hasTrackedPaintInvalidations()) {
+ ContentLayerDelegate* delegate = layer.contentLayerDelegateForTesting();
+ delegate->paintContents(&displayList);
+ layer.resetTrackedPaintInvalidations();
}
- for (PaintLayer* child = layer.firstChild(); child; child = child->nextSibling())
+
+ 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)
{
- for (Frame* frame = &root; frame; frame = frame->tree().traverseNext(&root)) {
- if (!frame->isLocalFrame())
- continue;
- PaintLayer* layer = toLocalFrame(frame)->view()->layoutViewItem().layer();
- paintLayers(*layer, displayList);
- }
+ GraphicsLayer* layer = root.view()->layoutViewItem().compositor()->rootGraphicsLayer();
+ paintLayers(*layer, displayList);
}
SimCompositor::SimCompositor()
« no previous file with comments | « third_party/WebKit/Source/web/tests/FrameThrottlingTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698