Pass Bitmap's native instance to JNI where feasible
Test: CtsGraphicsTestCases, CtsUiRenderingTestCases, CtsRenderscriptTestCases This is significantly faster than passing the Java object down and then calling a JNI method to retrieve the pointer. See https://buganizer.corp.google.com/issues/16656908#comment19 In some cases this changes what used to be native crashes (due to android::BitmapWrapper:assertValid's LOG_ALWAYS_FATAL_IF) into NullPointerExceptions (if a caller used a null Bitmap). In addition: - Remove unnecessary JNIEnv param from toBitmap(jlong) - Change instances of toBitmap(JNIEnv*, jobject) to the above - Replace calls to GraphicsJNI::getSkBitmap() to inline calls to toBitmap/getSkBitmap - make Canvas#nInitRaster @FastNative (FIXME: Could these be @CriticalNative?) Change-Id: I6194097be1b6e6952eba70e1e7052a5a250eed93
Loading
Please register or sign in to comment