Add user-defined cache path.
Change-Id: I7374d8e84d8dc6e74a6faa526c6e68ae11da6500
diff --git a/cpp/rsCppStructs.h b/cpp/rsCppStructs.h
index e45e2fb..0df201b 100644
--- a/cpp/rsCppStructs.h
+++ b/cpp/rsCppStructs.h
@@ -90,10 +90,12 @@
/**
* Initializes a RenderScript context. A context must be initialized before it can be used.
+ * @param[in] name Directory name to be used by this context. This should be equivalent to
+ * Context.getCacheDir().
* @param[in] flags Optional flags for this context.
* @return true on success
*/
- bool init(uint32_t flags = 0);
+ bool init(std::string name, uint32_t flags = 0);
/**
* Sets the error handler function for this context. This error handler is
@@ -147,7 +149,7 @@
static bool usingNative;
static bool initDispatch(int targetApi);
- bool init(int targetApi, uint32_t flags);
+ bool init(std::string &name, int targetApi, uint32_t flags);
static void * threadProc(void *);
static bool gInitialized;
@@ -165,6 +167,8 @@
MessageHandlerFunc_t mMessageFunc;
bool mInit;
+ std::string mCacheDir;
+
struct {
sp<const Element> U8;
sp<const Element> U8_2;
@@ -246,6 +250,7 @@
} mSamplers;
friend class Sampler;
friend class Element;
+ friend class ScriptC;
};
/**