Merge "Add support for BitmapShader."

This commit is contained in:
Romain Guy
2010-07-15 14:45:37 -07:00
committed by Android (Google) Code Review
11 changed files with 409 additions and 53 deletions

View File

@@ -23,9 +23,19 @@ package android.graphics;
* drawn with that paint will get its color(s) from the shader.
*/
public class Shader {
/**
* Local matrix native instance.
*
* @hide
*/
public int mLocalMatrix;
// this is set by subclasses, but don't make it public
/* package */ int native_instance;
/**
* This is set by subclasses, but don't make it public.
*
* @hide
*/
public int native_instance;
public enum TileMode {
/**
@@ -64,11 +74,12 @@ public class Shader {
* @param localM The shader's new local matrix, or null to specify identity
*/
public void setLocalMatrix(Matrix localM) {
nativeSetLocalMatrix(native_instance,
localM != null ? localM.native_instance : 0);
mLocalMatrix = localM != null ? localM.native_instance : 0;
nativeSetLocalMatrix(native_instance, mLocalMatrix);
}
protected void finalize() throws Throwable {
super.finalize();
nativeDestructor(native_instance);
}