summaryrefslogtreecommitdiff
path: root/cpp/RenderScript.cpp
diff options
context:
space:
mode:
authorMiao Wang <miaowang@google.com>2015-10-12 21:36:46 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-10-12 21:36:46 +0000
commit24597e4ba6501381f18b4783274dff6fcde22521 (patch)
tree7dc08535656f00998195935f8cd6f12a4cdf560d /cpp/RenderScript.cpp
parentf59d2afef612ee175246c522282c2a1fe562f8cc (diff)
parent75e9f10b5d26a2feb03dc7bb4ad39514ec3e8660 (diff)
am 75e9f10b: Merge "Allow developers to specify a target RS API level for C++"
* commit '75e9f10b5d26a2feb03dc7bb4ad39514ec3e8660': Allow developers to specify a target RS API level for C++
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");