Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e1721099 authored by Derek Sollenberger's avatar Derek Sollenberger
Browse files

Fix build breakage due to API update in SkShader.

bug: 25344771
Change-Id: I64198a77c75d6768091dafd5c045b02ef66dfdad
(cherry picked from commit f4eca05cdc19c095cdc0a9140d512737533a87c5)
parent 32895546
Loading
Loading
Loading
Loading
+1 −13
Original line number Diff line number Diff line
@@ -60,19 +60,7 @@ static jlong Shader_setLocalMatrix(JNIEnv* env, jobject o, jlong shaderHandle, j
    // 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(&currentMatrix));
    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));
}

///////////////////////////////////////////////////////////////////////////////////////////////