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

Commit ad6f5766 authored by Derek Sollenberger's avatar Derek Sollenberger Committed by Android (Google) Code Review
Browse files

Merge "Fix build breakage due to API update in SkShader."

parents 2a5c242c e1721099
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));
}

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