Loading core/jni/android/graphics/Graphics.cpp +7 −3 Original line number Diff line number Diff line Loading @@ -473,16 +473,20 @@ void AndroidPixelRef::setLocalJNIRef(jbyteArray arr) { } } void AndroidPixelRef::globalRef() { void AndroidPixelRef::globalRef(void* localref) { if (fOnJavaHeap && sk_atomic_inc(&fGlobalRefCnt) == 0) { JNIEnv *env = vm2env(fVM); // If JNI ref was passed, it is always used if (localref) fStorageObj = (jbyteArray) localref; if (fStorageObj == NULL) { SkDebugf("Cannot create a global ref, fStorage obj is NULL"); SkDebugf("No valid local ref to create a JNI global ref\n"); sk_throw(); } if (fHasGlobalRef) { // This should never happen SkDebugf("Already holding a global ref"); SkDebugf("Already holding a JNI global ref"); sk_throw(); } Loading core/jni/android/graphics/GraphicsJNI.h +10 −1 Original line number Diff line number Diff line Loading @@ -92,7 +92,16 @@ public: void setLocalJNIRef(jbyteArray arr); virtual void globalRef(); /** Used to hold a ref to the pixels when the Java bitmap may be collected. * If specified, 'localref' is a valid JNI local reference to the byte array * containing the pixel data. * * 'localref' may only be NULL if setLocalJNIRef() was already called with * a JNI local ref that is still valid. */ virtual void globalRef(void* localref=NULL); /** Release a ref that was acquired using globalRef(). */ virtual void globalUnref(); private: Loading Loading
core/jni/android/graphics/Graphics.cpp +7 −3 Original line number Diff line number Diff line Loading @@ -473,16 +473,20 @@ void AndroidPixelRef::setLocalJNIRef(jbyteArray arr) { } } void AndroidPixelRef::globalRef() { void AndroidPixelRef::globalRef(void* localref) { if (fOnJavaHeap && sk_atomic_inc(&fGlobalRefCnt) == 0) { JNIEnv *env = vm2env(fVM); // If JNI ref was passed, it is always used if (localref) fStorageObj = (jbyteArray) localref; if (fStorageObj == NULL) { SkDebugf("Cannot create a global ref, fStorage obj is NULL"); SkDebugf("No valid local ref to create a JNI global ref\n"); sk_throw(); } if (fHasGlobalRef) { // This should never happen SkDebugf("Already holding a global ref"); SkDebugf("Already holding a JNI global ref"); sk_throw(); } Loading
core/jni/android/graphics/GraphicsJNI.h +10 −1 Original line number Diff line number Diff line Loading @@ -92,7 +92,16 @@ public: void setLocalJNIRef(jbyteArray arr); virtual void globalRef(); /** Used to hold a ref to the pixels when the Java bitmap may be collected. * If specified, 'localref' is a valid JNI local reference to the byte array * containing the pixel data. * * 'localref' may only be NULL if setLocalJNIRef() was already called with * a JNI local ref that is still valid. */ virtual void globalRef(void* localref=NULL); /** Release a ref that was acquired using globalRef(). */ virtual void globalUnref(); private: Loading