FileDocCategorySizeDatePackage
ComposeShader.javaAPI DocAndroid 1.5 API2586Wed May 06 22:42:00 BST 2009android.graphics

ComposeShader

public class ComposeShader extends Shader
A subclass of shader that returns the coposition of two other shaders, combined by an {@link android.graphics.Xfermode} subclass.

Fields Summary
Constructors Summary
public ComposeShader(Shader shaderA, Shader shaderB, Xfermode mode)
Create a new compose shader, given shaders A, B, and a combining mode. When the mode is applied, it will be given the result from shader A as its "dst", and the result of from shader B as its "src".

param
shaderA The colors from this shader are seen as the "dst" by the mode
param
shaderB The colors from this shader are seen as the "src" by the mode
param
mode The mode that combines the colors from the two shaders. If mode is null, then SRC_OVER is assumed.

        native_instance = nativeCreate1(shaderA.native_instance, shaderB.native_instance,
                                        (mode != null) ? mode.native_instance : 0);
    
public ComposeShader(Shader shaderA, Shader shaderB, PorterDuff.Mode mode)
Create a new compose shader, given shaders A, B, and a combining PorterDuff mode. When the mode is applied, it will be given the result from shader A as its "dst", and the result of from shader B as its "src".

param
shaderA The colors from this shader are seen as the "dst" by the mode
param
shaderB The colors from this shader are seen as the "src" by the mode
param
mode The PorterDuff mode that combines the colors from the two shaders.

        native_instance = nativeCreate2(shaderA.native_instance, shaderB.native_instance,
                                        mode.nativeInt);
    
Methods Summary
private static native intnativeCreate1(int native_shaderA, int native_shaderB, int native_mode)

private static native intnativeCreate2(int native_shaderA, int native_shaderB, int porterDuffMode)