summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLogan Chien <loganchien@google.com>2011-07-11 15:32:24 +0800
committerLogan Chien <loganchien@google.com>2011-07-11 15:32:24 +0800
commitabfaab8983d9727d3d5ca34e2a0ff3e80ba2eb24 (patch)
treeaa3e49cbdc608d53bf2d8285c721f23bebe8d05f
parent585f554211bd9945ef84878d89bfc9b4b1c0bd94 (diff)
downloadandroid_frameworks_rs-abfaab8983d9727d3d5ca34e2a0ff3e80ba2eb24.tar.gz
android_frameworks_rs-abfaab8983d9727d3d5ca34e2a0ff3e80ba2eb24.tar.bz2
android_frameworks_rs-abfaab8983d9727d3d5ca34e2a0ff3e80ba2eb24.zip
Use resource entry name instead of mangled name.
Change-Id: I833fa1b529fe505ce20ede12b7f4b5952a6ac1f0
-rw-r--r--driver/rsdBcc.cpp64
1 files changed, 1 insertions, 63 deletions
diff --git a/driver/rsdBcc.cpp b/driver/rsdBcc.cpp
index b6240a12..62eb24ef 100644
--- a/driver/rsdBcc.cpp
+++ b/driver/rsdBcc.cpp
@@ -66,65 +66,6 @@ static Script * setTLS(Script *sc) {
}
-// Input: cacheDir
-// Input: resName
-// Input: extName
-//
-// Note: cacheFile = resName + extName
-//
-// Output: Returns cachePath == cacheDir + cacheFile
-static char *genCacheFileName(const char *cacheDir,
- const char *resName,
- const char *extName) {
- char cachePath[512];
- char cacheFile[sizeof(cachePath)];
- const size_t kBufLen = sizeof(cachePath) - 1;
-
- cacheFile[0] = '\0';
- // Note: resName today is usually something like
- // "/com.android.fountain:raw/fountain"
- if (resName[0] != '/') {
- // Get the absolute path of the raw/***.bc file.
-
- // Generate the absolute path. This doesn't do everything it
- // should, e.g. if resName is "./out/whatever" it doesn't crunch
- // the leading "./" out because this if-block is not triggered,
- // but it'll make do.
- //
- if (getcwd(cacheFile, kBufLen) == NULL) {
- LOGE("Can't get CWD while opening raw/***.bc file\n");
- return NULL;
- }
- // Append "/" at the end of cacheFile so far.
- strncat(cacheFile, "/", kBufLen);
- }
-
- // cacheFile = resName + extName
- //
- strncat(cacheFile, resName, kBufLen);
- if (extName != NULL) {
- // TODO(srhines): strncat() is a bit dangerous
- strncat(cacheFile, extName, kBufLen);
- }
-
- // Turn the path into a flat filename by replacing
- // any slashes after the first one with '@' characters.
- char *cp = cacheFile + 1;
- while (*cp != '\0') {
- if (*cp == '/') {
- *cp = '@';
- }
- cp++;
- }
-
- // Tack on the file name for the actual cache file path.
- strncpy(cachePath, cacheDir, kBufLen);
- strncat(cachePath, cacheFile, kBufLen);
-
- LOGV("Cache file for '%s' '%s' is '%s'\n", resName, extName, cachePath);
- return strdup(cachePath);
-}
-
bool rsdScriptInit(const Context *rsc,
ScriptC *script,
char const *resName,
@@ -164,15 +105,12 @@ bool rsdScriptInit(const Context *rsc,
goto error;
}
-#if 1
if (bccLinkFile(drv->mBccScript, "/system/lib/libclcore.bc", 0) != 0) {
LOGE("bcc: FAILS to link bitcode");
goto error;
}
-#endif
- cachePath = genCacheFileName(cacheDir, resName, ".oBCC");
- if (bccPrepareExecutable(drv->mBccScript, cachePath, 0) != 0) {
+ if (bccPrepareExecutableEx(drv->mBccScript, cacheDir, resName, 0) != 0) {
LOGE("bcc: FAILS to prepare executable");
goto error;
}