summaryrefslogtreecommitdiff
path: root/cpp/RenderScript.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/RenderScript.cpp')
-rw-r--r--cpp/RenderScript.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/cpp/RenderScript.cpp b/cpp/RenderScript.cpp
index e0be0a60..5ee30603 100644
--- a/cpp/RenderScript.cpp
+++ b/cpp/RenderScript.cpp
@@ -75,10 +75,6 @@ RS::~RS() {
}
}
-bool RS::init(const char * name, uint32_t flags) {
- return RS::init(name, RS_VERSION, flags);
-}
-
// This will only open API 19+ libRS, because that's when
// we changed libRS to extern "C" entry points.
static bool loadSO(const char* filename, int targetApi) {
@@ -139,10 +135,15 @@ bool RS::initDispatch(int targetApi) {
return false;
}
-bool RS::init(const char * name, int targetApi, uint32_t flags) {
+bool RS::init(const char * name, uint32_t flags, int targetApi) {
if (mInit) {
return true;
}
+ // When using default value 0, set targetApi to RS_VERSION,
+ // to preserve the behavior of existing apps.
+ if (targetApi == 0) {
+ targetApi = RS_VERSION;
+ }
if (initDispatch(targetApi) == false) {
ALOGE("Couldn't initialize dispatch table");