Hidden method to get a graphic buffer from a hardware bitmap

Test: locally tested Bitmap.getGraphicBuffer()
bug:30999911
Change-Id: I68d56d769045bada6a5db90ed884a570c49be4fd
This commit is contained in:
sergeyv
2017-01-04 16:57:51 -08:00
parent 0a0f23163a
commit 6e3658a638
4 changed files with 44 additions and 6 deletions

View File

@ -1746,6 +1746,15 @@ public final class Bitmap implements Parcelable {
nativePrepareToDraw(mNativePtr);
}
/**
*
* @return {@link GraphicBuffer} which is internally used by hardware bitmap
* @hide
*/
public GraphicBuffer createGraphicBufferHandle() {
return nativeCreateGraphicBufferHandle(mNativePtr);
}
//////////// native methods
private static native Bitmap nativeCreate(int[] colors, int offset,
@ -1806,4 +1815,5 @@ public final class Bitmap implements Parcelable {
private static native int nativeGetAllocationByteCount(long nativeBitmap);
private static native Bitmap nativeCopyPreserveInternalConfig(long nativeBitmap);
private static native Bitmap nativeCreateHardwareBitmap(GraphicBuffer buffer);
private static native GraphicBuffer nativeCreateGraphicBufferHandle(long nativeBitmap);
}