Local matrix support for RP gradients
authorFlorin Malita <fmalita@chromium.org>
Thu, 4 May 2017 21:24:45 +0000 (17:24 -0400)
committerSkia Commit-Bot <skia-commit-bot@chromium.org>
Fri, 5 May 2017 13:08:09 +0000 (13:08 +0000)
Change-Id: Id2cef26e0f91f14a0f1370fabe5ca15af9a4c07c
Reviewed-on: https://skia-review.googlesource.com/15317
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>

src/effects/gradients/SkGradientShader.cpp

index 03048db..3be6c1b 100644 (file)
@@ -352,13 +352,13 @@ bool SkGradientShaderBase::onAppendStages(
     const SkMatrix& ctm, const SkPaint& paint,
     const SkMatrix* localM) const
 {
-    // Local matrix not supported currently.  Remove once we have a generic RP wrapper.
-    if (localM || !getLocalMatrix().isIdentity()) {
-        return false;
-    }
-
     SkMatrix matrix;
-    if (!ctm.invert(&matrix)) {
+    if (!this->computeTotalInverse(ContextRec(paint,
+                                              ctm,
+                                              localM,
+                                              ContextRec::kPM4f_DstType, // doesn't matter here
+                                              dstCS),
+                                   &matrix)) {
         return false;
     }