Loading core/jni/android_graphics_BLASTBufferQueue.cpp +24 −23 Original line number Diff line number Diff line Loading @@ -13,7 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ #undef ANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION // TODO:remove this and fix code #define LOG_TAG "BLASTBufferQueue" Loading Loading @@ -131,13 +130,13 @@ static jlong nativeCreate(JNIEnv* env, jclass clazz, jstring jName, } static void nativeDestroy(JNIEnv* env, jclass clazz, jlong ptr) { sp<BLASTBufferQueue> queue = reinterpret_cast<BLASTBufferQueue*>(ptr); auto queue = reinterpret_cast<BLASTBufferQueue*>(ptr); queue->decStrong((void*)nativeCreate); } static jobject nativeGetSurface(JNIEnv* env, jclass clazz, jlong ptr, jboolean includeSurfaceControlHandle) { sp<BLASTBufferQueue> queue = reinterpret_cast<BLASTBufferQueue*>(ptr); auto queue = reinterpret_cast<BLASTBufferQueue*>(ptr); return android_view_Surface_createFromSurface(env, queue->getSurface(includeSurfaceControlHandle)); } Loading Loading @@ -166,7 +165,7 @@ static bool nativeSyncNextTransaction(JNIEnv* env, jclass clazz, jlong ptr, jobj jboolean acquireSingleBuffer) { LOG_ALWAYS_FATAL_IF(!callback, "callback passed in to syncNextTransaction must not be NULL"); sp<BLASTBufferQueue> queue = reinterpret_cast<BLASTBufferQueue*>(ptr); auto queue = reinterpret_cast<BLASTBufferQueue*>(ptr); JavaVM* vm = nullptr; LOG_ALWAYS_FATAL_IF(env->GetJavaVM(&vm) != JNI_OK, "Unable to get Java VM"); Loading @@ -186,51 +185,53 @@ static bool nativeSyncNextTransaction(JNIEnv* env, jclass clazz, jlong ptr, jobj } static void nativeStopContinuousSyncTransaction(JNIEnv* env, jclass clazz, jlong ptr) { sp<BLASTBufferQueue> queue = reinterpret_cast<BLASTBufferQueue*>(ptr); auto queue = reinterpret_cast<BLASTBufferQueue*>(ptr); queue->stopContinuousSyncTransaction(); } static void nativeClearSyncTransaction(JNIEnv* env, jclass clazz, jlong ptr) { sp<BLASTBufferQueue> queue = reinterpret_cast<BLASTBufferQueue*>(ptr); auto queue = reinterpret_cast<BLASTBufferQueue*>(ptr); queue->clearSyncTransaction(); } static void nativeUpdate(JNIEnv* env, jclass clazz, jlong ptr, jlong surfaceControl, jlong width, static void nativeUpdate(JNIEnv* env, jclass clazz, jlong ptr, jlong surfaceControlPtr, jlong width, jlong height, jint format) { sp<BLASTBufferQueue> queue = reinterpret_cast<BLASTBufferQueue*>(ptr); queue->update(reinterpret_cast<SurfaceControl*>(surfaceControl), width, height, format); auto queue = reinterpret_cast<BLASTBufferQueue*>(ptr); auto surfaceControl = SpFromRawPtr<SurfaceControl>(surfaceControlPtr); queue->update(surfaceControl, width, height, format); } static void nativeMergeWithNextTransaction(JNIEnv*, jclass clazz, jlong ptr, jlong transactionPtr, jlong framenumber) { sp<BLASTBufferQueue> queue = reinterpret_cast<BLASTBufferQueue*>(ptr); auto queue = reinterpret_cast<BLASTBufferQueue*>(ptr); auto transaction = reinterpret_cast<SurfaceComposerClient::Transaction*>(transactionPtr); queue->mergeWithNextTransaction(transaction, CC_UNLIKELY(framenumber < 0) ? 0 : framenumber); } static jlong nativeGetLastAcquiredFrameNum(JNIEnv* env, jclass clazz, jlong ptr) { sp<BLASTBufferQueue> queue = reinterpret_cast<BLASTBufferQueue*>(ptr); auto queue = reinterpret_cast<BLASTBufferQueue*>(ptr); return queue->getLastAcquiredFrameNum(); } static void nativeApplyPendingTransactions(JNIEnv* env, jclass clazz, jlong ptr, jlong frameNum) { sp<BLASTBufferQueue> queue = reinterpret_cast<BLASTBufferQueue*>(ptr); auto queue = reinterpret_cast<BLASTBufferQueue*>(ptr); queue->applyPendingTransactions(frameNum); } static bool nativeIsSameSurfaceControl(JNIEnv* env, jclass clazz, jlong ptr, jlong surfaceControl) { sp<BLASTBufferQueue> queue = reinterpret_cast<BLASTBufferQueue*>(ptr); return queue->isSameSurfaceControl(reinterpret_cast<SurfaceControl*>(surfaceControl)); static bool nativeIsSameSurfaceControl(JNIEnv* env, jclass clazz, jlong ptr, jlong surfaceControlPtr) { auto queue = reinterpret_cast<BLASTBufferQueue*>(ptr); auto surfaceControl = SpFromRawPtr<SurfaceControl>(surfaceControlPtr); return queue->isSameSurfaceControl(surfaceControl); } static void nativeSetTransactionHangCallback(JNIEnv* env, jclass clazz, jlong ptr, jobject transactionHangCallback) { sp<BLASTBufferQueue> queue = reinterpret_cast<BLASTBufferQueue*>(ptr); auto queue = reinterpret_cast<BLASTBufferQueue*>(ptr); if (transactionHangCallback == nullptr) { queue->setTransactionHangCallback(nullptr); } else { sp<TransactionHangCallbackWrapper> wrapper = new TransactionHangCallbackWrapper{env, transactionHangCallback}; auto wrapper = sp<TransactionHangCallbackWrapper>::make(env, transactionHangCallback); queue->setTransactionHangCallback( [wrapper](const std::string& reason) { wrapper->onTransactionHang(reason); }); } Loading @@ -238,26 +239,26 @@ static void nativeSetTransactionHangCallback(JNIEnv* env, jclass clazz, jlong pt static jobject nativeGatherPendingTransactions(JNIEnv* env, jclass clazz, jlong ptr, jlong frameNum) { sp<BLASTBufferQueue> queue = reinterpret_cast<BLASTBufferQueue*>(ptr); auto queue = reinterpret_cast<BLASTBufferQueue*>(ptr); SurfaceComposerClient::Transaction* transaction = queue->gatherPendingTransactions(frameNum); return env->NewObject(gTransactionClassInfo.clazz, gTransactionClassInfo.ctor, reinterpret_cast<jlong>(transaction)); } static void nativeSetApplyToken(JNIEnv* env, jclass clazz, jlong ptr, jobject applyTokenObject) { sp<BLASTBufferQueue> queue = reinterpret_cast<BLASTBufferQueue*>(ptr); auto queue = reinterpret_cast<BLASTBufferQueue*>(ptr); sp<IBinder> token(ibinderForJavaObject(env, applyTokenObject)); return queue->setApplyToken(std::move(token)); } static void nativeSetWaitForBufferReleaseCallback(JNIEnv* env, jclass clazz, jlong ptr, jobject waitForBufferReleaseCallback) { sp<BLASTBufferQueue> queue = reinterpret_cast<BLASTBufferQueue*>(ptr); auto queue = reinterpret_cast<BLASTBufferQueue*>(ptr); if (waitForBufferReleaseCallback == nullptr) { queue->setWaitForBufferReleaseCallback(nullptr); } else { sp<WaitForBufferReleaseCallbackWrapper> wrapper = new WaitForBufferReleaseCallbackWrapper{env, waitForBufferReleaseCallback}; auto wrapper = sp<WaitForBufferReleaseCallbackWrapper>::make(env, waitForBufferReleaseCallback); queue->setWaitForBufferReleaseCallback([wrapper](const nsecs_t durationNanos) { wrapper->onWaitForBufferRelease(durationNanos); }); Loading core/jni/android_hardware_input_InputWindowHandle.cpp +0 −1 Original line number Diff line number Diff line Loading @@ -13,7 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ #undef ANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION // TODO:remove this and fix code #define LOG_TAG "InputWindowHandle" Loading Loading
core/jni/android_graphics_BLASTBufferQueue.cpp +24 −23 Original line number Diff line number Diff line Loading @@ -13,7 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ #undef ANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION // TODO:remove this and fix code #define LOG_TAG "BLASTBufferQueue" Loading Loading @@ -131,13 +130,13 @@ static jlong nativeCreate(JNIEnv* env, jclass clazz, jstring jName, } static void nativeDestroy(JNIEnv* env, jclass clazz, jlong ptr) { sp<BLASTBufferQueue> queue = reinterpret_cast<BLASTBufferQueue*>(ptr); auto queue = reinterpret_cast<BLASTBufferQueue*>(ptr); queue->decStrong((void*)nativeCreate); } static jobject nativeGetSurface(JNIEnv* env, jclass clazz, jlong ptr, jboolean includeSurfaceControlHandle) { sp<BLASTBufferQueue> queue = reinterpret_cast<BLASTBufferQueue*>(ptr); auto queue = reinterpret_cast<BLASTBufferQueue*>(ptr); return android_view_Surface_createFromSurface(env, queue->getSurface(includeSurfaceControlHandle)); } Loading Loading @@ -166,7 +165,7 @@ static bool nativeSyncNextTransaction(JNIEnv* env, jclass clazz, jlong ptr, jobj jboolean acquireSingleBuffer) { LOG_ALWAYS_FATAL_IF(!callback, "callback passed in to syncNextTransaction must not be NULL"); sp<BLASTBufferQueue> queue = reinterpret_cast<BLASTBufferQueue*>(ptr); auto queue = reinterpret_cast<BLASTBufferQueue*>(ptr); JavaVM* vm = nullptr; LOG_ALWAYS_FATAL_IF(env->GetJavaVM(&vm) != JNI_OK, "Unable to get Java VM"); Loading @@ -186,51 +185,53 @@ static bool nativeSyncNextTransaction(JNIEnv* env, jclass clazz, jlong ptr, jobj } static void nativeStopContinuousSyncTransaction(JNIEnv* env, jclass clazz, jlong ptr) { sp<BLASTBufferQueue> queue = reinterpret_cast<BLASTBufferQueue*>(ptr); auto queue = reinterpret_cast<BLASTBufferQueue*>(ptr); queue->stopContinuousSyncTransaction(); } static void nativeClearSyncTransaction(JNIEnv* env, jclass clazz, jlong ptr) { sp<BLASTBufferQueue> queue = reinterpret_cast<BLASTBufferQueue*>(ptr); auto queue = reinterpret_cast<BLASTBufferQueue*>(ptr); queue->clearSyncTransaction(); } static void nativeUpdate(JNIEnv* env, jclass clazz, jlong ptr, jlong surfaceControl, jlong width, static void nativeUpdate(JNIEnv* env, jclass clazz, jlong ptr, jlong surfaceControlPtr, jlong width, jlong height, jint format) { sp<BLASTBufferQueue> queue = reinterpret_cast<BLASTBufferQueue*>(ptr); queue->update(reinterpret_cast<SurfaceControl*>(surfaceControl), width, height, format); auto queue = reinterpret_cast<BLASTBufferQueue*>(ptr); auto surfaceControl = SpFromRawPtr<SurfaceControl>(surfaceControlPtr); queue->update(surfaceControl, width, height, format); } static void nativeMergeWithNextTransaction(JNIEnv*, jclass clazz, jlong ptr, jlong transactionPtr, jlong framenumber) { sp<BLASTBufferQueue> queue = reinterpret_cast<BLASTBufferQueue*>(ptr); auto queue = reinterpret_cast<BLASTBufferQueue*>(ptr); auto transaction = reinterpret_cast<SurfaceComposerClient::Transaction*>(transactionPtr); queue->mergeWithNextTransaction(transaction, CC_UNLIKELY(framenumber < 0) ? 0 : framenumber); } static jlong nativeGetLastAcquiredFrameNum(JNIEnv* env, jclass clazz, jlong ptr) { sp<BLASTBufferQueue> queue = reinterpret_cast<BLASTBufferQueue*>(ptr); auto queue = reinterpret_cast<BLASTBufferQueue*>(ptr); return queue->getLastAcquiredFrameNum(); } static void nativeApplyPendingTransactions(JNIEnv* env, jclass clazz, jlong ptr, jlong frameNum) { sp<BLASTBufferQueue> queue = reinterpret_cast<BLASTBufferQueue*>(ptr); auto queue = reinterpret_cast<BLASTBufferQueue*>(ptr); queue->applyPendingTransactions(frameNum); } static bool nativeIsSameSurfaceControl(JNIEnv* env, jclass clazz, jlong ptr, jlong surfaceControl) { sp<BLASTBufferQueue> queue = reinterpret_cast<BLASTBufferQueue*>(ptr); return queue->isSameSurfaceControl(reinterpret_cast<SurfaceControl*>(surfaceControl)); static bool nativeIsSameSurfaceControl(JNIEnv* env, jclass clazz, jlong ptr, jlong surfaceControlPtr) { auto queue = reinterpret_cast<BLASTBufferQueue*>(ptr); auto surfaceControl = SpFromRawPtr<SurfaceControl>(surfaceControlPtr); return queue->isSameSurfaceControl(surfaceControl); } static void nativeSetTransactionHangCallback(JNIEnv* env, jclass clazz, jlong ptr, jobject transactionHangCallback) { sp<BLASTBufferQueue> queue = reinterpret_cast<BLASTBufferQueue*>(ptr); auto queue = reinterpret_cast<BLASTBufferQueue*>(ptr); if (transactionHangCallback == nullptr) { queue->setTransactionHangCallback(nullptr); } else { sp<TransactionHangCallbackWrapper> wrapper = new TransactionHangCallbackWrapper{env, transactionHangCallback}; auto wrapper = sp<TransactionHangCallbackWrapper>::make(env, transactionHangCallback); queue->setTransactionHangCallback( [wrapper](const std::string& reason) { wrapper->onTransactionHang(reason); }); } Loading @@ -238,26 +239,26 @@ static void nativeSetTransactionHangCallback(JNIEnv* env, jclass clazz, jlong pt static jobject nativeGatherPendingTransactions(JNIEnv* env, jclass clazz, jlong ptr, jlong frameNum) { sp<BLASTBufferQueue> queue = reinterpret_cast<BLASTBufferQueue*>(ptr); auto queue = reinterpret_cast<BLASTBufferQueue*>(ptr); SurfaceComposerClient::Transaction* transaction = queue->gatherPendingTransactions(frameNum); return env->NewObject(gTransactionClassInfo.clazz, gTransactionClassInfo.ctor, reinterpret_cast<jlong>(transaction)); } static void nativeSetApplyToken(JNIEnv* env, jclass clazz, jlong ptr, jobject applyTokenObject) { sp<BLASTBufferQueue> queue = reinterpret_cast<BLASTBufferQueue*>(ptr); auto queue = reinterpret_cast<BLASTBufferQueue*>(ptr); sp<IBinder> token(ibinderForJavaObject(env, applyTokenObject)); return queue->setApplyToken(std::move(token)); } static void nativeSetWaitForBufferReleaseCallback(JNIEnv* env, jclass clazz, jlong ptr, jobject waitForBufferReleaseCallback) { sp<BLASTBufferQueue> queue = reinterpret_cast<BLASTBufferQueue*>(ptr); auto queue = reinterpret_cast<BLASTBufferQueue*>(ptr); if (waitForBufferReleaseCallback == nullptr) { queue->setWaitForBufferReleaseCallback(nullptr); } else { sp<WaitForBufferReleaseCallbackWrapper> wrapper = new WaitForBufferReleaseCallbackWrapper{env, waitForBufferReleaseCallback}; auto wrapper = sp<WaitForBufferReleaseCallbackWrapper>::make(env, waitForBufferReleaseCallback); queue->setWaitForBufferReleaseCallback([wrapper](const nsecs_t durationNanos) { wrapper->onWaitForBufferRelease(durationNanos); }); Loading
core/jni/android_hardware_input_InputWindowHandle.cpp +0 −1 Original line number Diff line number Diff line Loading @@ -13,7 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ #undef ANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION // TODO:remove this and fix code #define LOG_TAG "InputWindowHandle" Loading