Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 71fae62f authored by Leon Scroggins III's avatar Leon Scroggins III
Browse files

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
parent ca8aef63
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment