Use SkRuntimeEffect rather than SkRuntimeShaderFactory
The old API was a shim over the new API, and will be deleted soon. The new API is actually public, simpler, and more powerful. Test: Everything still builds. Change-Id: I11af8da9132e23a070e87dd5a7401c4854dd102a
This commit is contained in:
@@ -34,6 +34,7 @@ public class RuntimeShader extends Shader {
|
||||
}
|
||||
|
||||
private byte[] mUniforms;
|
||||
private boolean mIsOpaque;
|
||||
|
||||
/**
|
||||
* Current native shader factory instance.
|
||||
@@ -56,7 +57,8 @@ public class RuntimeShader extends Shader {
|
||||
ColorSpace colorSpace) {
|
||||
super(colorSpace);
|
||||
mUniforms = uniforms;
|
||||
mNativeInstanceRuntimeShaderFactory = nativeCreateShaderFactory(sksl, isOpaque);
|
||||
mIsOpaque = isOpaque;
|
||||
mNativeInstanceRuntimeShaderFactory = nativeCreateShaderFactory(sksl);
|
||||
NoImagePreloadHolder.sRegistry.registerNativeAllocation(this,
|
||||
mNativeInstanceRuntimeShaderFactory);
|
||||
}
|
||||
@@ -75,13 +77,13 @@ public class RuntimeShader extends Shader {
|
||||
@Override
|
||||
long createNativeInstance(long nativeMatrix) {
|
||||
return nativeCreate(mNativeInstanceRuntimeShaderFactory, nativeMatrix, mUniforms,
|
||||
colorSpace().getNativeInstance());
|
||||
colorSpace().getNativeInstance(), mIsOpaque);
|
||||
}
|
||||
|
||||
private static native long nativeCreate(long shaderFactory, long matrix, byte[] inputs,
|
||||
long colorSpaceHandle);
|
||||
long colorSpaceHandle, boolean isOpaque);
|
||||
|
||||
private static native long nativeCreateShaderFactory(String sksl, boolean isOpaque);
|
||||
private static native long nativeCreateShaderFactory(String sksl);
|
||||
|
||||
private static native long nativeGetFinalizer();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user