Revert "SkColorSpaceXformer: Preserve local matrix on shaders"
authorMatt Sarett <msarett@google.com>
Wed, 12 Apr 2017 15:48:35 +0000 (15:48 +0000)
committerSkia Commit-Bot <skia-commit-bot@chromium.org>
Wed, 12 Apr 2017 15:48:41 +0000 (15:48 +0000)
This reverts commit 5d884b562828ceb13ccacb71bc4581d2020e62bb.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> SkColorSpaceXformer: Preserve local matrix on shaders
>
> Also, do not drop unknown shaders.
>
> Fixes cts tests.
>
> b/37161109
> b/37237678
>
> Bug: skia:
> Change-Id: I0fd817a4d6461ede0ccdcb8f3cccb255b646b864
> Reviewed-on: https://skia-review.googlesource.com/13246
> Commit-Queue: Matt Sarett <msarett@google.com>
> Commit-Queue: Mike Klein <mtklein@chromium.org>
> Reviewed-by: Mike Klein <mtklein@chromium.org>
>

TBR=mtklein@chromium.org,mtklein@google.com,msarett@google.com,reviews@skia.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: I34e02785ac43a04f8452c458680ea1d6518818a6
Reviewed-on: https://skia-review.googlesource.com/13258
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>

src/core/SkColorSpaceXformer.cpp

index fe66e74..38e717d 100644 (file)
@@ -71,8 +71,7 @@ SkColor SkColorSpaceXformer::apply(SkColor srgb) {
 sk_sp<SkShader> SkColorSpaceXformer::apply(const SkShader* shader) {
     SkColor color;
     if (shader->isConstant() && shader->asLuminanceColor(&color)) {
-        return SkShader::MakeColorShader(this->apply(color))
-                ->makeWithLocalMatrix(shader->getLocalMatrix());
+        return SkShader::MakeColorShader(this->apply(color));
     }
 
     SkShader::TileMode xy[2];
@@ -86,8 +85,7 @@ sk_sp<SkShader> SkColorSpaceXformer::apply(const SkShader* shader) {
         auto A = this->apply(compose.fShaderA),
              B = this->apply(compose.fShaderB);
         if (A && B) {
-            return SkShader::MakeComposeShader(std::move(A), std::move(B), compose.fBlendMode)
-                    ->makeWithLocalMatrix(shader->getLocalMatrix());
+            return SkShader::MakeComposeShader(std::move(A), std::move(B), compose.fBlendMode);
         }
     }
 
@@ -149,7 +147,7 @@ sk_sp<SkShader> SkColorSpaceXformer::apply(const SkShader* shader) {
         }
     }
 
-    return sk_ref_sp(const_cast<SkShader*>(shader));
+    return nullptr;
 }
 
 const SkPaint& SkColorSpaceXformer::apply(const SkPaint& src) {