diff options
| author | Tim Murray <timmurray@google.com> | 2013-09-09 16:12:51 -0700 |
|---|---|---|
| committer | Tim Murray <timmurray@google.com> | 2013-09-09 16:17:29 -0700 |
| commit | 84e3dea053bea25c1cec44ffb298f8b5b9b9141a (patch) | |
| tree | 6de4ffac2b59292f7a538593e348380f0700814d /cpp/RenderScript.cpp | |
| parent | eeaf7142d7e06efb3e0ddc7ef542884ab1d527dc (diff) | |
Add flags word to context initialization.
bug 10427951
Change-Id: If3b9337712bd16655de4a42ccf829bbcd9e01b6e
Diffstat (limited to 'cpp/RenderScript.cpp')
| -rw-r--r-- | cpp/RenderScript.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/cpp/RenderScript.cpp b/cpp/RenderScript.cpp index fb72738f..3be195f8 100644 --- a/cpp/RenderScript.cpp +++ b/cpp/RenderScript.cpp @@ -66,8 +66,8 @@ RS::~RS() { } } -bool RS::init(bool forceCpu, bool synchronous) { - return RS::init(RS_VERSION, forceCpu, synchronous); +bool RS::init(uint32_t flags) { + return RS::init(RS_VERSION, flags); } static bool loadSymbols(void* handle) { @@ -412,7 +412,7 @@ static bool loadSO(const char* filename) { ALOGE("%s init failed!", filename); return false; } - ALOGE("Successfully loaded %s", filename); + //ALOGE("Successfully loaded %s", filename); return true; } @@ -460,7 +460,7 @@ bool RS::initDispatch(int targetApi) { return false; } -bool RS::init(int targetApi, bool forceCpu, bool synchronous) { +bool RS::init(int targetApi, uint32_t flags) { if (initDispatch(targetApi) == false) { ALOGE("Couldn't initialize dispatch table"); return false; @@ -472,7 +472,12 @@ bool RS::init(int targetApi, bool forceCpu, bool synchronous) { return false; } - mContext = RS::dispatch->ContextCreate(mDev, 0, targetApi, RS_CONTEXT_TYPE_NORMAL, forceCpu, synchronous); + if (flags >= RS_CONTEXT_MAX) { + ALOGE("Invalid flags passed"); + return false; + } + + mContext = RS::dispatch->ContextCreate(mDev, 0, targetApi, RS_CONTEXT_TYPE_NORMAL, flags); if (mContext == 0) { ALOGE("Context creation failed"); return false; |
