diff options
| author | Miao Wang <miaowang@google.com> | 2015-10-12 21:31:59 +0000 |
|---|---|---|
| committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2015-10-12 21:31:59 +0000 |
| commit | 75e9f10b5d26a2feb03dc7bb4ad39514ec3e8660 (patch) | |
| tree | 7dc08535656f00998195935f8cd6f12a4cdf560d /cpp/RenderScript.cpp | |
| parent | 17619e87d4c2f953c91224e632f0ac6755e5ed69 (diff) | |
| parent | d9a0257f82cf4c634f6d2005c7fe1b46b1f7e1f1 (diff) | |
Merge "Allow developers to specify a target RS API level for C++"
Diffstat (limited to 'cpp/RenderScript.cpp')
| -rw-r--r-- | cpp/RenderScript.cpp | 11 |
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"); |
