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

Unified Diff: Source/core/paint/ClipRecorder.cpp

Issue 723103002: Revert "Move ViewDisplayList to GraphicsLayer" (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 1 month 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 | « Source/core/paint/ClipRecorder.h ('k') | Source/core/paint/ClipRecorderTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/paint/ClipRecorder.cpp
diff --git a/Source/core/paint/ClipRecorder.cpp b/Source/core/paint/ClipRecorder.cpp
index 204eb9c58960ebfd6b05db1739b8b31e02ef20f7..c59c85fddcdc7fde8e6ce678d66cef12e8160d91 100644
--- a/Source/core/paint/ClipRecorder.cpp
+++ b/Source/core/paint/ClipRecorder.cpp
@@ -7,14 +7,25 @@
#include "core/rendering/RenderLayer.h"
#include "core/rendering/RenderObject.h"
+#include "core/rendering/RenderView.h"
#include "platform/RuntimeEnabledFeatures.h"
#include "platform/graphics/GraphicsContext.h"
-#include "platform/graphics/GraphicsLayer.h"
-#include "platform/graphics/paint/ClipDisplayItem.h"
-#include "platform/graphics/paint/DisplayItemList.h"
namespace blink {
+void ClipDisplayItem::replay(GraphicsContext* context)
+{
+ context->save();
+ context->clip(m_clipRect);
+ for (RoundedRect roundedRect : m_roundedRectClips)
+ context->clipRoundedRect(roundedRect);
+}
+
+void EndClipDisplayItem::replay(GraphicsContext* context)
+{
+ context->restore();
+}
+
ClipRecorder::ClipRecorder(RenderLayer* renderLayer, GraphicsContext* graphicsContext, DisplayItem::Type clipType, const ClipRect& clipRect)
: m_graphicsContext(graphicsContext)
, m_renderLayer(renderLayer)
@@ -24,12 +35,8 @@ ClipRecorder::ClipRecorder(RenderLayer* renderLayer, GraphicsContext* graphicsCo
graphicsContext->save();
graphicsContext->clip(snappedClipRect);
} else {
- m_clipDisplayItem = new ClipDisplayItem(nullptr, clipType, snappedClipRect);
-#ifndef NDEBUG
- m_clipDisplayItem->setClientDebugString("nullptr");
-#endif
- if (RenderLayer* container = m_renderLayer->enclosingLayerForPaintInvalidationCrossingFrameBoundaries())
- container->graphicsLayerBacking()->displayItemList().add(adoptPtr(m_clipDisplayItem));
+ m_clipDisplayItem = new ClipDisplayItem(0, renderLayer, clipType, snappedClipRect);
+ m_renderLayer->renderer()->view()->viewDisplayList().add(adoptPtr(m_clipDisplayItem));
}
}
@@ -45,11 +52,19 @@ ClipRecorder::~ClipRecorder()
{
if (RuntimeEnabledFeatures::slimmingPaintEnabled()) {
OwnPtr<EndClipDisplayItem> endClip = adoptPtr(new EndClipDisplayItem);
- if (RenderLayer* container = m_renderLayer->enclosingLayerForPaintInvalidationCrossingFrameBoundaries())
- container->graphicsLayerBacking()->displayItemList().add(endClip.release());
+ m_renderLayer->renderer()->view()->viewDisplayList().add(endClip.release());
} else {
m_graphicsContext->restore();
}
}
+#ifndef NDEBUG
+WTF::String ClipDisplayItem::asDebugString() const
+{
+ return String::format("{%s, type: \"%s\", clipRect: [%d,%d,%d,%d]}",
+ rendererDebugString(renderer()).utf8().data(), typeAsDebugString(type()).utf8().data(),
+ m_clipRect.x(), m_clipRect.y(), m_clipRect.width(), m_clipRect.height());
+}
+#endif
+
} // namespace blink
« no previous file with comments | « Source/core/paint/ClipRecorder.h ('k') | Source/core/paint/ClipRecorderTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698