summaryrefslogtreecommitdiffstats
path: root/rsFileA3D.cpp
diff options
context:
space:
mode:
authorJason Sams <jsams@google.com>2012-03-28 17:44:21 -0700
committerJason Sams <jsams@google.com>2012-03-28 17:44:21 -0700
commita6ab26a035017143a24efa11859c9d8815a27f41 (patch)
treeee520438d5794e74faa2e7d0f9bce994758caad5 /rsFileA3D.cpp
parent65e9c8fb535139e30182977439a83dc136817925 (diff)
downloadandroid_frameworks_rs-a6ab26a035017143a24efa11859c9d8815a27f41.tar.gz
android_frameworks_rs-a6ab26a035017143a24efa11859c9d8815a27f41.tar.bz2
android_frameworks_rs-a6ab26a035017143a24efa11859c9d8815a27f41.zip
Workaround PDK issues.
Change-Id: I7dcb76a23cb3fd59e2a2d5e25af1329b2ac38415
Diffstat (limited to 'rsFileA3D.cpp')
-rw-r--r--rsFileA3D.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/rsFileA3D.cpp b/rsFileA3D.cpp
index 173b9a52..a52bf7ef 100644
--- a/rsFileA3D.cpp
+++ b/rsFileA3D.cpp
@@ -22,6 +22,10 @@
#include "rsAnimation.h"
#include "rs.h"
+#if !defined(__RS_PDK__)
+ #include <androidfw/Asset.h>
+#endif
+
using namespace android;
using namespace android::renderscript;
@@ -54,7 +58,9 @@ FileA3D::~FileA3D() {
free(mAlloc);
}
if (mAsset) {
+#if !defined(__RS_PDK__)
delete mAsset;
+#endif
}
}
@@ -83,8 +89,12 @@ void FileA3D::parseHeader(IStream *headerStream) {
}
bool FileA3D::load(Asset *asset) {
+#if !defined(__RS_PDK__)
mAsset = asset;
return load(asset->getBuffer(false), asset->getLength());
+#else
+ return false;
+#endif
}
bool FileA3D::load(const void *data, size_t length) {
@@ -421,6 +431,7 @@ RsFile rsaFileA3DCreateFromMemory(RsContext con, const void *data, uint32_t len)
}
RsFile rsaFileA3DCreateFromAsset(RsContext con, void *_asset) {
+#if !defined(__RS_PDK__)
Context *rsc = static_cast<Context *>(con);
Asset *asset = static_cast<Asset *>(_asset);
FileA3D *fa3d = new FileA3D(rsc);
@@ -428,6 +439,9 @@ RsFile rsaFileA3DCreateFromAsset(RsContext con, void *_asset) {
fa3d->load(asset);
return fa3d;
+#else
+ return NULL;
+#endif
}
RsFile rsaFileA3DCreateFromFile(RsContext con, const char *path) {