diff options
author | Leon Scroggins III <scroggo@google.com> | 2019-03-26 16:28:41 -0400 |
---|---|---|
committer | Leon Scroggins III <scroggo@google.com> | 2019-03-27 13:39:23 -0400 |
commit | 71fae62f5fe03e9f8453ac3880587567ffcf9be6 (patch) | |
tree | 2d6c009c2e34eaebd050506048406dd1876a9f02 /tools/aapt2/java/JavaClassGenerator_test.cpp | |
parent | ca8aef63766b3193464b8f9b4cde45324a83789a (diff) |
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
Diffstat (limited to 'tools/aapt2/java/JavaClassGenerator_test.cpp')
0 files changed, 0 insertions, 0 deletions