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

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: more expectations 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..aa3ba8c93c832b0252b31f93a1fecf8d8b6351f9 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);

Powered by Google App Engine
This is Rietveld 408576698