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

Unified Diff: Source/core/paint/SVGMaskPainter.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/SVGMaskPainter.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/paint/SVGMaskPainter.cpp
diff --git a/Source/core/paint/SVGMaskPainter.cpp b/Source/core/paint/SVGMaskPainter.cpp
index 6b4e4d75005268129d93c8fc9bfa42f28e369e53..6f6bbac23d50e381758671b12ab62eecda455897 100644
--- a/Source/core/paint/SVGMaskPainter.cpp
+++ b/Source/core/paint/SVGMaskPainter.cpp
@@ -52,7 +52,7 @@ void SVGMaskPainter::finishEffect(const LayoutObject& object, GraphicsContext* c
ColorFilter maskLayerFilter = m_mask.style()->svgStyle().maskType() == MT_LUMINANCE
? ColorFilterLuminanceToAlpha : ColorFilterNone;
CompositingRecorder maskCompositing(*context, object, SkXfermode::kDstIn_Mode, 1, &paintInvalidationRect, maskLayerFilter);
- drawMaskForLayoutObject(context, object, object.objectBoundingBox());
+ drawMaskForLayoutObject(context, object, object.objectBoundingBox(), paintInvalidationRect);
}
if (RuntimeEnabledFeatures::slimmingPaintEnabled()) {
@@ -66,23 +66,21 @@ void SVGMaskPainter::finishEffect(const LayoutObject& object, GraphicsContext* c
}
}
-void SVGMaskPainter::drawMaskForLayoutObject(GraphicsContext* context, const LayoutObject& layoutObject, const FloatRect& targetBoundingBox)
+void SVGMaskPainter::drawMaskForLayoutObject(GraphicsContext* context, const LayoutObject& layoutObject, const FloatRect& targetBoundingBox, const FloatRect& targetPaintInvalidationRect)
{
ASSERT(context);
AffineTransform contentTransformation;
RefPtr<const SkPicture> maskContentPicture = m_mask.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::SVGMask, maskContentPicture));
- } else {
- DrawingDisplayItem maskPicture(layoutObject, DisplayItem::SVGClip, maskContentPicture);
- maskPicture.replay(*context);
- }
+ LayoutObjectDrawingRecorder drawingRecorder(*context, layoutObject, DisplayItem::SVGMask, targetPaintInvalidationRect);
+ if (drawingRecorder.canUseCachedDrawing())
+ return;
+
+ context->save();
+ context->concatCTM(contentTransformation);
+ context->drawPicture(maskContentPicture.get());
+ context->restore();
}
}
« no previous file with comments | « Source/core/paint/SVGMaskPainter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698