replace CSXformSteps::Required() in SkShader

This call is working perfectly fine as far as I reckon, but it's subtly
error-prone to not explicitly mention the alpha types when making this
kind of decision.  It just so happens that Requires() used premul/premul
just as we do here, so this should be a no-op.

Change-Id: I96850cc4109a6ac3c46bb7bbb467a30628ee8d44
Commit-Queue: Mike Klein <>
Commit-Queue: Brian Osman <>
Auto-Submit: Mike Klein <>
Reviewed-by: Brian Osman <>
diff --git a/src/shaders/SkShader.cpp b/src/shaders/SkShader.cpp
index 79520b1..7455488 100644
--- a/src/shaders/SkShader.cpp
+++ b/src/shaders/SkShader.cpp
@@ -111,7 +111,12 @@
 SkShaderBase::Context::~Context() {}
 bool SkShaderBase::ContextRec::isLegacyCompatible(SkColorSpace* shaderColorSpace) const {
-    return !SkColorSpaceXformSteps::Required(shaderColorSpace, fDstColorSpace);
+    // In legacy pipelines, shaders always produce premul (or opaque) and the destination is also
+    // always premul (or opaque).  (And those "or opaque" caveats won't make any difference here.)
+    SkAlphaType shaderAT = kPremul_SkAlphaType,
+                   dstAT = kPremul_SkAlphaType;
+    return 0 == SkColorSpaceXformSteps{shaderColorSpace, shaderAT,
+                                         fDstColorSpace,    dstAT}.flags.mask();
 SkImage* SkShader::isAImage(SkMatrix* localMatrix, SkTileMode xy[2]) const {