diff options
| author | Stephen Hines <srhines@google.com> | 2013-11-27 14:21:57 -0800 |
|---|---|---|
| committer | Stephen Hines <srhines@google.com> | 2013-11-27 17:59:11 -0800 |
| commit | 7a01126d25c081f5b613eea80e5ff7e6c75c940f (patch) | |
| tree | 1b3af4603046649d07e268e4cb67934c313bd526 /driver/rsdRuntimeStubs.cpp | |
| parent | 77d31f08b5f722311e853a4605d0b1abe4f1ad22 (diff) | |
| download | android_frameworks_rs-7a01126d25c081f5b613eea80e5ff7e6c75c940f.tar.gz android_frameworks_rs-7a01126d25c081f5b613eea80e5ff7e6c75c940f.tar.bz2 android_frameworks_rs-7a01126d25c081f5b613eea80e5ff7e6c75c940f.zip | |
Add tests and missing functions for rs_allocation APIs.
This change also adds some missing support library functions:
rsAllocationCopy1DRange()
rsAllocationCopy2DRange()
rsAllocationIoSend()
rsAllocationIoReceive()
Change-Id: Ia50773d767f78f3cfa2cfdf0340d8c3d9cdb0991
Diffstat (limited to 'driver/rsdRuntimeStubs.cpp')
| -rw-r--r-- | driver/rsdRuntimeStubs.cpp | 39 |
1 files changed, 37 insertions, 2 deletions
diff --git a/driver/rsdRuntimeStubs.cpp b/driver/rsdRuntimeStubs.cpp index 4788a129..2a3ebc90 100644 --- a/driver/rsdRuntimeStubs.cpp +++ b/driver/rsdRuntimeStubs.cpp @@ -84,6 +84,10 @@ OPAQUETYPE(rs_script) OPAQUETYPE(rs_script_call) #undef OPAQUETYPE +typedef enum { + // Empty to avoid conflicting definitions with RsAllocationCubemapFace +} rs_allocation_cubemap_face; + typedef struct { int tm_sec; ///< seconds int tm_min; ///< minutes @@ -138,7 +142,6 @@ static void SC_AllocationCopy2DRange(Allocation *dstAlloc, srcXoff, srcYoff, srcMip, srcFace); } -#ifndef RS_COMPATIBILITY_LIB static void SC_AllocationIoSend(Allocation *alloc) { Context *rsc = RsdCpuReference::getTlsContext(); rsrAllocationIoSend(rsc, alloc); @@ -150,7 +153,7 @@ static void SC_AllocationIoReceive(Allocation *alloc) { rsrAllocationIoReceive(rsc, alloc); } - +#ifndef RS_COMPATIBILITY_LIB ////////////////////////////////////////////////////////////////////////////// // Context @@ -1244,6 +1247,38 @@ const Allocation * rsGetAllocation(const void *ptr) { return SC_GetAllocation(ptr); } +void __attribute__((overloadable)) rsAllocationIoSend(rs_allocation a) { + SC_AllocationIoSend((Allocation *)a.p); +} + +void __attribute__((overloadable)) rsAllocationIoReceive(rs_allocation a) { + SC_AllocationIoReceive((Allocation *)a.p); +} + + +void __attribute__((overloadable)) rsAllocationCopy1DRange( + rs_allocation dstAlloc, + uint32_t dstOff, uint32_t dstMip, uint32_t count, + rs_allocation srcAlloc, + uint32_t srcOff, uint32_t srcMip) { + SC_AllocationCopy1DRange((Allocation *)dstAlloc.p, dstOff, dstMip, count, + (Allocation *)srcAlloc.p, srcOff, srcMip); +} + +void __attribute__((overloadable)) rsAllocationCopy2DRange( + rs_allocation dstAlloc, + uint32_t dstXoff, uint32_t dstYoff, + uint32_t dstMip, rs_allocation_cubemap_face dstFace, + uint32_t width, uint32_t height, + rs_allocation srcAlloc, + uint32_t srcXoff, uint32_t srcYoff, + uint32_t srcMip, rs_allocation_cubemap_face srcFace) { + SC_AllocationCopy2DRange((Allocation *)dstAlloc.p, dstXoff, dstYoff, + dstMip, dstFace, width, height, + (Allocation *)srcAlloc.p, srcXoff, srcYoff, + srcMip, srcFace); +} + void __attribute__((overloadable)) rsForEach(rs_script script, rs_allocation in, rs_allocation out, |
