diff options
Diffstat (limited to 'rs')
| -rw-r--r-- | rs/java/android/renderscript/Allocation.java | 38 | ||||
| -rw-r--r-- | rs/java/android/renderscript/AllocationAdapter.java | 6 | ||||
| -rw-r--r-- | rs/java/android/renderscript/RenderScript.java | 1 | ||||
| -rw-r--r-- | rs/jni/Android.mk | 4 | ||||
| -rw-r--r-- | rs/jni/android_renderscript_RenderScript.cpp | 17 |
5 files changed, 24 insertions, 42 deletions
diff --git a/rs/java/android/renderscript/Allocation.java b/rs/java/android/renderscript/Allocation.java index 523c8fb..c4daaa9 100644 --- a/rs/java/android/renderscript/Allocation.java +++ b/rs/java/android/renderscript/Allocation.java @@ -802,7 +802,7 @@ public class Allocation extends BaseObj { /** * This is only intended to be used by auto-generated code reflected from - * the RenderScript script files. + * the RenderScript script files and should not be used by developers. * * @param xoff * @param component_number @@ -813,9 +813,8 @@ public class Allocation extends BaseObj { } /** - * @hide * This is only intended to be used by auto-generated code reflected from - * the RenderScript script files. + * the RenderScript script files and should not be used by developers. * * @param xoff * @param yoff @@ -1247,8 +1246,11 @@ public class Allocation extends BaseObj { } /** - * @hide + * Copy a rectangular region from the array into the allocation. + * The array is assumed to be tightly packed. * + * The data type of the array is not required to be the same as + * the element data type. */ private void copy3DRangeFromUnchecked(int xoff, int yoff, int zoff, int w, int h, int d, Object array, Element.DataType dt, int arrayLen) { @@ -1277,7 +1279,6 @@ public class Allocation extends BaseObj { } /** - * @hide * Copy a rectangular region from the array into the allocation. * The array is assumed to be tightly packed. * @@ -1298,7 +1299,6 @@ public class Allocation extends BaseObj { } /** - * @hide * Copy a rectangular region into the allocation from another * allocation. * @@ -1415,7 +1415,6 @@ public class Allocation extends BaseObj { } /** - * @hide * This is only intended to be used by auto-generated code reflected from * the RenderScript script files and should not be used by developers. * @@ -1423,7 +1422,7 @@ public class Allocation extends BaseObj { * @param yoff * @param zoff * @param component_number - * @param array + * @param fp */ public void copyToFieldPacker(int xoff, int yoff, int zoff, int component_number, FieldPacker fp) { mRS.validate(); @@ -1501,7 +1500,6 @@ public class Allocation extends BaseObj { } /** - * @hide * Copy part of this Allocation into an array. This method does not * guarantee that the Allocation is compatible with the input buffer. * @@ -1516,7 +1514,6 @@ public class Allocation extends BaseObj { } /** - * @hide * Copy part of this Allocation into an array. This method does not * guarantee that the Allocation is compatible with the input buffer. * @@ -1529,7 +1526,6 @@ public class Allocation extends BaseObj { } /** - * @hide * Copy part of this Allocation into an array. This method does not * guarantee that the Allocation is compatible with the input buffer. * @@ -1542,7 +1538,6 @@ public class Allocation extends BaseObj { } /** - * @hide * Copy part of this Allocation into an array. This method does not * guarantee that the Allocation is compatible with the input buffer. * @@ -1555,7 +1550,6 @@ public class Allocation extends BaseObj { } /** - * @hide * Copy part of this Allocation into an array. This method does not * guarantee that the Allocation is compatible with the input buffer. * @@ -1569,7 +1563,6 @@ public class Allocation extends BaseObj { /** - * @hide * Copy part of this Allocation into an array. This method does not * and will generate exceptions if the Allocation type does not * match the component type of the array passed in. @@ -1585,7 +1578,6 @@ public class Allocation extends BaseObj { } /** - * @hide * Copy part of this Allocation into an array. This method does not * and will generate exceptions if the Allocation type is not a 32 bit * integer type. @@ -1600,7 +1592,6 @@ public class Allocation extends BaseObj { } /** - * @hide * Copy part of this Allocation into an array. This method does not * and will generate exceptions if the Allocation type is not a 16 bit * integer type. @@ -1615,7 +1606,6 @@ public class Allocation extends BaseObj { } /** - * @hide * Copy part of this Allocation into an array. This method does not * and will generate exceptions if the Allocation type is not an 8 bit * integer type. @@ -1630,7 +1620,6 @@ public class Allocation extends BaseObj { } /** - * @hide * Copy part of this Allocation into an array. This method does not * and will generate exceptions if the Allocation type is not a 32 bit float * type. @@ -1671,7 +1660,6 @@ public class Allocation extends BaseObj { } /** - * @hide * Copy from a rectangular region in this Allocation into an array. * * @param xoff X offset of the region to copy in this Allocation @@ -1687,7 +1675,6 @@ public class Allocation extends BaseObj { } /** - * @hide * Copy from a rectangular region in this Allocation into an array. * * @param xoff X offset of the region to copy in this Allocation @@ -1703,7 +1690,6 @@ public class Allocation extends BaseObj { } /** - * @hide * Copy from a rectangular region in this Allocation into an array. * * @param xoff X offset of the region to copy in this Allocation @@ -1719,7 +1705,6 @@ public class Allocation extends BaseObj { } /** - * @hide * Copy from a rectangular region in this Allocation into an array. * * @param xoff X offset of the region to copy in this Allocation @@ -1735,7 +1720,6 @@ public class Allocation extends BaseObj { } /** - * @hide * Copy from a rectangular region in this Allocation into an array. * * @param xoff X offset of the region to copy in this Allocation @@ -1752,8 +1736,11 @@ public class Allocation extends BaseObj { /** - * @hide + * Copy from a rectangular region in this Allocation into an array. + * The array is assumed to be tightly packed. * + * The data type of the array is not required to be the same as + * the element data type. */ private void copy3DRangeToUnchecked(int xoff, int yoff, int zoff, int w, int h, int d, Object array, Element.DataType dt, int arrayLen) { @@ -1780,8 +1767,7 @@ public class Allocation extends BaseObj { Trace.traceEnd(RenderScript.TRACE_TAG); } - /** - * @hide + /* * Copy from a rectangular region in this Allocation into an array. * * @param xoff X offset of the region to copy in this Allocation diff --git a/rs/java/android/renderscript/AllocationAdapter.java b/rs/java/android/renderscript/AllocationAdapter.java index 183726f..35d59dd 100644 --- a/rs/java/android/renderscript/AllocationAdapter.java +++ b/rs/java/android/renderscript/AllocationAdapter.java @@ -136,7 +136,7 @@ public class AllocationAdapter extends Allocation { /** - * @hide + * * Set the active X. The x value must be within the range for * the allocation being adapted. * @@ -208,7 +208,7 @@ public class AllocationAdapter extends Allocation { } /** - * @hide + * */ public void setArray(int arrayNum, int arrayVal) { if (mAdaptedAllocation.getType().getArray(arrayNum) == 0) { @@ -242,7 +242,7 @@ public class AllocationAdapter extends Allocation { } /** - * @hide + * * * Create an arbitrary window into the base allocation * The type describes the shape of the window. diff --git a/rs/java/android/renderscript/RenderScript.java b/rs/java/android/renderscript/RenderScript.java index 45f0ca6..e8e942c 100644 --- a/rs/java/android/renderscript/RenderScript.java +++ b/rs/java/android/renderscript/RenderScript.java @@ -24,7 +24,6 @@ import android.content.Context; import android.content.res.AssetManager; import android.graphics.Bitmap; import android.graphics.SurfaceTexture; -import android.os.Process; import android.util.Log; import android.view.Surface; import android.os.SystemProperties; diff --git a/rs/jni/Android.mk b/rs/jni/Android.mk index f1f0bfc..94f0859 100644 --- a/rs/jni/Android.mk +++ b/rs/jni/Android.mk @@ -14,7 +14,8 @@ LOCAL_SHARED_LIBRARIES := \ libskia \ libutils \ libui \ - libgui + libgui \ + libjnigraphics LOCAL_STATIC_LIBRARIES := @@ -23,6 +24,7 @@ rs_generated_include_dir := $(call intermediates-dir-for,SHARED_LIBRARIES,libRS, LOCAL_C_INCLUDES += \ $(JNI_H_INCLUDE) \ frameworks/rs \ + frameworks/base/core/jni \ $(rs_generated_include_dir) LOCAL_CFLAGS += -Wno-unused-parameter -std=c++11 diff --git a/rs/jni/android_renderscript_RenderScript.cpp b/rs/jni/android_renderscript_RenderScript.cpp index ba20881..886845c 100644 --- a/rs/jni/android_renderscript_RenderScript.cpp +++ b/rs/jni/android_renderscript_RenderScript.cpp @@ -24,8 +24,6 @@ #include <utils/misc.h> #include <inttypes.h> -#include <SkBitmap.h> - #include <androidfw/Asset.h> #include <androidfw/AssetManager.h> #include <androidfw/ResourceTypes.h> @@ -35,6 +33,7 @@ #include "android_runtime/AndroidRuntime.h" #include "android_runtime/android_view_Surface.h" #include "android_runtime/android_util_AssetManager.h" +#include "android/graphics/GraphicsJNI.h" #include <rs.h> #include <rsEnv.h> @@ -281,14 +280,10 @@ private: // --------------------------------------------------------------------------- static jfieldID gContextId = 0; -static jfieldID gNativeBitmapID = 0; static void _nInit(JNIEnv *_env, jclass _this) { gContextId = _env->GetFieldID(_this, "mContext", "J"); - - jclass bitmapClass = _env->FindClass("android/graphics/Bitmap"); - gNativeBitmapID = _env->GetFieldID(bitmapClass, "mNativeBitmap", "J"); } // --------------------------------------------------------------------------- @@ -1069,7 +1064,7 @@ nAllocationCreateFromBitmap(JNIEnv *_env, jobject _this, jlong con, jlong type, jobject jbitmap, jint usage) { SkBitmap const * nativeBitmap = - (SkBitmap const *)_env->GetLongField(jbitmap, gNativeBitmapID); + GraphicsJNI::getSkBitmap(_env, jbitmap); const SkBitmap& bitmap(*nativeBitmap); bitmap.lockPixels(); @@ -1086,7 +1081,7 @@ nAllocationCreateBitmapBackedAllocation(JNIEnv *_env, jobject _this, jlong con, jint mip, jobject jbitmap, jint usage) { SkBitmap const * nativeBitmap = - (SkBitmap const *)_env->GetLongField(jbitmap, gNativeBitmapID); + GraphicsJNI::getSkBitmap(_env, jbitmap); const SkBitmap& bitmap(*nativeBitmap); bitmap.lockPixels(); @@ -1103,7 +1098,7 @@ nAllocationCubeCreateFromBitmap(JNIEnv *_env, jobject _this, jlong con, jlong ty jobject jbitmap, jint usage) { SkBitmap const * nativeBitmap = - (SkBitmap const *)_env->GetLongField(jbitmap, gNativeBitmapID); + GraphicsJNI::getSkBitmap(_env, jbitmap); const SkBitmap& bitmap(*nativeBitmap); bitmap.lockPixels(); @@ -1119,7 +1114,7 @@ static void nAllocationCopyFromBitmap(JNIEnv *_env, jobject _this, jlong con, jlong alloc, jobject jbitmap) { SkBitmap const * nativeBitmap = - (SkBitmap const *)_env->GetLongField(jbitmap, gNativeBitmapID); + GraphicsJNI::getSkBitmap(_env, jbitmap); const SkBitmap& bitmap(*nativeBitmap); int w = bitmap.width(); int h = bitmap.height(); @@ -1136,7 +1131,7 @@ static void nAllocationCopyToBitmap(JNIEnv *_env, jobject _this, jlong con, jlong alloc, jobject jbitmap) { SkBitmap const * nativeBitmap = - (SkBitmap const *)_env->GetLongField(jbitmap, gNativeBitmapID); + GraphicsJNI::getSkBitmap(_env, jbitmap); const SkBitmap& bitmap(*nativeBitmap); bitmap.lockPixels(); |
