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

Unified Diff: Source/core/svg/graphics/SVGImage.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/svg/graphics/SVGImage.cpp
diff --git a/Source/core/svg/graphics/SVGImage.cpp b/Source/core/svg/graphics/SVGImage.cpp
index f95f9db4be9d3a9da5fdde66675e7e2c8e9123c8..21259a6630af002894e83d547b841beea34adf80 100644
--- a/Source/core/svg/graphics/SVGImage.cpp
+++ b/Source/core/svg/graphics/SVGImage.cpp
@@ -57,6 +57,7 @@
#include "platform/graphics/ImageObserver.h"
#include "platform/graphics/paint/ClipRecorder.h"
#include "platform/graphics/paint/DisplayItemListContextRecorder.h"
+#include "platform/graphics/paint/SkPictureBuilder.h"
#include "third_party/skia/include/core/SkPicture.h"
#include "wtf/PassRefPtr.h"
@@ -243,26 +244,16 @@ void SVGImage::drawPatternForContainer(GraphicsContext* context, const FloatSize
FloatRect spacedTile(tile);
spacedTile.expand(repeatSpacing);
- OwnPtr<DisplayItemList> displayItemList;
- if (RuntimeEnabledFeatures::slimmingPaintEnabled())
- displayItemList = DisplayItemList::create();
-
- // Record using a dedicated GC, to avoid inheriting unwanted state (pending color filters
- // for example must be applied atomically during the final fill/composite phase).
- GraphicsContext recordingContext(displayItemList.get());
- recordingContext.beginRecording(spacedTile);
+ SkPictureBuilder pictureBuilder(spacedTile);
{
// When generating an expanded tile, make sure we don't draw into the spacing area.
OwnPtr<FloatClipRecorder> clipRecorder;
if (tile != spacedTile)
- clipRecorder = adoptPtr(new FloatClipRecorder(recordingContext, *this, PaintPhaseForeground, tile));
- drawForContainer(&recordingContext, containerSize, zoom, tile, srcRect, SkXfermode::kSrcOver_Mode);
+ clipRecorder = adoptPtr(new FloatClipRecorder(pictureBuilder.context(), *this, PaintPhaseForeground, tile));
+ drawForContainer(&pictureBuilder.context(), containerSize, zoom, tile, srcRect, SkXfermode::kSrcOver_Mode);
}
- if (displayItemList)
- displayItemList->commitNewDisplayItemsAndReplay(recordingContext);
-
- RefPtr<const SkPicture> tilePicture = recordingContext.endRecording();
+ RefPtr<const SkPicture> tilePicture = pictureBuilder.context().endRecording();
SkMatrix patternTransform;
patternTransform.setTranslate(phase.x() + spacedTile.x(), phase.y() + spacedTile.y());

Powered by Google App Engine
This is Rietveld 408576698