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
This commit is contained in:
John Reck
2023-07-20 21:18:13 -04:00
parent bb9ee0797e
commit d5ab703cf5
2 changed files with 4 additions and 6 deletions

View File

@@ -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);

View File

@@ -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},