diff options
| author | Tim Murray <timmurray@google.com> | 2013-12-13 12:54:37 -0800 |
|---|---|---|
| committer | Stephen Hines <srhines@google.com> | 2013-12-18 17:09:27 -0800 |
| commit | caf4126512b2152ea5f6573ce5d9ca29767b9678 (patch) | |
| tree | e9f7c3ec55a27b184a7611bc48ed46f4ee050d7e /cpp/RenderScript.cpp | |
| parent | db5de3870e9818879f1836687a10ce1cf586b38c (diff) | |
Add user-defined cache path.
Change-Id: I7374d8e84d8dc6e74a6faa526c6e68ae11da6500
Diffstat (limited to 'cpp/RenderScript.cpp')
| -rw-r--r-- | cpp/RenderScript.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/cpp/RenderScript.cpp b/cpp/RenderScript.cpp index 1da31c75..3a75ffe0 100644 --- a/cpp/RenderScript.cpp +++ b/cpp/RenderScript.cpp @@ -66,8 +66,8 @@ RS::~RS() { } } -bool RS::init(uint32_t flags) { - return RS::init(RS_VERSION, flags); +bool RS::init(std::string name, uint32_t flags) { + return RS::init(name, RS_VERSION, flags); } static bool loadSymbols(void* handle) { @@ -462,12 +462,19 @@ bool RS::initDispatch(int targetApi) { return false; } -bool RS::init(int targetApi, uint32_t flags) { +bool RS::init(std::string &name, int targetApi, uint32_t flags) { + if (mInit) { + return true; + } + if (initDispatch(targetApi) == false) { ALOGE("Couldn't initialize dispatch table"); return false; } + mCacheDir = name; + mCacheDir += "/com.android.renderscript.cache/"; + mDev = RS::dispatch->DeviceCreate(); if (mDev == 0) { ALOGE("Device creation failed"); |
