Chromium Code Reviews| Index: third_party/WebKit/Source/platform/graphics/GradientGeneratedImage.cpp |
| diff --git a/third_party/WebKit/Source/platform/graphics/GradientGeneratedImage.cpp b/third_party/WebKit/Source/platform/graphics/GradientGeneratedImage.cpp |
| index b4dff46a969ed0abb8b4b54df99ff6bffeec0ba8..49a70c2a7842abbe3ac21601fdf6fcbd7e649979 100644 |
| --- a/third_party/WebKit/Source/platform/graphics/GradientGeneratedImage.cpp |
| +++ b/third_party/WebKit/Source/platform/graphics/GradientGeneratedImage.cpp |
| @@ -26,6 +26,7 @@ |
| #include "platform/graphics/GradientGeneratedImage.h" |
| #include "platform/geometry/FloatRect.h" |
| +#include "platform/geometry/IntSize.h" |
| #include "platform/graphics/GraphicsContext.h" |
| namespace blink { |
| @@ -52,4 +53,21 @@ void GradientGeneratedImage::drawTile(GraphicsContext& context, const FloatRect& |
| context.fillRect(srcRect); |
| } |
| +bool GradientGeneratedImage::applyShader(SkPaint& paint, const SkMatrix* localMatrix) |
| +{ |
| + AffineTransform transform; |
| + if (localMatrix) { |
| + transform.setMatrix( |
| + localMatrix->getScaleX(), localMatrix->getSkewY(), |
| + localMatrix->getSkewX(), localMatrix->getScaleY(), |
| + localMatrix->getTranslateX(), localMatrix->getTranslateY()); |
| + } |
| + |
| + DCHECK(m_gradient); |
| + m_gradient->setGradientSpaceTransform(transform); |
|
fs
2016/05/20 12:47:35
Could this end up affecting the result of a draw()
f(malita)
2016/05/20 13:57:57
Hmm, good question. I thought we always update th
fs
2016/05/20 14:18:56
The transform is never touch explicitly (and this
|
| + m_gradient->applyToPaint(paint); |
| + |
| + return true; |
| +} |
| + |
| } // namespace blink |