Chromium Code Reviews| Index: Source/platform/graphics/skia/NativeImageSkia.cpp |
| diff --git a/Source/platform/graphics/skia/NativeImageSkia.cpp b/Source/platform/graphics/skia/NativeImageSkia.cpp |
| index f7e70af0ad4d05d15b9903954a24f59e89866f85..386c507249f22d6798866fa899be3ec50691a0ac 100644 |
| --- a/Source/platform/graphics/skia/NativeImageSkia.cpp |
| +++ b/Source/platform/graphics/skia/NativeImageSkia.cpp |
| @@ -412,6 +412,15 @@ static SkBitmap createBitmapWithSpace(const SkBitmap& bitmap, int spaceWidth, in |
| return result; |
| } |
| +static SkVector computeScaleVector(const SkMatrix& matrix) |
| +{ |
| + SkScalar scaleX = matrix.getScaleX(); |
| + SkScalar scaleY = matrix.getScaleY(); |
| + SkScalar skewX = matrix.getSkewX(); |
| + SkScalar skewY = matrix.getSkewY(); |
| + return SkVector::Make(sqrt(scaleX * scaleX + skewY * skewY), sqrt(scaleY * scaleY + skewX * skewX)); |
|
Stephen White
2014/04/03 12:25:04
This looks a lot like AffineTransform::xScale() an
fs
2014/04/03 14:01:31
That was the intention...
|
| +} |
| + |
| void NativeImageSkia::drawPattern( |
| GraphicsContext* context, |
| const FloatRect& floatSrcRect, |
| @@ -428,8 +437,9 @@ void NativeImageSkia::drawPattern( |
| return; // nothing to draw |
| SkMatrix totalMatrix = context->getTotalMatrix(); |
| - SkScalar ctmScaleX = totalMatrix.getScaleX(); |
| - SkScalar ctmScaleY = totalMatrix.getScaleY(); |
| + SkVector ctmScale = computeScaleVector(totalMatrix); |
|
Stephen White
2014/04/03 12:25:04
Could this be
AffineTransform ctm = context->getC
fs
2014/04/03 14:01:31
...because I failed to find this one. Changed to u
|
| + SkScalar ctmScaleX = ctmScale.x(); |
| + SkScalar ctmScaleY = ctmScale.y(); |
| totalMatrix.preScale(scale.width(), scale.height()); |
| // Figure out what size the bitmap will be in the destination. The |