Loading graphics/jni/android_renderscript_RenderScript.cpp +26 −10 Original line number Diff line number Diff line Loading @@ -197,7 +197,7 @@ nContextSetSurface(JNIEnv *_env, jobject _this, RsContext con, jint width, jint window = (Surface*) android_Surface_getNativeWindow(_env, wnd).get(); } rsContextSetSurface(con, width, height, window); rsContextSetSurface(con, width, height, window, 1); } static void Loading Loading @@ -309,7 +309,11 @@ nElementCreate2(JNIEnv *_env, jobject _this, RsContext con, jintArray _ids, jobj nameArray[ct] = _env->GetStringUTFChars(s, NULL); sizeArray[ct] = _env->GetStringUTFLength(s); } jint id = (jint)rsElementCreate2(con, fieldCount, (RsElement *)ids, nameArray, sizeArray, (const uint32_t *)arraySizes); jint id = (jint)rsElementCreate2(con, (RsElement *)ids, fieldCount, nameArray, fieldCount, sizeArray, fieldCount, (const uint32_t *)arraySizes, fieldCount); for (int ct=0; ct < fieldCount; ct++) { jstring s = (jstring)_env->GetObjectArrayElement(_names, ct); _env->ReleaseStringUTFChars(s, nameArray[ct]); Loading Loading @@ -579,7 +583,8 @@ nAllocationRead_i(JNIEnv *_env, jobject _this, RsContext con, jint alloc, jintAr jint len = _env->GetArrayLength(data); LOG_API("nAllocationRead_i, con(%p), alloc(%p), len(%i)", con, (RsAllocation)alloc, len); jint *ptr = _env->GetIntArrayElements(data, NULL); rsAllocationRead(con, (RsAllocation)alloc, ptr); jsize length = _env->GetArrayLength(data); rsAllocationRead(con, (RsAllocation)alloc, ptr, length); _env->ReleaseIntArrayElements(data, ptr, 0); } Loading @@ -589,7 +594,8 @@ nAllocationRead_s(JNIEnv *_env, jobject _this, RsContext con, jint alloc, jshort jint len = _env->GetArrayLength(data); LOG_API("nAllocationRead_i, con(%p), alloc(%p), len(%i)", con, (RsAllocation)alloc, len); jshort *ptr = _env->GetShortArrayElements(data, NULL); rsAllocationRead(con, (RsAllocation)alloc, ptr); jsize length = _env->GetArrayLength(data); rsAllocationRead(con, (RsAllocation)alloc, ptr, length); _env->ReleaseShortArrayElements(data, ptr, 0); } Loading @@ -599,7 +605,8 @@ nAllocationRead_b(JNIEnv *_env, jobject _this, RsContext con, jint alloc, jbyteA jint len = _env->GetArrayLength(data); LOG_API("nAllocationRead_i, con(%p), alloc(%p), len(%i)", con, (RsAllocation)alloc, len); jbyte *ptr = _env->GetByteArrayElements(data, NULL); rsAllocationRead(con, (RsAllocation)alloc, ptr); jsize length = _env->GetArrayLength(data); rsAllocationRead(con, (RsAllocation)alloc, ptr, length); _env->ReleaseByteArrayElements(data, ptr, 0); } Loading @@ -609,7 +616,8 @@ nAllocationRead_f(JNIEnv *_env, jobject _this, RsContext con, jint alloc, jfloat jint len = _env->GetArrayLength(data); LOG_API("nAllocationRead_f, con(%p), alloc(%p), len(%i)", con, (RsAllocation)alloc, len); jfloat *ptr = _env->GetFloatArrayElements(data, NULL); rsAllocationRead(con, (RsAllocation)alloc, ptr); jsize length = _env->GetArrayLength(data); rsAllocationRead(con, (RsAllocation)alloc, ptr, length); _env->ReleaseFloatArrayElements(data, ptr, 0); } Loading Loading @@ -713,7 +721,9 @@ nFontCreateFromFile(JNIEnv *_env, jobject _this, RsContext con, jstring fileName, jfloat fontSize, jint dpi) { AutoJavaStringToUTF8 fileNameUTF(_env, fileName); jint id = (jint)rsFontCreateFromFile(con, fileNameUTF.c_str(), fontSize, dpi); jint id = (jint)rsFontCreateFromFile(con, fileNameUTF.c_str(), fileNameUTF.length(), fontSize, dpi); return id; } Loading @@ -725,7 +735,9 @@ nFontCreateFromAssetStream(JNIEnv *_env, jobject _this, RsContext con, Asset* asset = reinterpret_cast<Asset*>(native_asset); AutoJavaStringToUTF8 nameUTF(_env, name); jint id = (jint)rsFontCreateFromMemory(con, nameUTF.c_str(), fontSize, dpi, jint id = (jint)rsFontCreateFromMemory(con, nameUTF.c_str(), nameUTF.length(), fontSize, dpi, asset->getBuffer(false), asset->getLength()); return id; } Loading @@ -745,7 +757,9 @@ nFontCreateFromAsset(JNIEnv *_env, jobject _this, RsContext con, jobject _assetM return 0; } jint id = (jint)rsFontCreateFromMemory(con, str.c_str(), fontSize, dpi, jint id = (jint)rsFontCreateFromMemory(con, str.c_str(), str.length(), fontSize, dpi, asset->getBuffer(false), asset->getLength()); delete asset; return id; Loading Loading @@ -877,7 +891,9 @@ nScriptCCreate(JNIEnv *_env, jobject _this, RsContext con, //rsScriptCSetText(con, (const char *)script_ptr, length); ret = (jint)rsScriptCCreate(con, resNameUTF.c_str(), cacheDirUTF.c_str(), ret = (jint)rsScriptCCreate(con, resNameUTF.c_str(), resNameUTF.length(), cacheDirUTF.c_str(), cacheDirUTF.length(), (const char *)script_ptr, length); exit: Loading libs/rs/rs.spec +2 −29 Original line number Diff line number Diff line Loading @@ -51,9 +51,8 @@ ContextDestroyWorker { } AssignName { param void *obj param RsObjectBase obj param const char *name param size_t len } ObjDestroy { Loading @@ -69,7 +68,6 @@ ElementCreate { } ElementCreate2 { param size_t count param const RsElement * elements param const char ** names param const size_t * nameLengths Loading @@ -80,7 +78,6 @@ ElementCreate2 { AllocationCopyToBitmap { param RsAllocation alloc param void * data param size_t dataLen } Loading @@ -90,7 +87,6 @@ Allocation1DData { param uint32_t lod param uint32_t count param const void *data param uint32_t bytes handcodeApi togglePlay } Loading @@ -101,7 +97,6 @@ Allocation1DElementData { param uint32_t lod param const void *data param uint32_t comp_offset param uint32_t bytes handcodeApi togglePlay } Loading @@ -115,7 +110,6 @@ Allocation2DData { param uint32_t w param uint32_t h param const void *data param uint32_t bytes } Allocation2DElementData { Loading @@ -126,7 +120,6 @@ Allocation2DElementData { param RsAllocationCubemapFace face param const void *data param uint32_t element_offset param uint32_t bytes } AllocationGenerateMipmaps { Loading Loading @@ -184,7 +177,6 @@ ScriptBindAllocation { ScriptSetTimeZone { param RsScript s param const char * timeZone param uint32_t length } Loading @@ -197,7 +189,6 @@ ScriptInvokeV { param RsScript s param uint32_t slot param const void * data param uint32_t dataLen handcodeApi togglePlay } Loading Loading @@ -236,7 +227,6 @@ ScriptSetVarV { param RsScript s param uint32_t slot param const void * data param uint32_t dataLen handcodeApi togglePlay } Loading @@ -246,7 +236,6 @@ ScriptCCreate { param const char * resName param const char * cacheDir param const char * text param uint32_t length ret RsScript } Loading Loading @@ -294,17 +283,13 @@ ProgramBindSampler { ProgramFragmentCreate { param const char * shaderText param uint32_t shaderLength param const uint32_t * params param uint32_t paramLength ret RsProgramFragment } ProgramVertexCreate { param const char * shaderText param uint32_t shaderLength param const uint32_t * params param uint32_t paramLength ret RsProgramVertex } Loading @@ -320,7 +305,6 @@ FontCreateFromMemory { param float fontSize param uint32_t dpi param const void *data param uint32_t dataLen ret RsFont } Loading @@ -346,14 +330,3 @@ MeshBindVertex { MeshInitVertexAttribs { param RsMesh mesh } AnimationCreate { param const float *inValues param const float *outValues param uint32_t valueCount param RsAnimationInterpolation interp param RsAnimationEdge pre param RsAnimationEdge post ret RsAnimation } libs/rs/rsAllocation.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -780,7 +780,7 @@ void rsi_Allocation2DData(Context *rsc, RsAllocation va, uint32_t xoff, uint32_t a->data(rsc, xoff, yoff, lod, face, w, h, data, sizeBytes); } void rsi_AllocationRead(Context *rsc, RsAllocation va, void *data) { void rsi_AllocationRead(Context *rsc, RsAllocation va, void *data, size_t data_length) { Allocation *a = static_cast<Allocation *>(va); a->read(data); } Loading libs/rs/rsContext.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -705,9 +705,9 @@ void rsi_ContextBindFont(Context *rsc, RsFont vfont) { rsc->setFont(font); } void rsi_AssignName(Context *rsc, void * obj, const char *name, uint32_t len) { void rsi_AssignName(Context *rsc, RsObjectBase obj, const char *name, uint32_t name_length) { ObjectBase *ob = static_cast<ObjectBase *>(obj); rsc->assignName(ob, name, len); rsc->assignName(ob, name, name_length); } void rsi_ObjDestroy(Context *rsc, void *optr) { Loading @@ -724,7 +724,7 @@ void rsi_ContextResume(Context *rsc) { rsc->resume(); } void rsi_ContextSetSurface(Context *rsc, uint32_t w, uint32_t h, ANativeWindow *sur) { void rsi_ContextSetSurface(Context *rsc, uint32_t w, uint32_t h, ANativeWindow *sur, size_t sur_length) { rsc->setSurface(w, h, sur); } Loading libs/rs/rsElement.cpp +6 −3 Original line number Diff line number Diff line Loading @@ -348,12 +348,15 @@ RsElement rsi_ElementCreate(Context *rsc, } RsElement rsi_ElementCreate2(Context *rsc, size_t count, const RsElement * ein, size_t ein_length, const char ** names, size_t names_length, const size_t * nameLengths, const uint32_t * arraySizes) { const Element *e = Element::create(rsc, count, (const Element **)ein, names, nameLengths, arraySizes); size_t nameLengths_length, const uint32_t * arraySizes, size_t arraySizes_length) { const Element *e = Element::create(rsc, ein_length, (const Element **)ein, names, nameLengths, arraySizes); e->incUserRef(); return (RsElement)e; } Loading Loading
graphics/jni/android_renderscript_RenderScript.cpp +26 −10 Original line number Diff line number Diff line Loading @@ -197,7 +197,7 @@ nContextSetSurface(JNIEnv *_env, jobject _this, RsContext con, jint width, jint window = (Surface*) android_Surface_getNativeWindow(_env, wnd).get(); } rsContextSetSurface(con, width, height, window); rsContextSetSurface(con, width, height, window, 1); } static void Loading Loading @@ -309,7 +309,11 @@ nElementCreate2(JNIEnv *_env, jobject _this, RsContext con, jintArray _ids, jobj nameArray[ct] = _env->GetStringUTFChars(s, NULL); sizeArray[ct] = _env->GetStringUTFLength(s); } jint id = (jint)rsElementCreate2(con, fieldCount, (RsElement *)ids, nameArray, sizeArray, (const uint32_t *)arraySizes); jint id = (jint)rsElementCreate2(con, (RsElement *)ids, fieldCount, nameArray, fieldCount, sizeArray, fieldCount, (const uint32_t *)arraySizes, fieldCount); for (int ct=0; ct < fieldCount; ct++) { jstring s = (jstring)_env->GetObjectArrayElement(_names, ct); _env->ReleaseStringUTFChars(s, nameArray[ct]); Loading Loading @@ -579,7 +583,8 @@ nAllocationRead_i(JNIEnv *_env, jobject _this, RsContext con, jint alloc, jintAr jint len = _env->GetArrayLength(data); LOG_API("nAllocationRead_i, con(%p), alloc(%p), len(%i)", con, (RsAllocation)alloc, len); jint *ptr = _env->GetIntArrayElements(data, NULL); rsAllocationRead(con, (RsAllocation)alloc, ptr); jsize length = _env->GetArrayLength(data); rsAllocationRead(con, (RsAllocation)alloc, ptr, length); _env->ReleaseIntArrayElements(data, ptr, 0); } Loading @@ -589,7 +594,8 @@ nAllocationRead_s(JNIEnv *_env, jobject _this, RsContext con, jint alloc, jshort jint len = _env->GetArrayLength(data); LOG_API("nAllocationRead_i, con(%p), alloc(%p), len(%i)", con, (RsAllocation)alloc, len); jshort *ptr = _env->GetShortArrayElements(data, NULL); rsAllocationRead(con, (RsAllocation)alloc, ptr); jsize length = _env->GetArrayLength(data); rsAllocationRead(con, (RsAllocation)alloc, ptr, length); _env->ReleaseShortArrayElements(data, ptr, 0); } Loading @@ -599,7 +605,8 @@ nAllocationRead_b(JNIEnv *_env, jobject _this, RsContext con, jint alloc, jbyteA jint len = _env->GetArrayLength(data); LOG_API("nAllocationRead_i, con(%p), alloc(%p), len(%i)", con, (RsAllocation)alloc, len); jbyte *ptr = _env->GetByteArrayElements(data, NULL); rsAllocationRead(con, (RsAllocation)alloc, ptr); jsize length = _env->GetArrayLength(data); rsAllocationRead(con, (RsAllocation)alloc, ptr, length); _env->ReleaseByteArrayElements(data, ptr, 0); } Loading @@ -609,7 +616,8 @@ nAllocationRead_f(JNIEnv *_env, jobject _this, RsContext con, jint alloc, jfloat jint len = _env->GetArrayLength(data); LOG_API("nAllocationRead_f, con(%p), alloc(%p), len(%i)", con, (RsAllocation)alloc, len); jfloat *ptr = _env->GetFloatArrayElements(data, NULL); rsAllocationRead(con, (RsAllocation)alloc, ptr); jsize length = _env->GetArrayLength(data); rsAllocationRead(con, (RsAllocation)alloc, ptr, length); _env->ReleaseFloatArrayElements(data, ptr, 0); } Loading Loading @@ -713,7 +721,9 @@ nFontCreateFromFile(JNIEnv *_env, jobject _this, RsContext con, jstring fileName, jfloat fontSize, jint dpi) { AutoJavaStringToUTF8 fileNameUTF(_env, fileName); jint id = (jint)rsFontCreateFromFile(con, fileNameUTF.c_str(), fontSize, dpi); jint id = (jint)rsFontCreateFromFile(con, fileNameUTF.c_str(), fileNameUTF.length(), fontSize, dpi); return id; } Loading @@ -725,7 +735,9 @@ nFontCreateFromAssetStream(JNIEnv *_env, jobject _this, RsContext con, Asset* asset = reinterpret_cast<Asset*>(native_asset); AutoJavaStringToUTF8 nameUTF(_env, name); jint id = (jint)rsFontCreateFromMemory(con, nameUTF.c_str(), fontSize, dpi, jint id = (jint)rsFontCreateFromMemory(con, nameUTF.c_str(), nameUTF.length(), fontSize, dpi, asset->getBuffer(false), asset->getLength()); return id; } Loading @@ -745,7 +757,9 @@ nFontCreateFromAsset(JNIEnv *_env, jobject _this, RsContext con, jobject _assetM return 0; } jint id = (jint)rsFontCreateFromMemory(con, str.c_str(), fontSize, dpi, jint id = (jint)rsFontCreateFromMemory(con, str.c_str(), str.length(), fontSize, dpi, asset->getBuffer(false), asset->getLength()); delete asset; return id; Loading Loading @@ -877,7 +891,9 @@ nScriptCCreate(JNIEnv *_env, jobject _this, RsContext con, //rsScriptCSetText(con, (const char *)script_ptr, length); ret = (jint)rsScriptCCreate(con, resNameUTF.c_str(), cacheDirUTF.c_str(), ret = (jint)rsScriptCCreate(con, resNameUTF.c_str(), resNameUTF.length(), cacheDirUTF.c_str(), cacheDirUTF.length(), (const char *)script_ptr, length); exit: Loading
libs/rs/rs.spec +2 −29 Original line number Diff line number Diff line Loading @@ -51,9 +51,8 @@ ContextDestroyWorker { } AssignName { param void *obj param RsObjectBase obj param const char *name param size_t len } ObjDestroy { Loading @@ -69,7 +68,6 @@ ElementCreate { } ElementCreate2 { param size_t count param const RsElement * elements param const char ** names param const size_t * nameLengths Loading @@ -80,7 +78,6 @@ ElementCreate2 { AllocationCopyToBitmap { param RsAllocation alloc param void * data param size_t dataLen } Loading @@ -90,7 +87,6 @@ Allocation1DData { param uint32_t lod param uint32_t count param const void *data param uint32_t bytes handcodeApi togglePlay } Loading @@ -101,7 +97,6 @@ Allocation1DElementData { param uint32_t lod param const void *data param uint32_t comp_offset param uint32_t bytes handcodeApi togglePlay } Loading @@ -115,7 +110,6 @@ Allocation2DData { param uint32_t w param uint32_t h param const void *data param uint32_t bytes } Allocation2DElementData { Loading @@ -126,7 +120,6 @@ Allocation2DElementData { param RsAllocationCubemapFace face param const void *data param uint32_t element_offset param uint32_t bytes } AllocationGenerateMipmaps { Loading Loading @@ -184,7 +177,6 @@ ScriptBindAllocation { ScriptSetTimeZone { param RsScript s param const char * timeZone param uint32_t length } Loading @@ -197,7 +189,6 @@ ScriptInvokeV { param RsScript s param uint32_t slot param const void * data param uint32_t dataLen handcodeApi togglePlay } Loading Loading @@ -236,7 +227,6 @@ ScriptSetVarV { param RsScript s param uint32_t slot param const void * data param uint32_t dataLen handcodeApi togglePlay } Loading @@ -246,7 +236,6 @@ ScriptCCreate { param const char * resName param const char * cacheDir param const char * text param uint32_t length ret RsScript } Loading Loading @@ -294,17 +283,13 @@ ProgramBindSampler { ProgramFragmentCreate { param const char * shaderText param uint32_t shaderLength param const uint32_t * params param uint32_t paramLength ret RsProgramFragment } ProgramVertexCreate { param const char * shaderText param uint32_t shaderLength param const uint32_t * params param uint32_t paramLength ret RsProgramVertex } Loading @@ -320,7 +305,6 @@ FontCreateFromMemory { param float fontSize param uint32_t dpi param const void *data param uint32_t dataLen ret RsFont } Loading @@ -346,14 +330,3 @@ MeshBindVertex { MeshInitVertexAttribs { param RsMesh mesh } AnimationCreate { param const float *inValues param const float *outValues param uint32_t valueCount param RsAnimationInterpolation interp param RsAnimationEdge pre param RsAnimationEdge post ret RsAnimation }
libs/rs/rsAllocation.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -780,7 +780,7 @@ void rsi_Allocation2DData(Context *rsc, RsAllocation va, uint32_t xoff, uint32_t a->data(rsc, xoff, yoff, lod, face, w, h, data, sizeBytes); } void rsi_AllocationRead(Context *rsc, RsAllocation va, void *data) { void rsi_AllocationRead(Context *rsc, RsAllocation va, void *data, size_t data_length) { Allocation *a = static_cast<Allocation *>(va); a->read(data); } Loading
libs/rs/rsContext.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -705,9 +705,9 @@ void rsi_ContextBindFont(Context *rsc, RsFont vfont) { rsc->setFont(font); } void rsi_AssignName(Context *rsc, void * obj, const char *name, uint32_t len) { void rsi_AssignName(Context *rsc, RsObjectBase obj, const char *name, uint32_t name_length) { ObjectBase *ob = static_cast<ObjectBase *>(obj); rsc->assignName(ob, name, len); rsc->assignName(ob, name, name_length); } void rsi_ObjDestroy(Context *rsc, void *optr) { Loading @@ -724,7 +724,7 @@ void rsi_ContextResume(Context *rsc) { rsc->resume(); } void rsi_ContextSetSurface(Context *rsc, uint32_t w, uint32_t h, ANativeWindow *sur) { void rsi_ContextSetSurface(Context *rsc, uint32_t w, uint32_t h, ANativeWindow *sur, size_t sur_length) { rsc->setSurface(w, h, sur); } Loading
libs/rs/rsElement.cpp +6 −3 Original line number Diff line number Diff line Loading @@ -348,12 +348,15 @@ RsElement rsi_ElementCreate(Context *rsc, } RsElement rsi_ElementCreate2(Context *rsc, size_t count, const RsElement * ein, size_t ein_length, const char ** names, size_t names_length, const size_t * nameLengths, const uint32_t * arraySizes) { const Element *e = Element::create(rsc, count, (const Element **)ein, names, nameLengths, arraySizes); size_t nameLengths_length, const uint32_t * arraySizes, size_t arraySizes_length) { const Element *e = Element::create(rsc, ein_length, (const Element **)ein, names, nameLengths, arraySizes); e->incUserRef(); return (RsElement)e; } Loading