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

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

Issue 719353004: [Slimming Paint] Track clip renderers (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Address reviewer comments 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
Index: Source/core/paint/ClipRecorder.cpp
diff --git a/Source/core/paint/ClipRecorder.cpp b/Source/core/paint/ClipRecorder.cpp
index c59c85fddcdc7fde8e6ce678d66cef12e8160d91..dc9af3ee9803ecb0404b396b88f24df5673491a8 100644
--- a/Source/core/paint/ClipRecorder.cpp
+++ b/Source/core/paint/ClipRecorder.cpp
@@ -5,8 +5,7 @@
#include "config.h"
#include "core/paint/ClipRecorder.h"
-#include "core/rendering/RenderLayer.h"
-#include "core/rendering/RenderObject.h"
+#include "core/rendering/ClipRect.h"
#include "core/rendering/RenderView.h"
#include "platform/RuntimeEnabledFeatures.h"
#include "platform/graphics/GraphicsContext.h"
@@ -26,17 +25,17 @@ void EndClipDisplayItem::replay(GraphicsContext* context)
context->restore();
}
-ClipRecorder::ClipRecorder(RenderLayer* renderLayer, GraphicsContext* graphicsContext, DisplayItem::Type clipType, const ClipRect& clipRect)
+ClipRecorder::ClipRecorder(const RenderLayerModelObject* renderer, GraphicsContext* graphicsContext, DisplayItem::Type clipType, const ClipRect& clipRect)
: m_graphicsContext(graphicsContext)
- , m_renderLayer(renderLayer)
+ , m_renderer(renderer)
{
IntRect snappedClipRect = pixelSnappedIntRect(clipRect.rect());
if (!RuntimeEnabledFeatures::slimmingPaintEnabled()) {
graphicsContext->save();
graphicsContext->clip(snappedClipRect);
} else {
- m_clipDisplayItem = new ClipDisplayItem(0, renderLayer, clipType, snappedClipRect);
- m_renderLayer->renderer()->view()->viewDisplayList().add(adoptPtr(m_clipDisplayItem));
+ m_clipDisplayItem = new ClipDisplayItem(renderer, clipType, snappedClipRect);
+ m_renderer->view()->viewDisplayList().add(adoptPtr(m_clipDisplayItem));
}
}
@@ -51,8 +50,8 @@ void ClipRecorder::addRoundedRectClip(const RoundedRect& roundedRect)
ClipRecorder::~ClipRecorder()
{
if (RuntimeEnabledFeatures::slimmingPaintEnabled()) {
- OwnPtr<EndClipDisplayItem> endClip = adoptPtr(new EndClipDisplayItem);
- m_renderLayer->renderer()->view()->viewDisplayList().add(endClip.release());
+ OwnPtr<EndClipDisplayItem> endClip = adoptPtr(new EndClipDisplayItem(m_renderer));
+ m_renderer->view()->viewDisplayList().add(endClip.release());
} else {
m_graphicsContext->restore();
}

Powered by Google App Engine
This is Rietveld 408576698