enable synchronous mode (functional)
Change-Id: I613610013e7e4d1623620ab94d2d25d8a1bd82b3
Bug: 5972398
diff --git a/cpp/RenderScript.cpp b/cpp/RenderScript.cpp
index 4ce4c9b..98ab380 100644
--- a/cpp/RenderScript.cpp
+++ b/cpp/RenderScript.cpp
@@ -54,18 +54,18 @@
mDev = NULL;
}
-bool RS::init(bool forceCpu) {
- return RS::init(RS_VERSION, forceCpu);
+bool RS::init(bool forceCpu, bool synchronous) {
+ return RS::init(RS_VERSION, forceCpu, synchronous);
}
-bool RS::init(int targetApi, bool forceCpu) {
+bool RS::init(int targetApi, bool forceCpu, bool synchronous) {
mDev = rsDeviceCreate();
if (mDev == 0) {
ALOGE("Device creation failed");
return false;
}
- mContext = rsContextCreate(mDev, 0, targetApi, forceCpu);
+ mContext = rsContextCreate(mDev, 0, targetApi, forceCpu, synchronous);
if (mContext == 0) {
ALOGE("Context creation failed");
return false;
diff --git a/cpp/rsCppStructs.h b/cpp/rsCppStructs.h
index a430c35..a381816 100644
--- a/cpp/rsCppStructs.h
+++ b/cpp/rsCppStructs.h
@@ -43,8 +43,7 @@
RS();
virtual ~RS();
- bool init() { return init(false); }
- bool init(bool forceCpu);
+ bool init(bool forceCpu = false, bool synchronous = false);
void setErrorHandler(ErrorHandlerFunc_t func);
ErrorHandlerFunc_t getErrorHandler() { return mErrorFunc; }
@@ -59,7 +58,7 @@
void finish();
private:
- bool init(int targetApi, bool forceCpu);
+ bool init(int targetApi, bool forceCpu, bool synchronous);
static void * threadProc(void *);
static bool gInitialized;