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

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

Issue 2565433003: Fix GeneratedImage::drawPattern() use of SkPictureBuilder. (Closed)
Patch Set: 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 | no next file » | 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..a0410521f6362dbc7bd872ecdea07b6ba8d02e87 100644
--- a/third_party/WebKit/Source/platform/graphics/GeneratedImage.cpp
+++ b/third_party/WebKit/Source/platform/graphics/GeneratedImage.cpp
@@ -32,6 +32,7 @@
#include "platform/geometry/FloatRect.h"
#include "platform/graphics/GraphicsContext.h"
+#include "platform/graphics/paint/PaintController.h"
#include "platform/graphics/paint/SkPictureBuilder.h"
chrishtr 2016/12/09 02:02:31 You can remove this include.
vmiura 2016/12/09 03:48:57 Done.
#include "third_party/skia/include/core/SkImage.h"
#include "third_party/skia/include/core/SkPicture.h"
@@ -48,10 +49,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 | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698