1dd12e72228ea20b7fdea4dbf32c88291aef6d552Miao Wang#include <android/log.h>
2dd12e72228ea20b7fdea4dbf32c88291aef6d552Miao Wang#include <android/native_window.h>
3dd12e72228ea20b7fdea4dbf32c88291aef6d552Miao Wang#include <android/native_window_jni.h>
4dd12e72228ea20b7fdea4dbf32c88291aef6d552Miao Wang
5dd12e72228ea20b7fdea4dbf32c88291aef6d552Miao Wang#include <rsEnv.h>
6dd12e72228ea20b7fdea4dbf32c88291aef6d552Miao Wang#include "rsDispatch.h"
7dd12e72228ea20b7fdea4dbf32c88291aef6d552Miao Wang#define LOG_API(...)
8dd12e72228ea20b7fdea4dbf32c88291aef6d552Miao Wang
9dd12e72228ea20b7fdea4dbf32c88291aef6d552Miao Wangextern "C" void AllocationSetSurface(JNIEnv *_env, jobject _this, RsContext con, RsAllocation alloc, jobject sur, dispatchTable dispatchTab)
10dd12e72228ea20b7fdea4dbf32c88291aef6d552Miao Wang{
11dd12e72228ea20b7fdea4dbf32c88291aef6d552Miao Wang    LOG_API("nAllocationSetSurface, con(%p), alloc(%p), surface(%p)",
12dd12e72228ea20b7fdea4dbf32c88291aef6d552Miao Wang            con, alloc, sur);
13dd12e72228ea20b7fdea4dbf32c88291aef6d552Miao Wang
14dd12e72228ea20b7fdea4dbf32c88291aef6d552Miao Wang    ANativeWindow* s = NULL;
15dd12e72228ea20b7fdea4dbf32c88291aef6d552Miao Wang    if (sur != 0) {
16dd12e72228ea20b7fdea4dbf32c88291aef6d552Miao Wang        s = ANativeWindow_fromSurface(_env, sur);
17dd12e72228ea20b7fdea4dbf32c88291aef6d552Miao Wang    }
18dd12e72228ea20b7fdea4dbf32c88291aef6d552Miao Wang    dispatchTab.AllocationSetSurface(con, alloc, s);
19dd12e72228ea20b7fdea4dbf32c88291aef6d552Miao Wang}
20dd12e72228ea20b7fdea4dbf32c88291aef6d552Miao Wang
21