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

Unified Diff: Source/core/layout/svg/LayoutSVGResourcePattern.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/LayoutSVGResourcePattern.cpp
diff --git a/Source/core/layout/svg/LayoutSVGResourcePattern.cpp b/Source/core/layout/svg/LayoutSVGResourcePattern.cpp
index 0d3778c6c18267c0a51514ecfe514a2524d6b778..eadbb30e2d0a8355e67197272610ede922f6e507 100644
--- a/Source/core/layout/svg/LayoutSVGResourcePattern.cpp
+++ b/Source/core/layout/svg/LayoutSVGResourcePattern.cpp
@@ -30,6 +30,7 @@
#include "core/svg/SVGPatternElement.h"
#include "platform/graphics/GraphicsContext.h"
#include "platform/graphics/paint/DisplayItemList.h"
+#include "platform/graphics/paint/SkPictureBuilder.h"
#include "third_party/skia/include/core/SkPicture.h"
namespace blink {
@@ -165,12 +166,8 @@ PassRefPtr<const SkPicture> LayoutSVGResourcePattern::asPicture(const FloatRect&
if (attributes().patternContentUnits() == SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX)
contentTransform = tileTransform;
- // Draw the content into a Picture.
- OwnPtr<DisplayItemList> displayItemList;
- if (RuntimeEnabledFeatures::slimmingPaintEnabled())
- displayItemList = DisplayItemList::create();
- GraphicsContext recordingContext(displayItemList.get());
- recordingContext.beginRecording(FloatRect(FloatPoint(), tileBounds.size()));
+ FloatRect bounds(FloatPoint(), tileBounds.size());
+ SkPictureBuilder pictureBuilder(bounds);
chrishtr 2015/04/17 00:02:23 Just pass the bounds directly instead of via a loc
pdr. 2015/04/17 00:06:14 Sadly not an lvalue :'(
ASSERT(attributes().patternContentElement());
LayoutSVGResourceContainer* patternLayoutObject =
@@ -181,14 +178,12 @@ PassRefPtr<const SkPicture> LayoutSVGResourcePattern::asPicture(const FloatRect&
SubtreeContentTransformScope contentTransformScope(contentTransform);
{
- TransformRecorder transformRecorder(recordingContext, *patternLayoutObject, tileTransform);
+ TransformRecorder transformRecorder(pictureBuilder.context(), *patternLayoutObject, tileTransform);
for (LayoutObject* child = patternLayoutObject->firstChild(); child; child = child->nextSibling())
- SVGPaintContext::paintSubtree(&recordingContext, child);
+ SVGPaintContext::paintSubtree(&pictureBuilder.context(), child);
}
- if (displayItemList)
- displayItemList->commitNewDisplayItemsAndReplay(recordingContext);
- return recordingContext.endRecording();
+ return pictureBuilder.endRecording();
}
}

Powered by Google App Engine
This is Rietveld 408576698