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

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

Issue 1180233005: Do not emit display items for masks and clips that are already cached (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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 | « Source/core/paint/SVGClipPainter.h ('k') | Source/core/paint/SVGMaskPainter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/paint/SVGClipPainter.cpp
diff --git a/Source/core/paint/SVGClipPainter.cpp b/Source/core/paint/SVGClipPainter.cpp
index 4d49205577d979988048f3af89f665e6d7e61980..6f213c207e11604657b6e6c28af73fcca4e8fc53 100644
--- a/Source/core/paint/SVGClipPainter.cpp
+++ b/Source/core/paint/SVGClipPainter.cpp
@@ -10,6 +10,7 @@
#include "core/layout/svg/SVGResources.h"
#include "core/layout/svg/SVGResourcesCache.h"
#include "core/paint/CompositingRecorder.h"
+#include "core/paint/LayoutObjectDrawingRecorder.h"
#include "core/paint/PaintInfo.h"
#include "core/paint/TransformRecorder.h"
#include "platform/graphics/paint/ClipPathDisplayItem.h"
@@ -82,7 +83,7 @@ bool SVGClipPainter::applyClippingToContext(const LayoutObject& target, const Fl
return false;
}
- drawClipMaskContent(context, target, targetBoundingBox);
+ drawClipMaskContent(context, target, targetBoundingBox, paintInvalidationRect);
if (clipPathClipper)
SVGClipPainter(*clipPathClipper).postApplyStatefulResource(m_clip, context, clipPathClipperState);
@@ -120,23 +121,21 @@ void SVGClipPainter::postApplyStatefulResource(const LayoutObject& target, Graph
}
}
-void SVGClipPainter::drawClipMaskContent(GraphicsContext* context, const LayoutObject& layoutObject, const FloatRect& targetBoundingBox)
+void SVGClipPainter::drawClipMaskContent(GraphicsContext* context, const LayoutObject& layoutObject, const FloatRect& targetBoundingBox, const FloatRect& targetPaintInvalidationRect)
{
ASSERT(context);
AffineTransform contentTransformation;
RefPtr<const SkPicture> clipContentPicture = m_clip.createContentPicture(contentTransformation, targetBoundingBox, context);
- TransformRecorder recorder(*context, layoutObject, contentTransformation);
- if (RuntimeEnabledFeatures::slimmingPaintEnabled()) {
- ASSERT(context->displayItemList());
- if (context->displayItemList()->displayItemConstructionIsDisabled())
- return;
- context->displayItemList()->add(DrawingDisplayItem::create(layoutObject, DisplayItem::SVGClip, clipContentPicture));
- } else {
- DrawingDisplayItem clipPicture(layoutObject, DisplayItem::SVGClip, clipContentPicture);
- clipPicture.replay(*context);
- }
+ LayoutObjectDrawingRecorder drawingRecorder(*context, layoutObject, DisplayItem::SVGClip, targetPaintInvalidationRect);
+ if (drawingRecorder.canUseCachedDrawing())
+ return;
+
+ context->save();
+ context->concatCTM(contentTransformation);
+ context->drawPicture(clipContentPicture.get());
+ context->restore();
}
}
« no previous file with comments | « Source/core/paint/SVGClipPainter.h ('k') | Source/core/paint/SVGMaskPainter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698