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

Unified Diff: third_party/WebKit/Source/platform/graphics/GeneratedImage.cpp

Issue 2565433003: Fix GeneratedImage::drawPattern() use of SkPictureBuilder. (Closed)
Patch Set: Remove old include. Add DCHECK to GC::beginRecording. Created 4 years 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/graphics/GeneratedImage.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/GeneratedImage.cpp b/third_party/WebKit/Source/platform/graphics/GeneratedImage.cpp
index db82f6d9235e54c53f83222da1ebe1555d410a46..113664876829641e1ed0446a6c9ed160ea019c99 100644
--- a/third_party/WebKit/Source/platform/graphics/GeneratedImage.cpp
+++ b/third_party/WebKit/Source/platform/graphics/GeneratedImage.cpp
@@ -32,7 +32,7 @@
#include "platform/geometry/FloatRect.h"
#include "platform/graphics/GraphicsContext.h"
-#include "platform/graphics/paint/SkPictureBuilder.h"
+#include "platform/graphics/paint/PaintController.h"
#include "third_party/skia/include/core/SkImage.h"
#include "third_party/skia/include/core/SkPicture.h"
@@ -48,10 +48,11 @@ void GeneratedImage::drawPattern(GraphicsContext& destContext,
FloatRect tileRect = srcRect;
tileRect.expand(FloatSize(repeatSpacing));
- SkPictureBuilder builder(tileRect, nullptr, &destContext);
- builder.context().beginRecording(tileRect);
- drawTile(builder.context(), srcRect);
- sk_sp<SkPicture> tilePicture = builder.endRecording();
+ std::unique_ptr<PaintController> paintController = PaintController::create();
+ GraphicsContext context(*paintController);
+ context.beginRecording(tileRect);
+ drawTile(context, srcRect);
+ sk_sp<SkPicture> tilePicture = context.endRecording();
SkMatrix patternMatrix = SkMatrix::MakeTrans(phase.x(), phase.y());
patternMatrix.preScale(scale.width(), scale.height());
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698