1. #include <android/bitmap.h> affirms three functions related to bitmap and pixel operations:
File location:./frameworks/native/include/android/bitmap.h
(1) Int androidbitmap_getinfo (jnienv* env, jobject jbitmap,androidbitmapinfo* info);
The bitmap object transferred from the upper layer is transformed into a native structure information androidbitmapinfo
(2) int androidbitmap_lockpixels (jnienv* env, Jobject Jbitmap, void** addrptr);
Locks the bitmap object's pixels in the memory address of the upper layer, ensuring that the memory does not change until it is unlocked.
(3) int androidbitmap_unlockpixels (jnienv* env, Jobject jbitmap);
Called when the pixel operation is complete
2. Bitmap.cpp implements these three functions, the implementation uses the Skia library, generates a library file, the upper layer uses three functions need to reference this library file.
File Location:
./frameworks/base/native/graphics/jni/bitmap.cpp
./frameworks/base/native/graphics/jni/android.mk
Generated
local_module:= Libjnigraphics
Include $ (build_shared_library)
(1) How to use the bitmap object passed by the upper layer of Android