[RenderScript] Connect ANativeWindow to BufferQueue before calling

AllocationSetSurface.

Bug: 34334222
Test: mm, boot Sailfish, CTS pass and ImageProcessingJB works well.
Change-Id: I77e7fb69987a347862286299622343b4f7879ab0
This commit is contained in:
Miao Wang
2017-04-03 16:42:03 -07:00
parent f2764a4aed
commit f35ddc9843

View File

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