Implement the jni bindings for Adapter2D. Fix a refcount bug in the native adapter implementation. Use adapters in Film to border the mipmaps.
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::data(const void *data)
{
- memcpy(getElement(0),
- data,
+ memcpy(getElement(0),
+ data,
mAllocation.get()->getType()->getSizeBytes());
}
@@ -71,7 +71,9 @@
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::data(const void *data)
{
- memcpy(getElement(0,0),
- data,
+ memcpy(getElement(0,0),
+ data,
mAllocation.get()->getType()->getSizeBytes());
}
@@ -188,7 +190,9 @@
RsAdapter2D rsi_Adapter2DCreate(Context *rsc)
{
- return new Adapter2D();
+ Adapter2D *a = new Adapter2D();
+ a->incRef();
+ return a;
}
void rsi_Adapter2DDestroy(Context *rsc, RsAdapter2D va)