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

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

Issue 2007553002: Retire setGradientSpaceTransform, setPatternSpaceTransform (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fmalita discovers SkMatrix::I() Created 4 years, 7 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: 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 2fef72aee6af85c4170125d7e497144396c5a9b5..874dc95f56eb2e3091df6bf0d2b97bbd4c8efc23 100644
--- a/third_party/WebKit/Source/platform/graphics/GeneratedImage.cpp
+++ b/third_party/WebKit/Source/platform/graphics/GeneratedImage.cpp
@@ -50,16 +50,14 @@ void GeneratedImage::drawPattern(GraphicsContext& destContext, const FloatRect&
drawTile(builder.context(), srcRect);
RefPtr<SkPicture> tilePicture = builder.endRecording();
- AffineTransform patternTransform;
- patternTransform.translate(phase.x(), phase.y());
- patternTransform.scale(scale.width(), scale.height());
- patternTransform.translate(tileRect.x(), tileRect.y());
+ SkMatrix patternMatrix = SkMatrix::MakeTrans(phase.x(), phase.y());
+ patternMatrix.preScale(scale.width(), scale.height());
+ patternMatrix.preTranslate(tileRect.x(), tileRect.y());
RefPtr<Pattern> picturePattern = Pattern::createPicturePattern(tilePicture.release());
- picturePattern->setPatternSpaceTransform(patternTransform);
SkPaint fillPaint = destContext.fillPaint();
- picturePattern->applyToPaint(fillPaint);
+ picturePattern->applyToPaint(fillPaint, patternMatrix);
fillPaint.setColor(SK_ColorBLACK);
fillPaint.setXfermodeMode(compositeOp);
« no previous file with comments | « third_party/WebKit/Source/modules/canvas2d/CanvasStyle.cpp ('k') | third_party/WebKit/Source/platform/graphics/Gradient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698