
org.robolectric.shadows.ShadowNativeComposeShader Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of shadows-framework Show documentation
Show all versions of shadows-framework Show documentation
An alternative Android testing framework.
The newest version!
package org.robolectric.shadows;
import static android.os.Build.VERSION_CODES.O;
import android.graphics.ComposeShader;
import org.robolectric.annotation.Implementation;
import org.robolectric.annotation.Implements;
import org.robolectric.nativeruntime.ComposeShaderNatives;
import org.robolectric.nativeruntime.DefaultNativeRuntimeLoader;
import org.robolectric.shadows.ShadowNativeComposeShader.Picker;
import org.robolectric.versioning.AndroidVersions.U;
/** Shadow for {@link ComposeShader} that is backed by native code */
@Implements(
value = ComposeShader.class,
minSdk = O,
shadowPicker = Picker.class,
callNativeMethodsByDefault = true)
public class ShadowNativeComposeShader {
@Implementation(minSdk = O, maxSdk = U.SDK_INT)
protected static long nativeCreate(
long nativeMatrix, long nativeShaderA, long nativeShaderB, int porterDuffMode) {
DefaultNativeRuntimeLoader.injectAndLoad();
return ComposeShaderNatives.nativeCreate(
nativeMatrix, nativeShaderA, nativeShaderB, porterDuffMode);
}
/** Shadow picker for {@link ComposeShader}. */
public static final class Picker extends GraphicsShadowPicker
© 2015 - 2025 Weber Informatics LLC | Privacy Policy