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

Unified Diff: Source/core/layout/svg/LayoutSVGResourceMasker.cpp

Issue 1089293002: Add PictureRecorder for sp/non-sp recording without an existing context (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rename SkPictureBuilder, add a comment Created 5 years, 8 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
Index: Source/core/layout/svg/LayoutSVGResourceMasker.cpp
diff --git a/Source/core/layout/svg/LayoutSVGResourceMasker.cpp b/Source/core/layout/svg/LayoutSVGResourceMasker.cpp
index 06e5cbdc7097f987eba4f92b89990beb53e50370..6077aa7a2d01e064e377aedb71b149d24bec42ce 100644
--- a/Source/core/layout/svg/LayoutSVGResourceMasker.cpp
+++ b/Source/core/layout/svg/LayoutSVGResourceMasker.cpp
@@ -25,6 +25,7 @@
#include "core/paint/SVGPaintContext.h"
#include "core/svg/SVGElement.h"
#include "platform/graphics/paint/DisplayItemList.h"
+#include "platform/graphics/paint/SkPictureBuilder.h"
#include "platform/transforms/AffineTransform.h"
#include "third_party/skia/include/core/SkPicture.h"
@@ -70,15 +71,11 @@ PassRefPtr<const SkPicture> LayoutSVGResourceMasker::createContentPicture(Affine
// userSpaceOnUse units (http://crbug.com/294900).
FloatRect bounds = strokeBoundingBox();
- OwnPtr<DisplayItemList> displayItemList;
- if (RuntimeEnabledFeatures::slimmingPaintEnabled())
- displayItemList = DisplayItemList::create();
- GraphicsContext context(displayItemList.get());
- context.beginRecording(bounds);
+ SkPictureBuilder pictureBuilder(bounds);
ColorFilter maskContentFilter = style()->svgStyle().colorInterpolation() == CI_LINEARRGB
? ColorFilterSRGBToLinearRGB : ColorFilterNone;
- context.setColorFilter(maskContentFilter);
+ pictureBuilder.context().setColorFilter(maskContentFilter);
for (SVGElement* childElement = Traversal<SVGElement>::firstChild(*element()); childElement; childElement = Traversal<SVGElement>::nextSibling(*childElement)) {
LayoutObject* layoutObject = childElement->layoutObject();
@@ -88,12 +85,10 @@ PassRefPtr<const SkPicture> LayoutSVGResourceMasker::createContentPicture(Affine
if (!style || style->display() == NONE || style->visibility() != VISIBLE)
continue;
- SVGPaintContext::paintSubtree(&context, layoutObject);
+ SVGPaintContext::paintSubtree(&pictureBuilder.context(), layoutObject);
}
- if (displayItemList)
- displayItemList->commitNewDisplayItemsAndReplay(context);
- m_maskContentPicture = context.endRecording();
+ m_maskContentPicture = pictureBuilder.context().endRecording();
pdr. 2015/04/17 04:30:34 This should be pictureBuilder.endRecording().
return m_maskContentPicture;
}

Powered by Google App Engine
This is Rietveld 408576698