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

Unified Diff: Source/core/layout/svg/LayoutSVGResourceClipper.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/LayoutSVGResourceClipper.cpp
diff --git a/Source/core/layout/svg/LayoutSVGResourceClipper.cpp b/Source/core/layout/svg/LayoutSVGResourceClipper.cpp
index ca62f4c9caeaa0393a583b3ed9b09cc916edadb6..1645653ab0d80487b7c0cc94e0ac64a9084cf29e 100644
--- a/Source/core/layout/svg/LayoutSVGResourceClipper.cpp
+++ b/Source/core/layout/svg/LayoutSVGResourceClipper.cpp
@@ -38,6 +38,7 @@
#include "platform/graphics/paint/CompositingDisplayItem.h"
#include "platform/graphics/paint/DisplayItemList.h"
#include "platform/graphics/paint/DrawingDisplayItem.h"
+#include "platform/graphics/paint/SkPictureBuilder.h"
#include "third_party/skia/include/core/SkPicture.h"
namespace blink {
@@ -154,11 +155,7 @@ PassRefPtr<const SkPicture> LayoutSVGResourceClipper::createContentPicture(Affin
// 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);
for (SVGElement* childElement = Traversal<SVGElement>::firstChild(*element()); childElement; childElement = Traversal<SVGElement>::nextSibling(*childElement)) {
LayoutObject* layoutObject = childElement->layoutObject();
@@ -188,13 +185,11 @@ PassRefPtr<const SkPicture> LayoutSVGResourceClipper::createContentPicture(Affin
// - masker/filter not applied when laying out the children
// - fill is set to the initial fill paint server (solid, black)
// - stroke is set to the initial stroke paint server (none)
- PaintInfo info(&context, LayoutRect::infiniteIntRect(), PaintPhaseForeground, PaintBehaviorRenderingClipPathAsMask);
+ PaintInfo info(&pictureBuilder.context(), LayoutRect::infiniteIntRect(), PaintPhaseForeground, PaintBehaviorRenderingClipPathAsMask);
layoutObject->paint(info, IntPoint());
}
- if (displayItemList)
- displayItemList->commitNewDisplayItemsAndReplay(context);
- m_clipContentPicture = context.endRecording();
+ m_clipContentPicture = pictureBuilder.endRecording();
return m_clipContentPicture;
}
« no previous file with comments | « no previous file | Source/core/layout/svg/LayoutSVGResourceMasker.cpp » ('j') | Source/core/layout/svg/LayoutSVGResourceMasker.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698