From f35ddc9843af8979944a41237e3ad72248894c26 Mon Sep 17 00:00:00 2001 From: Miao Wang Date: Mon, 3 Apr 2017 16:42:03 -0700 Subject: [PATCH] [RenderScript] Connect ANativeWindow to BufferQueue before calling AllocationSetSurface. Bug: 34334222 Test: mm, boot Sailfish, CTS pass and ImageProcessingJB works well. Change-Id: I77e7fb69987a347862286299622343b4f7879ab0 --- rs/jni/android_renderscript_RenderScript.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rs/jni/android_renderscript_RenderScript.cpp b/rs/jni/android_renderscript_RenderScript.cpp index c532efb79345e..0acbb0258944c 100644 --- a/rs/jni/android_renderscript_RenderScript.cpp +++ b/rs/jni/android_renderscript_RenderScript.cpp @@ -1282,7 +1282,9 @@ nAllocationSetSurface(JNIEnv *_env, jobject _this, jlong con, jlong alloc, jobje ANativeWindow *anw = nullptr; if (sur != 0) { + // Connect the native window handle to buffer queue. anw = ANativeWindow_fromSurface(_env, sur); + native_window_api_connect(anw, NATIVE_WINDOW_API_CPU); } rsAllocationSetSurface((RsContext)con, (RsAllocation)alloc, anw);