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

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

Issue 1949253004: Rounded background image fast path (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/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

Powered by Google App Engine
This is Rietveld 408576698