From d5ab703cf5f86a278f1946e1b413cf726b2555bf Mon Sep 17 00:00:00 2001 From: John Reck Date: Thu, 20 Jul 2023 21:18:13 -0400 Subject: [PATCH] Removing incorrect @CriticalNative nGetMaximumTextureWidth/Height are blocking calls into RenderThread and thus inappropriate to be marked as @CriticalNative Fixes: 292016309 Test: build & boots; no functional changes otherwise Change-Id: Iebcbc119e75977905c64711f72c2f33200608f8c --- graphics/java/android/graphics/RecordingCanvas.java | 2 -- libs/hwui/jni/android_graphics_DisplayListCanvas.cpp | 8 ++++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/graphics/java/android/graphics/RecordingCanvas.java b/graphics/java/android/graphics/RecordingCanvas.java index a5184f28dbc15..635e78e674be3 100644 --- a/graphics/java/android/graphics/RecordingCanvas.java +++ b/graphics/java/android/graphics/RecordingCanvas.java @@ -276,9 +276,7 @@ public final class RecordingCanvas extends BaseRecordingCanvas { @CriticalNative private static native void nResetDisplayListCanvas(long canvas, long node, int width, int height); - @CriticalNative private static native int nGetMaximumTextureWidth(); - @CriticalNative private static native int nGetMaximumTextureHeight(); @CriticalNative private static native void nEnableZ(long renderer, boolean enableZ); diff --git a/libs/hwui/jni/android_graphics_DisplayListCanvas.cpp b/libs/hwui/jni/android_graphics_DisplayListCanvas.cpp index f060bb32031aa..426644ee6a4e3 100644 --- a/libs/hwui/jni/android_graphics_DisplayListCanvas.cpp +++ b/libs/hwui/jni/android_graphics_DisplayListCanvas.cpp @@ -84,7 +84,7 @@ static void android_view_DisplayListCanvas_resetDisplayListCanvas(CRITICAL_JNI_P canvas->resetRecording(width, height, renderNode); } -static jint android_view_DisplayListCanvas_getMaxTextureSize(CRITICAL_JNI_PARAMS) { +static jint android_view_DisplayListCanvas_getMaxTextureSize(JNIEnv*, jobject) { #ifdef __ANDROID__ // Layoutlib does not support RenderProxy (RenderThread) return android::uirenderer::renderthread::RenderProxy::maxTextureSize(); #else @@ -175,14 +175,14 @@ static void android_view_DisplayListCanvas_drawWebViewFunctor(CRITICAL_JNI_PARAM const char* const kClassPathName = "android/graphics/RecordingCanvas"; static JNINativeMethod gMethods[] = { + {"nGetMaximumTextureWidth", "()I", (void*)android_view_DisplayListCanvas_getMaxTextureSize}, + {"nGetMaximumTextureHeight", "()I", + (void*)android_view_DisplayListCanvas_getMaxTextureSize}, // ------------ @CriticalNative -------------- {"nCreateDisplayListCanvas", "(JII)J", (void*)android_view_DisplayListCanvas_createDisplayListCanvas}, {"nResetDisplayListCanvas", "(JJII)V", (void*)android_view_DisplayListCanvas_resetDisplayListCanvas}, - {"nGetMaximumTextureWidth", "()I", (void*)android_view_DisplayListCanvas_getMaxTextureSize}, - {"nGetMaximumTextureHeight", "()I", - (void*)android_view_DisplayListCanvas_getMaxTextureSize}, {"nEnableZ", "(JZ)V", (void*)android_view_DisplayListCanvas_enableZ}, {"nFinishRecording", "(JJ)V", (void*)android_view_DisplayListCanvas_finishRecording}, {"nDrawRenderNode", "(JJ)V", (void*)android_view_DisplayListCanvas_drawRenderNode},