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

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: Fix endRecording mistake 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..ccedd69a921481ba83f0e52e97465d5574aedff4 100644
--- a/Source/core/layout/svg/LayoutSVGResourceMasker.cpp
+++ b/Source/core/layout/svg/LayoutSVGResourceMasker.cpp
@@ -24,7 +24,7 @@
#include "core/layout/svg/SVGLayoutSupport.h"
#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 +70,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 +84,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.endRecording();
return m_maskContentPicture;
}
« no previous file with comments | « Source/core/layout/svg/LayoutSVGResourceClipper.cpp ('k') | Source/core/layout/svg/LayoutSVGResourcePattern.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698