diff options
author | Narayan Kamath <narayan@google.com> | 2014-01-27 14:21:38 +0000 |
---|---|---|
committer | Narayan Kamath <narayan@google.com> | 2014-01-27 14:22:45 +0000 |
commit | 7023df08f14ec5dee76ac54c03e870f84e297636 (patch) | |
tree | a0987dffe190d198657c8ccc20d7d7a6add92d83 /core/java/android/view | |
parent | 477d7d1be9340c4730663af7b748d67e85bc2951 (diff) | |
download | frameworks_base-7023df08f14ec5dee76ac54c03e870f84e297636.zip frameworks_base-7023df08f14ec5dee76ac54c03e870f84e297636.tar.gz frameworks_base-7023df08f14ec5dee76ac54c03e870f84e297636.tar.bz2 |
Revert "AArch64: Make graphics classes 64-bit compatible"
This reverts commit 18b4cbeedef21c1fa666a110a157bab66edff976.
Change-Id: I0c52983a3ab1ace3ff743de546a43eca28e5cb0e
Diffstat (limited to 'core/java/android/view')
-rw-r--r-- | core/java/android/view/DisplayList.java | 108 | ||||
-rw-r--r-- | core/java/android/view/GLES20Canvas.java | 260 | ||||
-rw-r--r-- | core/java/android/view/GLES20Layer.java | 8 | ||||
-rw-r--r-- | core/java/android/view/GLES20RecordingCanvas.java | 2 | ||||
-rw-r--r-- | core/java/android/view/GLRenderer.java | 4 | ||||
-rw-r--r-- | core/java/android/view/GraphicBuffer.java | 20 | ||||
-rw-r--r-- | core/java/android/view/HardwareCanvas.java | 14 | ||||
-rw-r--r-- | core/java/android/view/HardwareRenderer.java | 8 | ||||
-rw-r--r-- | core/java/android/view/RemoteGLRenderer.java | 4 | ||||
-rw-r--r-- | core/java/android/view/Surface.java | 36 | ||||
-rw-r--r-- | core/java/android/view/SurfaceControl.java | 28 | ||||
-rw-r--r-- | core/java/android/view/TextureView.java | 6 | ||||
-rw-r--r-- | core/java/android/view/ThreadedRenderer.java | 4 |
13 files changed, 251 insertions, 251 deletions
diff --git a/core/java/android/view/DisplayList.java b/core/java/android/view/DisplayList.java index 439fc6c..8dd6a91 100644 --- a/core/java/android/view/DisplayList.java +++ b/core/java/android/view/DisplayList.java @@ -364,7 +364,7 @@ public class DisplayList { return mValid && mFinalizer != null; } - long getNativeDisplayList() { + int getNativeDisplayList() { if (!mValid || mFinalizer == null) { throw new IllegalStateException("The display list is not valid."); } @@ -1029,73 +1029,73 @@ public class DisplayList { // Native methods /////////////////////////////////////////////////////////////////////////// - private static native void nDestroyDisplayList(long displayList); - private static native int nGetDisplayListSize(long displayList); - private static native void nSetDisplayListName(long displayList, String name); + private static native void nDestroyDisplayList(int displayList); + private static native int nGetDisplayListSize(int displayList); + private static native void nSetDisplayListName(int displayList, String name); // Properties - private static native void nReset(long displayList); - private static native void nOffsetTopAndBottom(long displayList, float offset); - private static native void nOffsetLeftAndRight(long displayList, float offset); - private static native void nSetLeftTopRightBottom(long displayList, int left, int top, + private static native void nReset(int displayList); + private static native void nOffsetTopAndBottom(int displayList, float offset); + private static native void nOffsetLeftAndRight(int displayList, float offset); + private static native void nSetLeftTopRightBottom(int displayList, int left, int top, int right, int bottom); - private static native void nSetBottom(long displayList, int bottom); - private static native void nSetRight(long displayList, int right); - private static native void nSetTop(long displayList, int top); - private static native void nSetLeft(long displayList, int left); - private static native void nSetCameraDistance(long displayList, float distance); - private static native void nSetPivotY(long displayList, float pivotY); - private static native void nSetPivotX(long displayList, float pivotX); - private static native void nSetCaching(long displayList, boolean caching); - private static native void nSetClipToBounds(long displayList, boolean clipToBounds); - private static native void nSetProjectToContainedVolume(long displayList, boolean shouldProject); - private static native void nSetIsContainedVolume(long displayList, boolean isContainedVolume); - private static native void nSetAlpha(long displayList, float alpha); - private static native void nSetHasOverlappingRendering(long displayList, + private static native void nSetBottom(int displayList, int bottom); + private static native void nSetRight(int displayList, int right); + private static native void nSetTop(int displayList, int top); + private static native void nSetLeft(int displayList, int left); + private static native void nSetCameraDistance(int displayList, float distance); + private static native void nSetPivotY(int displayList, float pivotY); + private static native void nSetPivotX(int displayList, float pivotX); + private static native void nSetCaching(int displayList, boolean caching); + private static native void nSetClipToBounds(int displayList, boolean clipToBounds); + private static native void nSetProjectToContainedVolume(int displayList, boolean shouldProject); + private static native void nSetIsContainedVolume(int displayList, boolean isContainedVolume); + private static native void nSetAlpha(int displayList, float alpha); + private static native void nSetHasOverlappingRendering(int displayList, boolean hasOverlappingRendering); - private static native void nSetTranslationX(long displayList, float translationX); - private static native void nSetTranslationY(long displayList, float translationY); - private static native void nSetTranslationZ(long displayList, float translationZ); - private static native void nSetRotation(long displayList, float rotation); - private static native void nSetRotationX(long displayList, float rotationX); - private static native void nSetRotationY(long displayList, float rotationY); - private static native void nSetScaleX(long displayList, float scaleX); - private static native void nSetScaleY(long displayList, float scaleY); - private static native void nSetTransformationInfo(long displayList, float alpha, + private static native void nSetTranslationX(int displayList, float translationX); + private static native void nSetTranslationY(int displayList, float translationY); + private static native void nSetTranslationZ(int displayList, float translationZ); + private static native void nSetRotation(int displayList, float rotation); + private static native void nSetRotationX(int displayList, float rotationX); + private static native void nSetRotationY(int displayList, float rotationY); + private static native void nSetScaleX(int displayList, float scaleX); + private static native void nSetScaleY(int displayList, float scaleY); + private static native void nSetTransformationInfo(int displayList, float alpha, float translationX, float translationY, float translationZ, float rotation, float rotationX, float rotationY, float scaleX, float scaleY); - private static native void nSetStaticMatrix(long displayList, long nativeMatrix); - private static native void nSetAnimationMatrix(long displayList, long animationMatrix); - - private static native boolean nHasOverlappingRendering(long displayList); - private static native void nGetMatrix(long displayList, long matrix); - private static native float nGetAlpha(long displayList); - private static native float nGetLeft(long displayList); - private static native float nGetTop(long displayList); - private static native float nGetRight(long displayList); - private static native float nGetBottom(long displayList); - private static native float nGetCameraDistance(long displayList); - private static native float nGetScaleX(long displayList); - private static native float nGetScaleY(long displayList); - private static native float nGetTranslationX(long displayList); - private static native float nGetTranslationY(long displayList); - private static native float nGetTranslationZ(long displayList); - private static native float nGetRotation(long displayList); - private static native float nGetRotationX(long displayList); - private static native float nGetRotationY(long displayList); - private static native float nGetPivotX(long displayList); - private static native float nGetPivotY(long displayList); - private static native void nOutput(long displayList); + private static native void nSetStaticMatrix(int displayList, int nativeMatrix); + private static native void nSetAnimationMatrix(int displayList, int animationMatrix); + + private static native boolean nHasOverlappingRendering(int displayList); + private static native void nGetMatrix(int displayList, int matrix); + private static native float nGetAlpha(int displayList); + private static native float nGetLeft(int displayList); + private static native float nGetTop(int displayList); + private static native float nGetRight(int displayList); + private static native float nGetBottom(int displayList); + private static native float nGetCameraDistance(int displayList); + private static native float nGetScaleX(int displayList); + private static native float nGetScaleY(int displayList); + private static native float nGetTranslationX(int displayList); + private static native float nGetTranslationY(int displayList); + private static native float nGetTranslationZ(int displayList); + private static native float nGetRotation(int displayList); + private static native float nGetRotationX(int displayList); + private static native float nGetRotationY(int displayList); + private static native float nGetPivotX(int displayList); + private static native float nGetPivotY(int displayList); + private static native void nOutput(int displayList); /////////////////////////////////////////////////////////////////////////// // Finalization /////////////////////////////////////////////////////////////////////////// private static class DisplayListFinalizer { - final long mNativeDisplayList; + final int mNativeDisplayList; - public DisplayListFinalizer(long nativeDisplayList) { + public DisplayListFinalizer(int nativeDisplayList) { mNativeDisplayList = nativeDisplayList; } diff --git a/core/java/android/view/GLES20Canvas.java b/core/java/android/view/GLES20Canvas.java index 3384359..449318e 100644 --- a/core/java/android/view/GLES20Canvas.java +++ b/core/java/android/view/GLES20Canvas.java @@ -49,7 +49,7 @@ class GLES20Canvas extends HardwareCanvas { private static final int MODIFIER_COLOR_FILTER = 4; private final boolean mOpaque; - private long mRenderer; + private int mRenderer; // The native renderer will be destroyed when this object dies. // DO NOT overwrite this reference once it is set. @@ -92,7 +92,7 @@ class GLES20Canvas extends HardwareCanvas { /** * Creates a canvas to render into an FBO. */ - GLES20Canvas(long layer, boolean translucent) { + GLES20Canvas(int layer, boolean translucent) { mOpaque = !translucent; mRenderer = nCreateLayerRenderer(layer); setupFinalizer(); @@ -122,16 +122,16 @@ class GLES20Canvas extends HardwareCanvas { nResetDisplayListRenderer(mRenderer); } - private static native long nCreateRenderer(); - private static native long nCreateLayerRenderer(long layer); - private static native long nCreateDisplayListRenderer(); - private static native void nResetDisplayListRenderer(long renderer); - private static native void nDestroyRenderer(long renderer); + private static native int nCreateRenderer(); + private static native int nCreateLayerRenderer(int layer); + private static native int nCreateDisplayListRenderer(); + private static native void nResetDisplayListRenderer(int renderer); + private static native void nDestroyRenderer(int renderer); private static final class CanvasFinalizer { - private final long mRenderer; + private final int mRenderer; - public CanvasFinalizer(long renderer) { + public CanvasFinalizer(int renderer) { mRenderer = renderer; } @@ -175,26 +175,26 @@ class GLES20Canvas extends HardwareCanvas { nClearLayerUpdates(mRenderer); } - static native long nCreateTextureLayer(boolean opaque, int[] layerInfo); - static native long nCreateLayer(int width, int height, boolean isOpaque, int[] layerInfo); - static native boolean nResizeLayer(long layerId, int width, int height, int[] layerInfo); - static native void nSetOpaqueLayer(long layerId, boolean isOpaque); - static native void nSetLayerPaint(long layerId, long nativePaint); - static native void nSetLayerColorFilter(long layerId, long nativeColorFilter); - static native void nUpdateTextureLayer(long layerId, int width, int height, boolean opaque, + static native int nCreateTextureLayer(boolean opaque, int[] layerInfo); + static native int nCreateLayer(int width, int height, boolean isOpaque, int[] layerInfo); + static native boolean nResizeLayer(int layerId, int width, int height, int[] layerInfo); + static native void nSetOpaqueLayer(int layerId, boolean isOpaque); + static native void nSetLayerPaint(int layerId, int nativePaint); + static native void nSetLayerColorFilter(int layerId, int nativeColorFilter); + static native void nUpdateTextureLayer(int layerId, int width, int height, boolean opaque, SurfaceTexture surface); - static native void nClearLayerTexture(long layerId); - static native void nSetTextureLayerTransform(long layerId, long matrix); - static native void nDestroyLayer(long layerId); - static native void nDestroyLayerDeferred(long layerId); - static native void nUpdateRenderLayer(long layerId, long renderer, long displayList, + static native void nClearLayerTexture(int layerId); + static native void nSetTextureLayerTransform(int layerId, int matrix); + static native void nDestroyLayer(int layerId); + static native void nDestroyLayerDeferred(int layerId); + static native void nUpdateRenderLayer(int layerId, int renderer, int displayList, int left, int top, int right, int bottom); - static native boolean nCopyLayer(long layerId, long bitmap); + static native boolean nCopyLayer(int layerId, int bitmap); - private static native void nClearLayerUpdates(long renderer); - private static native void nFlushLayerUpdates(long renderer); - private static native void nPushLayerUpdate(long renderer, long layer); - private static native void nCancelLayerUpdate(long renderer, long layer); + private static native void nClearLayerUpdates(int renderer); + private static native void nFlushLayerUpdates(int renderer); + private static native void nPushLayerUpdate(int renderer, int layer); + private static native void nCancelLayerUpdate(int renderer, int layer); /////////////////////////////////////////////////////////////////////////// // Canvas management @@ -231,7 +231,7 @@ class GLES20Canvas extends HardwareCanvas { /** * Returns the native OpenGLRenderer object. */ - long getRenderer() { + int getRenderer() { return mRenderer; } @@ -247,7 +247,7 @@ class GLES20Canvas extends HardwareCanvas { nSetViewport(mRenderer, width, height); } - private static native void nSetViewport(long renderer, int width, int height); + private static native void nSetViewport(int renderer, int width, int height); @Override public int onPreDraw(Rect dirty) { @@ -259,8 +259,8 @@ class GLES20Canvas extends HardwareCanvas { } } - private static native int nPrepare(long renderer, boolean opaque); - private static native int nPrepareDirty(long renderer, int left, int top, int right, int bottom, + private static native int nPrepare(int renderer, boolean opaque); + private static native int nPrepareDirty(int renderer, int left, int top, int right, int bottom, boolean opaque); @Override @@ -268,7 +268,7 @@ class GLES20Canvas extends HardwareCanvas { nFinish(mRenderer); } - private static native void nFinish(long renderer); + private static native void nFinish(int renderer); /** * Returns the size of the stencil buffer required by the underlying @@ -288,45 +288,45 @@ class GLES20Canvas extends HardwareCanvas { nSetCountOverdrawEnabled(mRenderer, enabled); } - static native void nSetCountOverdrawEnabled(long renderer, boolean enabled); + static native void nSetCountOverdrawEnabled(int renderer, boolean enabled); float getOverdraw() { return nGetOverdraw(mRenderer); } - static native float nGetOverdraw(long renderer); + static native float nGetOverdraw(int renderer); /////////////////////////////////////////////////////////////////////////// // Functor /////////////////////////////////////////////////////////////////////////// @Override - public int callDrawGLFunction(long drawGLFunction) { + public int callDrawGLFunction(int drawGLFunction) { return nCallDrawGLFunction(mRenderer, drawGLFunction); } - private static native int nCallDrawGLFunction(long renderer, long drawGLFunction); + private static native int nCallDrawGLFunction(int renderer, int drawGLFunction); @Override public int invokeFunctors(Rect dirty) { return nInvokeFunctors(mRenderer, dirty); } - private static native int nInvokeFunctors(long renderer, Rect dirty); + private static native int nInvokeFunctors(int renderer, Rect dirty); @Override - public void detachFunctor(long functor) { + public void detachFunctor(int functor) { nDetachFunctor(mRenderer, functor); } - private static native void nDetachFunctor(long renderer, long functor); + private static native void nDetachFunctor(int renderer, int functor); @Override - public void attachFunctor(long functor) { + public void attachFunctor(int functor) { nAttachFunctor(mRenderer, functor); } - private static native void nAttachFunctor(long renderer, long functor); + private static native void nAttachFunctor(int renderer, int functor); /////////////////////////////////////////////////////////////////////////// // Memory @@ -400,11 +400,11 @@ class GLES20Canvas extends HardwareCanvas { // Display list /////////////////////////////////////////////////////////////////////////// - long getDisplayList(long displayList) { + int getDisplayList(int displayList) { return nGetDisplayList(mRenderer, displayList); } - private static native long nGetDisplayList(long renderer, long displayList); + private static native int nGetDisplayList(int renderer, int displayList); @Override public int drawDisplayList(DisplayList displayList, Rect dirty, int flags) { @@ -412,7 +412,7 @@ class GLES20Canvas extends HardwareCanvas { dirty, flags); } - private static native int nDrawDisplayList(long renderer, long displayList, + private static native int nDrawDisplayList(int renderer, int displayList, Rect dirty, int flags); /////////////////////////////////////////////////////////////////////////// @@ -426,7 +426,7 @@ class GLES20Canvas extends HardwareCanvas { nDrawLayer(mRenderer, glLayer.getLayer(), x, y); } - private static native void nDrawLayer(long renderer, long layer, float x, float y); + private static native void nDrawLayer(int renderer, int layer, float x, float y); void interrupt() { nInterrupt(mRenderer); @@ -436,8 +436,8 @@ class GLES20Canvas extends HardwareCanvas { nResume(mRenderer); } - private static native void nInterrupt(long renderer); - private static native void nResume(long renderer); + private static native void nInterrupt(int renderer); + private static native void nResume(int renderer); /////////////////////////////////////////////////////////////////////////// // Support @@ -478,14 +478,14 @@ class GLES20Canvas extends HardwareCanvas { return nClipPath(mRenderer, path.mNativePath, op.nativeInt); } - private static native boolean nClipPath(long renderer, long path, int op); + private static native boolean nClipPath(int renderer, int path, int op); @Override public boolean clipRect(float left, float top, float right, float bottom) { return nClipRect(mRenderer, left, top, right, bottom, Region.Op.INTERSECT.nativeInt); } - private static native boolean nClipRect(long renderer, float left, float top, + private static native boolean nClipRect(int renderer, float left, float top, float right, float bottom, int op); @Override @@ -498,7 +498,7 @@ class GLES20Canvas extends HardwareCanvas { return nClipRect(mRenderer, left, top, right, bottom, Region.Op.INTERSECT.nativeInt); } - private static native boolean nClipRect(long renderer, int left, int top, + private static native boolean nClipRect(int renderer, int left, int top, int right, int bottom, int op); @Override @@ -533,21 +533,21 @@ class GLES20Canvas extends HardwareCanvas { return nClipRegion(mRenderer, region.mNativeRegion, op.nativeInt); } - private static native boolean nClipRegion(long renderer, long region, int op); + private static native boolean nClipRegion(int renderer, int region, int op); @Override public boolean getClipBounds(Rect bounds) { return nGetClipBounds(mRenderer, bounds); } - private static native boolean nGetClipBounds(long renderer, Rect bounds); + private static native boolean nGetClipBounds(int renderer, Rect bounds); @Override public boolean quickReject(float left, float top, float right, float bottom, EdgeType type) { return nQuickReject(mRenderer, left, top, right, bottom); } - private static native boolean nQuickReject(long renderer, float left, float top, + private static native boolean nQuickReject(int renderer, float left, float top, float right, float bottom); @Override @@ -572,35 +572,35 @@ class GLES20Canvas extends HardwareCanvas { if (dx != 0.0f || dy != 0.0f) nTranslate(mRenderer, dx, dy); } - private static native void nTranslate(long renderer, float dx, float dy); + private static native void nTranslate(int renderer, float dx, float dy); @Override public void skew(float sx, float sy) { nSkew(mRenderer, sx, sy); } - private static native void nSkew(long renderer, float sx, float sy); + private static native void nSkew(int renderer, float sx, float sy); @Override public void rotate(float degrees) { nRotate(mRenderer, degrees); } - private static native void nRotate(long renderer, float degrees); + private static native void nRotate(int renderer, float degrees); @Override public void scale(float sx, float sy) { nScale(mRenderer, sx, sy); } - private static native void nScale(long renderer, float sx, float sy); + private static native void nScale(int renderer, float sx, float sy); @Override public void setMatrix(Matrix matrix) { nSetMatrix(mRenderer, matrix == null ? 0 : matrix.native_instance); } - private static native void nSetMatrix(long renderer, long matrix); + private static native void nSetMatrix(int renderer, int matrix); @SuppressWarnings("deprecation") @Override @@ -608,14 +608,14 @@ class GLES20Canvas extends HardwareCanvas { nGetMatrix(mRenderer, matrix.native_instance); } - private static native void nGetMatrix(long renderer, long matrix); + private static native void nGetMatrix(int renderer, int matrix); @Override public void concat(Matrix matrix) { if (matrix != null) nConcatMatrix(mRenderer, matrix.native_instance); } - private static native void nConcatMatrix(long renderer, long matrix); + private static native void nConcatMatrix(int renderer, int matrix); /////////////////////////////////////////////////////////////////////////// // State management @@ -631,7 +631,7 @@ class GLES20Canvas extends HardwareCanvas { return nSave(mRenderer, saveFlags); } - private static native int nSave(long renderer, int flags); + private static native int nSave(int renderer, int flags); @Override public int saveLayer(RectF bounds, Paint paint, int saveFlags) { @@ -642,7 +642,7 @@ class GLES20Canvas extends HardwareCanvas { int count; int modifier = paint != null ? setupColorFilter(paint) : MODIFIER_NONE; try { - final long nativePaint = paint == null ? 0 : paint.mNativePaint; + final int nativePaint = paint == null ? 0 : paint.mNativePaint; count = nSaveLayer(mRenderer, nativePaint, saveFlags); } finally { if (modifier != MODIFIER_NONE) nResetModifiers(mRenderer, modifier); @@ -650,7 +650,7 @@ class GLES20Canvas extends HardwareCanvas { return count; } - private static native int nSaveLayer(long renderer, long paint, int saveFlags); + private static native int nSaveLayer(int renderer, int paint, int saveFlags); @Override public int saveLayer(float left, float top, float right, float bottom, Paint paint, @@ -659,7 +659,7 @@ class GLES20Canvas extends HardwareCanvas { int count; int modifier = paint != null ? setupColorFilter(paint) : MODIFIER_NONE; try { - final long nativePaint = paint == null ? 0 : paint.mNativePaint; + final int nativePaint = paint == null ? 0 : paint.mNativePaint; count = nSaveLayer(mRenderer, left, top, right, bottom, nativePaint, saveFlags); } finally { if (modifier != MODIFIER_NONE) nResetModifiers(mRenderer, modifier); @@ -669,8 +669,8 @@ class GLES20Canvas extends HardwareCanvas { return save(saveFlags); } - private static native int nSaveLayer(long renderer, float left, float top, - float right, float bottom, long paint, int saveFlags); + private static native int nSaveLayer(int renderer, float left, float top, + float right, float bottom, int paint, int saveFlags); @Override public int saveLayerAlpha(RectF bounds, int alpha, int saveFlags) { @@ -681,7 +681,7 @@ class GLES20Canvas extends HardwareCanvas { return nSaveLayerAlpha(mRenderer, alpha, saveFlags); } - private static native int nSaveLayerAlpha(long renderer, int alpha, int saveFlags); + private static native int nSaveLayerAlpha(int renderer, int alpha, int saveFlags); @Override public int saveLayerAlpha(float left, float top, float right, float bottom, int alpha, @@ -692,7 +692,7 @@ class GLES20Canvas extends HardwareCanvas { return save(saveFlags); } - private static native int nSaveLayerAlpha(long renderer, float left, float top, float right, + private static native int nSaveLayerAlpha(int renderer, float left, float top, float right, float bottom, int alpha, int saveFlags); @Override @@ -700,21 +700,21 @@ class GLES20Canvas extends HardwareCanvas { nRestore(mRenderer); } - private static native void nRestore(long renderer); + private static native void nRestore(int renderer); @Override public void restoreToCount(int saveCount) { nRestoreToCount(mRenderer, saveCount); } - private static native void nRestoreToCount(long renderer, int saveCount); + private static native void nRestoreToCount(int renderer, int saveCount); @Override public int getSaveCount() { return nGetSaveCount(mRenderer); } - private static native int nGetSaveCount(long renderer); + private static native int nGetSaveCount(int renderer); /////////////////////////////////////////////////////////////////////////// // Filtering @@ -731,8 +731,8 @@ class GLES20Canvas extends HardwareCanvas { } } - private static native void nResetPaintFilter(long renderer); - private static native void nSetupPaintFilter(long renderer, int clearBits, int setBits); + private static native void nResetPaintFilter(int renderer); + private static native void nSetupPaintFilter(int renderer, int clearBits, int setBits); @Override public DrawFilter getDrawFilter() { @@ -755,9 +755,9 @@ class GLES20Canvas extends HardwareCanvas { } } - private static native void nDrawArc(long renderer, float left, float top, + private static native void nDrawArc(int renderer, float left, float top, float right, float bottom, float startAngle, float sweepAngle, - boolean useCenter, long paint); + boolean useCenter, int paint); @Override public void drawARGB(int a, int r, int g, int b) { @@ -771,7 +771,7 @@ class GLES20Canvas extends HardwareCanvas { // Shaders are ignored when drawing patches int modifier = paint != null ? setupColorFilter(paint) : MODIFIER_NONE; try { - final long nativePaint = paint == null ? 0 : paint.mNativePaint; + final int nativePaint = paint == null ? 0 : paint.mNativePaint; nDrawPatch(mRenderer, bitmap.mNativeBitmap, bitmap.mBuffer, patch.mNativeChunk, dst.left, dst.top, dst.right, dst.bottom, nativePaint); } finally { @@ -786,7 +786,7 @@ class GLES20Canvas extends HardwareCanvas { // Shaders are ignored when drawing patches int modifier = paint != null ? setupColorFilter(paint) : MODIFIER_NONE; try { - final long nativePaint = paint == null ? 0 : paint.mNativePaint; + final int nativePaint = paint == null ? 0 : paint.mNativePaint; nDrawPatch(mRenderer, bitmap.mNativeBitmap, bitmap.mBuffer, patch.mNativeChunk, dst.left, dst.top, dst.right, dst.bottom, nativePaint); } finally { @@ -794,8 +794,8 @@ class GLES20Canvas extends HardwareCanvas { } } - private static native void nDrawPatch(long renderer, long bitmap, byte[] buffer, long chunk, - float left, float top, float right, float bottom, long paint); + private static native void nDrawPatch(int renderer, int bitmap, byte[] buffer, int chunk, + float left, float top, float right, float bottom, int paint); @Override public void drawBitmap(Bitmap bitmap, float left, float top, Paint paint) { @@ -803,15 +803,15 @@ class GLES20Canvas extends HardwareCanvas { // Shaders are ignored when drawing bitmaps int modifiers = paint != null ? setupModifiers(bitmap, paint) : MODIFIER_NONE; try { - final long nativePaint = paint == null ? 0 : paint.mNativePaint; + final int nativePaint = paint == null ? 0 : paint.mNativePaint; nDrawBitmap(mRenderer, bitmap.mNativeBitmap, bitmap.mBuffer, left, top, nativePaint); } finally { if (modifiers != MODIFIER_NONE) nResetModifiers(mRenderer, modifiers); } } - private static native void nDrawBitmap(long renderer, long bitmap, byte[] buffer, - float left, float top, long paint); + private static native void nDrawBitmap(int renderer, int bitmap, byte[] buffer, + float left, float top, int paint); @Override public void drawBitmap(Bitmap bitmap, Matrix matrix, Paint paint) { @@ -819,7 +819,7 @@ class GLES20Canvas extends HardwareCanvas { // Shaders are ignored when drawing bitmaps int modifiers = paint != null ? setupModifiers(bitmap, paint) : MODIFIER_NONE; try { - final long nativePaint = paint == null ? 0 : paint.mNativePaint; + final int nativePaint = paint == null ? 0 : paint.mNativePaint; nDrawBitmap(mRenderer, bitmap.mNativeBitmap, bitmap.mBuffer, matrix.native_instance, nativePaint); } finally { @@ -827,8 +827,8 @@ class GLES20Canvas extends HardwareCanvas { } } - private static native void nDrawBitmap(long renderer, long bitmap, byte[] buffer, - long matrix, long paint); + private static native void nDrawBitmap(int renderer, int bitmap, byte[] buffer, + int matrix, int paint); @Override public void drawBitmap(Bitmap bitmap, Rect src, Rect dst, Paint paint) { @@ -836,7 +836,7 @@ class GLES20Canvas extends HardwareCanvas { // Shaders are ignored when drawing bitmaps int modifiers = paint != null ? setupModifiers(bitmap, paint) : MODIFIER_NONE; try { - final long nativePaint = paint == null ? 0 : paint.mNativePaint; + final int nativePaint = paint == null ? 0 : paint.mNativePaint; int left, top, right, bottom; if (src == null) { @@ -863,7 +863,7 @@ class GLES20Canvas extends HardwareCanvas { // Shaders are ignored when drawing bitmaps int modifiers = paint != null ? setupModifiers(bitmap, paint) : MODIFIER_NONE; try { - final long nativePaint = paint == null ? 0 : paint.mNativePaint; + final int nativePaint = paint == null ? 0 : paint.mNativePaint; float left, top, right, bottom; if (src == null) { @@ -884,9 +884,9 @@ class GLES20Canvas extends HardwareCanvas { } } - private static native void nDrawBitmap(long renderer, long bitmap, byte[] buffer, + private static native void nDrawBitmap(int renderer, int bitmap, byte[] buffer, float srcLeft, float srcTop, float srcRight, float srcBottom, - float left, float top, float right, float bottom, long paint); + float left, float top, float right, float bottom, int paint); @Override public void drawBitmap(int[] colors, int offset, int stride, float x, float y, @@ -914,7 +914,7 @@ class GLES20Canvas extends HardwareCanvas { // Shaders are ignored when drawing bitmaps int modifier = paint != null ? setupColorFilter(paint) : MODIFIER_NONE; try { - final long nativePaint = paint == null ? 0 : paint.mNativePaint; + final int nativePaint = paint == null ? 0 : paint.mNativePaint; nDrawBitmap(mRenderer, colors, offset, stride, x, y, width, height, hasAlpha, nativePaint); } finally { @@ -922,8 +922,8 @@ class GLES20Canvas extends HardwareCanvas { } } - private static native void nDrawBitmap(long renderer, int[] colors, int offset, int stride, - float x, float y, int width, int height, boolean hasAlpha, long nativePaint); + private static native void nDrawBitmap(int renderer, int[] colors, int offset, int stride, + float x, float y, int width, int height, boolean hasAlpha, int nativePaint); @Override public void drawBitmap(int[] colors, int offset, int stride, int x, int y, @@ -953,7 +953,7 @@ class GLES20Canvas extends HardwareCanvas { int modifiers = paint != null ? setupModifiers(bitmap, paint) : MODIFIER_NONE; try { - final long nativePaint = paint == null ? 0 : paint.mNativePaint; + final int nativePaint = paint == null ? 0 : paint.mNativePaint; nDrawBitmapMesh(mRenderer, bitmap.mNativeBitmap, bitmap.mBuffer, meshWidth, meshHeight, verts, vertOffset, colors, colorOffset, nativePaint); } finally { @@ -961,9 +961,9 @@ class GLES20Canvas extends HardwareCanvas { } } - private static native void nDrawBitmapMesh(long renderer, long bitmap, byte[] buffer, + private static native void nDrawBitmapMesh(int renderer, int bitmap, byte[] buffer, int meshWidth, int meshHeight, float[] verts, int vertOffset, - int[] colors, int colorOffset, long paint); + int[] colors, int colorOffset, int paint); @Override public void drawCircle(float cx, float cy, float radius, Paint paint) { @@ -975,8 +975,8 @@ class GLES20Canvas extends HardwareCanvas { } } - private static native void nDrawCircle(long renderer, float cx, float cy, - float radius, long paint); + private static native void nDrawCircle(int renderer, float cx, float cy, + float radius, int paint); @Override public void drawColor(int color) { @@ -988,7 +988,7 @@ class GLES20Canvas extends HardwareCanvas { nDrawColor(mRenderer, color, mode.nativeInt); } - private static native void nDrawColor(long renderer, int color, int mode); + private static native void nDrawColor(int renderer, int color, int mode); @Override public void drawLine(float startX, float startY, float stopX, float stopY, Paint paint) { @@ -1015,8 +1015,8 @@ class GLES20Canvas extends HardwareCanvas { } } - private static native void nDrawLines(long renderer, float[] points, - int offset, int count, long paint); + private static native void nDrawLines(int renderer, float[] points, + int offset, int count, int paint); @Override public void drawLines(float[] pts, Paint paint) { @@ -1033,8 +1033,8 @@ class GLES20Canvas extends HardwareCanvas { } } - private static native void nDrawOval(long renderer, float left, float top, - float right, float bottom, long paint); + private static native void nDrawOval(int renderer, float left, float top, + float right, float bottom, int paint); @Override public void drawPaint(Paint paint) { @@ -1059,8 +1059,8 @@ class GLES20Canvas extends HardwareCanvas { } } - private static native void nDrawPath(long renderer, long path, long paint); - private static native void nDrawRects(long renderer, long region, long paint); + private static native void nDrawPath(int renderer, int path, int paint); + private static native void nDrawRects(int renderer, int region, int paint); void drawRects(float[] rects, int count, Paint paint) { int modifiers = setupModifiers(paint, MODIFIER_COLOR_FILTER | MODIFIER_SHADER); @@ -1071,7 +1071,7 @@ class GLES20Canvas extends HardwareCanvas { } } - private static native void nDrawRects(long renderer, float[] rects, int count, long paint); + private static native void nDrawRects(int renderer, float[] rects, int count, int paint); @Override public void drawPicture(Picture picture) { @@ -1138,8 +1138,8 @@ class GLES20Canvas extends HardwareCanvas { } } - private static native void nDrawPoints(long renderer, float[] points, - int offset, int count, long paint); + private static native void nDrawPoints(int renderer, float[] points, + int offset, int count, int paint); @SuppressWarnings("deprecation") @Override @@ -1156,8 +1156,8 @@ class GLES20Canvas extends HardwareCanvas { } } - private static native void nDrawPosText(long renderer, char[] text, int index, int count, - float[] pos, long paint); + private static native void nDrawPosText(int renderer, char[] text, int index, int count, + float[] pos, int paint); @SuppressWarnings("deprecation") @Override @@ -1174,8 +1174,8 @@ class GLES20Canvas extends HardwareCanvas { } } - private static native void nDrawPosText(long renderer, String text, int start, int end, - float[] pos, long paint); + private static native void nDrawPosText(int renderer, String text, int start, int end, + float[] pos, int paint); @Override public void drawRect(float left, float top, float right, float bottom, Paint paint) { @@ -1188,8 +1188,8 @@ class GLES20Canvas extends HardwareCanvas { } } - private static native void nDrawRect(long renderer, float left, float top, - float right, float bottom, long paint); + private static native void nDrawRect(int renderer, float left, float top, + float right, float bottom, int paint); @Override public void drawRect(Rect r, Paint paint) { @@ -1217,8 +1217,8 @@ class GLES20Canvas extends HardwareCanvas { } } - private static native void nDrawRoundRect(long renderer, float left, float top, - float right, float bottom, float rx, float y, long paint); + private static native void nDrawRoundRect(int renderer, float left, float top, + float right, float bottom, float rx, float y, int paint); @Override public void drawText(char[] text, int index, int count, float x, float y, Paint paint) { @@ -1234,8 +1234,8 @@ class GLES20Canvas extends HardwareCanvas { } } - private static native void nDrawText(long renderer, char[] text, int index, int count, - float x, float y, int bidiFlags, long paint); + private static native void nDrawText(int renderer, char[] text, int index, int count, + float x, float y, int bidiFlags, int paint); @Override public void drawText(CharSequence text, int start, int end, float x, float y, Paint paint) { @@ -1274,8 +1274,8 @@ class GLES20Canvas extends HardwareCanvas { } } - private static native void nDrawText(long renderer, String text, int start, int end, - float x, float y, int bidiFlags, long paint); + private static native void nDrawText(int renderer, String text, int start, int end, + float x, float y, int bidiFlags, int paint); @Override public void drawText(String text, float x, float y, Paint paint) { @@ -1304,8 +1304,8 @@ class GLES20Canvas extends HardwareCanvas { } } - private static native void nDrawTextOnPath(long renderer, char[] text, int index, int count, - long path, float hOffset, float vOffset, int bidiFlags, long nativePaint); + private static native void nDrawTextOnPath(int renderer, char[] text, int index, int count, + int path, float hOffset, float vOffset, int bidiFlags, int nativePaint); @Override public void drawTextOnPath(String text, Path path, float hOffset, float vOffset, Paint paint) { @@ -1320,8 +1320,8 @@ class GLES20Canvas extends HardwareCanvas { } } - private static native void nDrawTextOnPath(long renderer, String text, int start, int end, - long path, float hOffset, float vOffset, int bidiFlags, long nativePaint); + private static native void nDrawTextOnPath(int renderer, String text, int start, int end, + int path, float hOffset, float vOffset, int bidiFlags, int nativePaint); @Override public void drawTextRun(char[] text, int index, int count, int contextIndex, int contextCount, @@ -1342,8 +1342,8 @@ class GLES20Canvas extends HardwareCanvas { } } - private static native void nDrawTextRun(long renderer, char[] text, int index, int count, - int contextIndex, int contextCount, float x, float y, int dir, long nativePaint); + private static native void nDrawTextRun(int renderer, char[] text, int index, int count, + int contextIndex, int contextCount, float x, float y, int dir, int nativePaint); @Override public void drawTextRun(CharSequence text, int start, int end, int contextStart, int contextEnd, @@ -1376,8 +1376,8 @@ class GLES20Canvas extends HardwareCanvas { } } - private static native void nDrawTextRun(long renderer, String text, int start, int end, - int contextStart, int contextEnd, float x, float y, int flags, long nativePaint); + private static native void nDrawTextRun(int renderer, String text, int start, int end, + int contextStart, int contextEnd, float x, float y, int flags, int nativePaint); @Override public void drawVertices(VertexMode mode, int vertexCount, float[] verts, int vertOffset, @@ -1457,10 +1457,10 @@ class GLES20Canvas extends HardwareCanvas { return MODIFIER_NONE; } - private static native void nSetupShader(long renderer, long shader); - private static native void nSetupColorFilter(long renderer, long colorFilter); - private static native void nSetupShadow(long renderer, float radius, + private static native void nSetupShader(int renderer, int shader); + private static native void nSetupColorFilter(int renderer, int colorFilter); + private static native void nSetupShadow(int renderer, float radius, float dx, float dy, int color); - private static native void nResetModifiers(long renderer, int modifiers); + private static native void nResetModifiers(int renderer, int modifiers); } diff --git a/core/java/android/view/GLES20Layer.java b/core/java/android/view/GLES20Layer.java index 37154eb..0e3311c 100644 --- a/core/java/android/view/GLES20Layer.java +++ b/core/java/android/view/GLES20Layer.java @@ -24,7 +24,7 @@ import android.graphics.Paint; * An OpenGL ES 2.0 implementation of {@link HardwareLayer}. */ abstract class GLES20Layer extends HardwareLayer { - long mLayer; + int mLayer; Finalizer mFinalizer; GLES20Layer() { @@ -39,7 +39,7 @@ abstract class GLES20Layer extends HardwareLayer { * * @return A pointer to the native layer object, or 0 if the object is NULL */ - public long getLayer() { + public int getLayer() { return mLayer; } @@ -75,9 +75,9 @@ abstract class GLES20Layer extends HardwareLayer { } static class Finalizer { - private long mLayerId; + private int mLayerId; - public Finalizer(long layerId) { + public Finalizer(int layerId) { mLayerId = layerId; } diff --git a/core/java/android/view/GLES20RecordingCanvas.java b/core/java/android/view/GLES20RecordingCanvas.java index b7b6883..97efa18 100644 --- a/core/java/android/view/GLES20RecordingCanvas.java +++ b/core/java/android/view/GLES20RecordingCanvas.java @@ -58,7 +58,7 @@ class GLES20RecordingCanvas extends GLES20Canvas { mDisplayList.clearReferences(); } - long end(long nativeDisplayList) { + int end(int nativeDisplayList) { return getDisplayList(nativeDisplayList); } diff --git a/core/java/android/view/GLRenderer.java b/core/java/android/view/GLRenderer.java index 7524d07..1811111 100644 --- a/core/java/android/view/GLRenderer.java +++ b/core/java/android/view/GLRenderer.java @@ -1406,14 +1406,14 @@ public class GLRenderer extends HardwareRenderer { } @Override - void detachFunctor(long functor) { + void detachFunctor(int functor) { if (mCanvas != null) { mCanvas.detachFunctor(functor); } } @Override - boolean attachFunctor(View.AttachInfo attachInfo, long functor) { + boolean attachFunctor(View.AttachInfo attachInfo, int functor) { if (mCanvas != null) { mCanvas.attachFunctor(functor); mFunctorsRunnable.attachInfo = attachInfo; diff --git a/core/java/android/view/GraphicBuffer.java b/core/java/android/view/GraphicBuffer.java index 5f2a9cd..30c077c 100644 --- a/core/java/android/view/GraphicBuffer.java +++ b/core/java/android/view/GraphicBuffer.java @@ -56,7 +56,7 @@ public class GraphicBuffer implements Parcelable { private final int mFormat; private final int mUsage; // Note: do not rename, this field is used by native code - private final long mNativeObject; + private final int mNativeObject; // These two fields are only used by lock/unlockCanvas() private Canvas mCanvas; @@ -77,7 +77,7 @@ public class GraphicBuffer implements Parcelable { * @return A <code>GraphicBuffer</code> instance or null */ public static GraphicBuffer create(int width, int height, int format, int usage) { - long nativeObject = nCreateGraphicBuffer(width, height, format, usage); + int nativeObject = nCreateGraphicBuffer(width, height, format, usage); if (nativeObject != 0) { return new GraphicBuffer(width, height, format, usage, nativeObject); } @@ -87,7 +87,7 @@ public class GraphicBuffer implements Parcelable { /** * Private use only. See {@link #create(int, int, int, int)}. */ - private GraphicBuffer(int width, int height, int format, int usage, long nativeObject) { + private GraphicBuffer(int width, int height, int format, int usage, int nativeObject) { mWidth = width; mHeight = height; mFormat = format; @@ -271,7 +271,7 @@ public class GraphicBuffer implements Parcelable { int height = in.readInt(); int format = in.readInt(); int usage = in.readInt(); - long nativeObject = nReadGraphicBufferFromParcel(in); + int nativeObject = nReadGraphicBufferFromParcel(in); if (nativeObject != 0) { return new GraphicBuffer(width, height, format, usage, nativeObject); } @@ -283,10 +283,10 @@ public class GraphicBuffer implements Parcelable { } }; - private static native long nCreateGraphicBuffer(int width, int height, int format, int usage); - private static native void nDestroyGraphicBuffer(long nativeObject); - private static native void nWriteGraphicBufferToParcel(long nativeObject, Parcel dest); - private static native long nReadGraphicBufferFromParcel(Parcel in); - private static native boolean nLockCanvas(long nativeObject, Canvas canvas, Rect dirty); - private static native boolean nUnlockCanvasAndPost(long nativeObject, Canvas canvas); + private static native int nCreateGraphicBuffer(int width, int height, int format, int usage); + private static native void nDestroyGraphicBuffer(int nativeObject); + private static native void nWriteGraphicBufferToParcel(int nativeObject, Parcel dest); + private static native int nReadGraphicBufferFromParcel(Parcel in); + private static native boolean nLockCanvas(int nativeObject, Canvas canvas, Rect dirty); + private static native boolean nUnlockCanvasAndPost(int nativeObject, Canvas canvas); } diff --git a/core/java/android/view/HardwareCanvas.java b/core/java/android/view/HardwareCanvas.java index a3c7b63..2e972c5 100644 --- a/core/java/android/view/HardwareCanvas.java +++ b/core/java/android/view/HardwareCanvas.java @@ -107,7 +107,7 @@ public abstract class HardwareCanvas extends Canvas { * * @hide */ - public int callDrawGLFunction(long drawGLFunction) { + public int callDrawGLFunction(int drawGLFunction) { // Noop - this is done in the display list recorder subclass return DisplayList.STATUS_DONE; } @@ -132,12 +132,12 @@ public abstract class HardwareCanvas extends Canvas { * @param functor The native functor to remove from the execution queue. * * @see #invokeFunctors(android.graphics.Rect) - * @see #callDrawGLFunction(long) - * @see #detachFunctor(long) + * @see #callDrawGLFunction(int) + * @see #detachFunctor(int) * * @hide */ - abstract void detachFunctor(long functor); + abstract void detachFunctor(int functor); /** * Attaches the specified functor to the current functor execution queue. @@ -145,12 +145,12 @@ public abstract class HardwareCanvas extends Canvas { * @param functor The native functor to add to the execution queue. * * @see #invokeFunctors(android.graphics.Rect) - * @see #callDrawGLFunction(long) - * @see #detachFunctor(long) + * @see #callDrawGLFunction(int) + * @see #detachFunctor(int) * * @hide */ - abstract void attachFunctor(long functor); + abstract void attachFunctor(int functor); /** * Indicates that the specified layer must be updated as soon as possible. diff --git a/core/java/android/view/HardwareRenderer.java b/core/java/android/view/HardwareRenderer.java index 995793c..ac728f1 100644 --- a/core/java/android/view/HardwareRenderer.java +++ b/core/java/android/view/HardwareRenderer.java @@ -453,9 +453,9 @@ public abstract class HardwareRenderer { * @param functor The native functor to remove from the execution queue. * * @see HardwareCanvas#callDrawGLFunction(int) - * @see #attachFunctor(android.view.View.AttachInfo, long) + * @see #attachFunctor(android.view.View.AttachInfo, int) */ - abstract void detachFunctor(long functor); + abstract void detachFunctor(int functor); /** * Schedules the specified functor in the functors execution queue. @@ -464,11 +464,11 @@ public abstract class HardwareRenderer { * @param functor The native functor to insert in the execution queue. * * @see HardwareCanvas#callDrawGLFunction(int) - * @see #detachFunctor(long) + * @see #detachFunctor(int) * * @return true if the functor was attached successfully */ - abstract boolean attachFunctor(View.AttachInfo attachInfo, long functor); + abstract boolean attachFunctor(View.AttachInfo attachInfo, int functor); /** * Initializes the hardware renderer for the specified surface and setup the diff --git a/core/java/android/view/RemoteGLRenderer.java b/core/java/android/view/RemoteGLRenderer.java index 2e7a467..2919775 100644 --- a/core/java/android/view/RemoteGLRenderer.java +++ b/core/java/android/view/RemoteGLRenderer.java @@ -938,14 +938,14 @@ public class RemoteGLRenderer extends HardwareRenderer { } @Override - void detachFunctor(long functor) { + void detachFunctor(int functor) { if (mCanvas != null) { mCanvas.detachFunctor(functor); } } @Override - boolean attachFunctor(View.AttachInfo attachInfo, long functor) { + boolean attachFunctor(View.AttachInfo attachInfo, int functor) { if (mCanvas != null) { mCanvas.attachFunctor(functor); mFunctorsRunnable.attachInfo = attachInfo; diff --git a/core/java/android/view/Surface.java b/core/java/android/view/Surface.java index fdaae01..a2775d4 100644 --- a/core/java/android/view/Surface.java +++ b/core/java/android/view/Surface.java @@ -37,19 +37,19 @@ import dalvik.system.CloseGuard; public class Surface implements Parcelable { private static final String TAG = "Surface"; - private static native long nativeCreateFromSurfaceTexture(SurfaceTexture surfaceTexture) + private static native int nativeCreateFromSurfaceTexture(SurfaceTexture surfaceTexture) throws OutOfResourcesException; - private static native long nativeCreateFromSurfaceControl(long surfaceControlNativeObject); + private static native int nativeCreateFromSurfaceControl(int surfaceControlNativeObject); - private static native long nativeLockCanvas(long nativeObject, Canvas canvas, Rect dirty) + private static native int nativeLockCanvas(int nativeObject, Canvas canvas, Rect dirty) throws OutOfResourcesException; - private static native void nativeUnlockCanvasAndPost(long nativeObject, Canvas canvas); + private static native void nativeUnlockCanvasAndPost(int nativeObject, Canvas canvas); - private static native void nativeRelease(long nativeObject); - private static native boolean nativeIsValid(long nativeObject); - private static native boolean nativeIsConsumerRunningBehind(long nativeObject); - private static native long nativeReadFromParcel(long nativeObject, Parcel source); - private static native void nativeWriteToParcel(long nativeObject, Parcel dest); + private static native void nativeRelease(int nativeObject); + private static native boolean nativeIsValid(int nativeObject); + private static native boolean nativeIsConsumerRunningBehind(int nativeObject); + private static native int nativeReadFromParcel(int nativeObject, Parcel source); + private static native void nativeWriteToParcel(int nativeObject, Parcel dest); public static final Parcelable.Creator<Surface> CREATOR = new Parcelable.Creator<Surface>() { @@ -76,8 +76,8 @@ public class Surface implements Parcelable { // Guarded state. final Object mLock = new Object(); // protects the native state private String mName; - long mNativeObject; // package scope only for SurfaceControl access - private long mLockedObject; + int mNativeObject; // package scope only for SurfaceControl access + private int mLockedObject; private int mGenerationId; // incremented each time mNativeObject changes private final Canvas mCanvas = new CompatibleCanvas(); @@ -140,7 +140,7 @@ public class Surface implements Parcelable { } /* called from android_view_Surface_createFromIGraphicBufferProducer() */ - private Surface(long nativeObject) { + private Surface(int nativeObject) { synchronized (mLock) { setNativeObjectLocked(nativeObject); } @@ -271,8 +271,8 @@ public class Surface implements Parcelable { checkNotReleasedLocked(); if (mNativeObject != mLockedObject) { Log.w(TAG, "WARNING: Surface's mNativeObject (0x" + - Long.toHexString(mNativeObject) + ") != mLockedObject (0x" + - Long.toHexString(mLockedObject) +")"); + Integer.toHexString(mNativeObject) + ") != mLockedObject (0x" + + Integer.toHexString(mLockedObject) +")"); } if (mLockedObject == 0) { throw new IllegalStateException("Surface was not locked"); @@ -317,12 +317,12 @@ public class Surface implements Parcelable { throw new IllegalArgumentException("other must not be null"); } - long surfaceControlPtr = other.mNativeObject; + int surfaceControlPtr = other.mNativeObject; if (surfaceControlPtr == 0) { throw new NullPointerException( "SurfaceControl native object is null. Are you using a released SurfaceControl?"); } - long newNativeObject = nativeCreateFromSurfaceControl(surfaceControlPtr); + int newNativeObject = nativeCreateFromSurfaceControl(surfaceControlPtr); synchronized (mLock) { if (mNativeObject != 0) { @@ -344,7 +344,7 @@ public class Surface implements Parcelable { throw new IllegalArgumentException("other must not be null"); } if (other != this) { - final long newPtr; + final int newPtr; synchronized (other.mLock) { newPtr = other.mNativeObject; other.setNativeObjectLocked(0); @@ -401,7 +401,7 @@ public class Surface implements Parcelable { } } - private void setNativeObjectLocked(long ptr) { + private void setNativeObjectLocked(int ptr) { if (mNativeObject != ptr) { if (mNativeObject == 0 && ptr != 0) { mCloseGuard.open("release"); diff --git a/core/java/android/view/SurfaceControl.java b/core/java/android/view/SurfaceControl.java index a6f856c..914a5ca 100644 --- a/core/java/android/view/SurfaceControl.java +++ b/core/java/android/view/SurfaceControl.java @@ -32,11 +32,11 @@ import android.view.Surface.OutOfResourcesException; public class SurfaceControl { private static final String TAG = "SurfaceControl"; - private static native long nativeCreate(SurfaceSession session, String name, + private static native int nativeCreate(SurfaceSession session, String name, int w, int h, int format, int flags) throws OutOfResourcesException; - private static native void nativeRelease(long nativeObject); - private static native void nativeDestroy(long nativeObject); + private static native void nativeRelease(int nativeObject); + private static native void nativeDestroy(int nativeObject); private static native Bitmap nativeScreenshot(IBinder displayToken, int width, int height, int minLayer, int maxLayer, boolean allLayers); @@ -47,21 +47,21 @@ public class SurfaceControl { private static native void nativeCloseTransaction(); private static native void nativeSetAnimationTransaction(); - private static native void nativeSetLayer(long nativeObject, int zorder); - private static native void nativeSetPosition(long nativeObject, float x, float y); - private static native void nativeSetSize(long nativeObject, int w, int h); - private static native void nativeSetTransparentRegionHint(long nativeObject, Region region); - private static native void nativeSetAlpha(long nativeObject, float alpha); - private static native void nativeSetMatrix(long nativeObject, float dsdx, float dtdx, float dsdy, float dtdy); - private static native void nativeSetFlags(long nativeObject, int flags, int mask); - private static native void nativeSetWindowCrop(long nativeObject, int l, int t, int r, int b); - private static native void nativeSetLayerStack(long nativeObject, int layerStack); + private static native void nativeSetLayer(int nativeObject, int zorder); + private static native void nativeSetPosition(int nativeObject, float x, float y); + private static native void nativeSetSize(int nativeObject, int w, int h); + private static native void nativeSetTransparentRegionHint(int nativeObject, Region region); + private static native void nativeSetAlpha(int nativeObject, float alpha); + private static native void nativeSetMatrix(int nativeObject, float dsdx, float dtdx, float dsdy, float dtdy); + private static native void nativeSetFlags(int nativeObject, int flags, int mask); + private static native void nativeSetWindowCrop(int nativeObject, int l, int t, int r, int b); + private static native void nativeSetLayerStack(int nativeObject, int layerStack); private static native IBinder nativeGetBuiltInDisplay(int physicalDisplayId); private static native IBinder nativeCreateDisplay(String name, boolean secure); private static native void nativeDestroyDisplay(IBinder displayToken); private static native void nativeSetDisplaySurface( - IBinder displayToken, long nativeSurfaceObject); + IBinder displayToken, int nativeSurfaceObject); private static native void nativeSetDisplayLayerStack( IBinder displayToken, int layerStack); private static native void nativeSetDisplayProjection( @@ -76,7 +76,7 @@ public class SurfaceControl { private final CloseGuard mCloseGuard = CloseGuard.get(); private final String mName; - long mNativeObject; // package visibility only for Surface.java access + int mNativeObject; // package visibility only for Surface.java access /* flags used in constructor (keep in sync with ISurfaceComposerClient.h) */ diff --git a/core/java/android/view/TextureView.java b/core/java/android/view/TextureView.java index 161fe33..bf81811 100644 --- a/core/java/android/view/TextureView.java +++ b/core/java/android/view/TextureView.java @@ -127,7 +127,7 @@ public class TextureView extends View { private final Object[] mNativeWindowLock = new Object[0]; // Used from native code, do not write! @SuppressWarnings({"UnusedDeclaration"}) - private long mNativeWindow; + private int mNativeWindow; /** * Creates a new TextureView. @@ -834,6 +834,6 @@ public class TextureView extends View { private native void nCreateNativeWindow(SurfaceTexture surface); private native void nDestroyNativeWindow(); - private static native boolean nLockCanvas(long nativeWindow, Canvas canvas, Rect dirty); - private static native void nUnlockCanvasAndPost(long nativeWindow, Canvas canvas); + private static native boolean nLockCanvas(int nativeWindow, Canvas canvas, Rect dirty); + private static native void nUnlockCanvasAndPost(int nativeWindow, Canvas canvas); } diff --git a/core/java/android/view/ThreadedRenderer.java b/core/java/android/view/ThreadedRenderer.java index 4ceb311..2cd1b6e 100644 --- a/core/java/android/view/ThreadedRenderer.java +++ b/core/java/android/view/ThreadedRenderer.java @@ -227,12 +227,12 @@ public class ThreadedRenderer extends HardwareRenderer { } @Override - void detachFunctor(long functor) { + void detachFunctor(int functor) { run("detachFunctor", functor); } @Override - boolean attachFunctor(AttachInfo attachInfo, long functor) { + boolean attachFunctor(AttachInfo attachInfo, int functor) { return (Boolean) run("attachFunctor", attachInfo, functor); } |