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 | bd1c3ad0cdf8e60b849a009cdc0b36764cc1dacb (patch) | |
| tree | fa3ac33695695699563507abb0dad5691058596e /libs/rs/rsAdapter.cpp | |
| parent | b8c5a84e7c23746a3fc26013e0880d3d95ca6588 (diff) | |
| download | frameworks_base-bd1c3ad0cdf8e60b849a009cdc0b36764cc1dacb.zip frameworks_base-bd1c3ad0cdf8e60b849a009cdc0b36764cc1dacb.tar.gz frameworks_base-bd1c3ad0cdf8e60b849a009cdc0b36764cc1dacb.tar.bz2 | |
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 'libs/rs/rsAdapter.cpp')
| -rw-r--r-- | libs/rs/rsAdapter.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/libs/rs/rsAdapter.cpp b/libs/rs/rsAdapter.cpp index 7ac2aed..25f3340 100644 --- a/libs/rs/rsAdapter.cpp +++ b/libs/rs/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) |
