diff options
author | Jason Sams <rjsams@android.com> | 2009-08-03 16:03:08 -0700 |
---|---|---|
committer | Jason Sams <rjsams@android.com> | 2009-08-03 16:03:08 -0700 |
commit | d3c8de2efc8f4f9287e0a8dfdeefb03ba6aaec98 (patch) | |
tree | 815c8c426d1936d1183476e5fa1093f50041eb30 /rsAdapter.cpp | |
parent | 2f014c865dc2e825e52086566515ad1242942ab3 (diff) | |
download | rs-d3c8de2efc8f4f9287e0a8dfdeefb03ba6aaec98.tar.gz |
Implement the jni bindings for Adapter2D. Fix a refcount bug in the native adapter implementation. Use adapters in Film to border the mipmaps.
Diffstat (limited to 'rsAdapter.cpp')
-rw-r--r-- | rsAdapter.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/rsAdapter.cpp b/rsAdapter.cpp index 7ac2aed7..25f33409 100644 --- a/rsAdapter.cpp +++ b/rsAdapter.cpp @@ -61,8 +61,8 @@ void Adapter1D::subData(uint32_t xoff, uint32_t count, const void *data) void Adapter1D::data(const void *data) { - memcpy(getElement(0), - data, + memcpy(getElement(0), + data, mAllocation.get()->getType()->getSizeBytes()); } @@ -71,7 +71,9 @@ namespace renderscript { RsAdapter1D rsi_Adapter1DCreate(Context *rsc) { - return new Adapter1D(); + Adapter1D *a = new Adapter1D(); + a->incRef(); + return a; } void rsi_Adapter1DDestroy(Context *rsc, RsAdapter1D va) @@ -176,8 +178,8 @@ void Adapter2D::subData(uint32_t xoff, uint32_t yoff, uint32_t w, uint32_t h, co void Adapter2D::data(const void *data) { - memcpy(getElement(0,0), - data, + memcpy(getElement(0,0), + data, mAllocation.get()->getType()->getSizeBytes()); } @@ -188,7 +190,9 @@ namespace renderscript { RsAdapter2D rsi_Adapter2DCreate(Context *rsc) { - return new Adapter2D(); + Adapter2D *a = new Adapter2D(); + a->incRef(); + return a; } void rsi_Adapter2DDestroy(Context *rsc, RsAdapter2D va) |