Fix build breakage due to API update in SkShader.
bug: 25344771
Change-Id: I64198a77c75d6768091dafd5c045b02ef66dfdad
(cherry picked from commit f4eca05cdc19c095cdc0a9140d512737533a87c5)
diff --git a/core/jni/android/graphics/Shader.cpp b/core/jni/android/graphics/Shader.cpp
index 799ed83..fda0ffa 100644
--- a/core/jni/android/graphics/Shader.cpp
+++ b/core/jni/android/graphics/Shader.cpp
@@ -60,19 +60,7 @@
// as all the data needed is contained within the newly created LocalMatrixShader.
SkASSERT(shaderHandle);
SkAutoTUnref<SkShader> currentShader(reinterpret_cast<SkShader*>(shaderHandle));
-
- SkMatrix currentMatrix;
- SkAutoTUnref<SkShader> baseShader(currentShader->refAsALocalMatrixShader(¤tMatrix));
- if (baseShader.get()) {
- // if the matrices are same then there is no need to allocate a new
- // shader that is identical to the existing one.
- if (currentMatrix == *matrix) {
- return reinterpret_cast<jlong>(currentShader.detach());
- }
- return reinterpret_cast<jlong>(SkShader::CreateLocalMatrixShader(baseShader, *matrix));
- }
-
- return reinterpret_cast<jlong>(SkShader::CreateLocalMatrixShader(currentShader, *matrix));
+ return reinterpret_cast<jlong>(currentShader->newWithLocalMatrix(*matrix));
}
///////////////////////////////////////////////////////////////////////////////////////////////