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

Commit 8026b2ce authored by Brian Carlstrom's avatar Brian Carlstrom Committed by Gerrit Code Review
Browse files

Merge "Use exceptionCheck after VMRuntime.newNonMovableArray/addressOf."

parents 2e12e052 a1a19d28
Loading
Loading
Loading
Loading
+13 −9
Original line number Diff line number Diff line
@@ -547,16 +547,20 @@ jbyteArray GraphicsJNI::allocateJavaPixelRef(JNIEnv* env, SkBitmap* bitmap,
    jbyteArray arrayObj = (jbyteArray) env->CallObjectMethod(gVMRuntime,
                                                             gVMRuntime_newNonMovableArray,
                                                             gByte_class, size);
    if (arrayObj) {
    if (env->ExceptionCheck() != 0) {
        return NULL;
    }
    SkASSERT(arrayObj);
    jbyte* addr = (jbyte*) env->CallLongMethod(gVMRuntime, gVMRuntime_addressOf, arrayObj);
        if (addr) {
    if (env->ExceptionCheck() != 0) {
        return NULL;
    }
    SkASSERT(addr);
    SkPixelRef* pr = new AndroidPixelRef(env, (void*) addr, size, arrayObj, ctable);
    bitmap->setPixelRef(pr)->unref();
    // since we're already allocated, we lockPixels right away
    // HeapAllocator behaves this way too
    bitmap->lockPixels();
        }
    }

    return arrayObj;
}