diff options
author | John Reck <jreck@google.com> | 2015-04-22 09:04:45 -0700 |
---|---|---|
committer | John Reck <jreck@google.com> | 2015-04-22 09:34:34 -0700 |
commit | c1b33d665c8caf5760f68c45c6ca0baa649b832a (patch) | |
tree | 9c89975587ac76b4d10589fdc15d7af4baa22dbf /graphics | |
parent | bb2979d61c9cabd6f0476cc9e2121616d8001567 (diff) | |
download | frameworks_base-c1b33d665c8caf5760f68c45c6ca0baa649b832a.zip frameworks_base-c1b33d665c8caf5760f68c45c6ca0baa649b832a.tar.gz frameworks_base-c1b33d665c8caf5760f68c45c6ca0baa649b832a.tar.bz2 |
GraphicsJNI Canvas cleanup
Change-Id: I72e142986a8bc9f464c1951b6b5187919de3462e
Diffstat (limited to 'graphics')
-rw-r--r-- | graphics/java/android/graphics/Canvas.java | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/graphics/java/android/graphics/Canvas.java b/graphics/java/android/graphics/Canvas.java index 48afcbf..2acb8ba 100644 --- a/graphics/java/android/graphics/Canvas.java +++ b/graphics/java/android/graphics/Canvas.java @@ -81,10 +81,6 @@ public class Canvas { */ protected int mScreenDensity = Bitmap.DENSITY_NONE; - // Used by native code - @SuppressWarnings("UnusedDeclaration") - private int mSurfaceFormat; - /** * Flag for drawTextRun indicating left-to-right run direction. * @hide @@ -137,7 +133,7 @@ public class Canvas { public Canvas() { if (!isHardwareAccelerated()) { // 0 means no native bitmap - mNativeCanvasWrapper = initRaster(0); + mNativeCanvasWrapper = initRaster(null); mFinalizer = new CanvasFinalizer(mNativeCanvasWrapper); } else { mFinalizer = null; @@ -158,7 +154,7 @@ public class Canvas { throw new IllegalStateException("Immutable bitmap passed to Canvas constructor"); } throwIfCannotDraw(bitmap); - mNativeCanvasWrapper = initRaster(bitmap.getSkBitmap()); + mNativeCanvasWrapper = initRaster(bitmap); mFinalizer = new CanvasFinalizer(mNativeCanvasWrapper); mBitmap = bitmap; mDensity = bitmap.mDensity; @@ -215,7 +211,7 @@ public class Canvas { } if (bitmap == null) { - native_setBitmap(mNativeCanvasWrapper, 0, false); + native_setBitmap(mNativeCanvasWrapper, null); mDensity = Bitmap.DENSITY_NONE; } else { if (!bitmap.isMutable()) { @@ -223,7 +219,7 @@ public class Canvas { } throwIfCannotDraw(bitmap); - native_setBitmap(mNativeCanvasWrapper, bitmap.getSkBitmap(), true); + native_setBitmap(mNativeCanvasWrapper, bitmap); mDensity = bitmap.mDensity; } @@ -231,13 +227,6 @@ public class Canvas { } /** - * setBitmap() variant for native callers with a raw bitmap handle. - */ - private void setNativeBitmap(long bitmapHandle) { - native_setBitmap(mNativeCanvasWrapper, bitmapHandle, false); - } - - /** * Set the viewport dimensions if this canvas is GL based. If it is not, * this method is ignored and no exception is thrown. * @@ -1976,10 +1965,9 @@ public class Canvas { */ public static native void freeTextLayoutCaches(); - private static native long initRaster(long nativeBitmapOrZero); + private static native long initRaster(Bitmap bitmap); private static native void native_setBitmap(long canvasHandle, - long bitmapHandle, - boolean copyState); + Bitmap bitmap); private static native boolean native_isOpaque(long canvasHandle); private static native int native_getWidth(long canvasHandle); private static native int native_getHeight(long canvasHandle); |