summaryrefslogtreecommitdiff
path: root/libs/rs/rsAllocation.cpp
diff options
context:
space:
mode:
author Jason Sams <rjsams@android.com> 2009-08-10 14:55:26 -0700
committer Jason Sams <rjsams@android.com> 2009-08-10 14:55:26 -0700
commit40a29e8e28772b37ab0f9fe9708ecdcba24abb84 (patch)
treeddc7de5fe342a6bded733e8341b1953a49e0a2d0 /libs/rs/rsAllocation.cpp
parentc028d09409c3cd290949974258264903106a3346 (diff)
Implement basic allocation readback. Add Get height, width to ScriptC_Lib.
Diffstat (limited to 'libs/rs/rsAllocation.cpp')
-rw-r--r--libs/rs/rsAllocation.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/libs/rs/rsAllocation.cpp b/libs/rs/rsAllocation.cpp
index 5ec73d74ac89..ad9c73952f7d 100644
--- a/libs/rs/rsAllocation.cpp
+++ b/libs/rs/rsAllocation.cpp
@@ -120,6 +120,11 @@ void Allocation::data(const void *data)
memcpy(mPtr, data, mType->getSizeBytes());
}
+void Allocation::read(void *data)
+{
+ memcpy(data, mPtr, mType->getSizeBytes());
+}
+
void Allocation::subData(uint32_t xoff, uint32_t count, const void *data)
{
uint32_t eSize = mType->getElementSizeBytes();
@@ -523,6 +528,12 @@ void rsi_Allocation2DSubData(Context *rsc, RsAllocation va, uint32_t xoff, uint3
rsc->allocationCheck(a);
}
+void rsi_AllocationRead(Context *rsc, RsAllocation va, void *data)
+{
+ Allocation *a = static_cast<Allocation *>(va);
+ a->read(data);
+}
+
}
}