Merge change 25818 into eclair
* changes:
Clean up some debugging and add 2 math lib routines.
diff --git a/graphics/jni/android_renderscript_RenderScript.cpp b/graphics/jni/android_renderscript_RenderScript.cpp
index eae6f24..c7b5448 100644
--- a/graphics/jni/android_renderscript_RenderScript.cpp
+++ b/graphics/jni/android_renderscript_RenderScript.cpp
@@ -255,28 +255,24 @@
static void * SF_SaveInt(JNIEnv *_env, jobject _obj, jfieldID _field, void *buffer)
{
- LOGE("Save Int");
_env->SetIntField(_obj, _field, ((int32_t *)buffer)[0]);
return ((uint8_t *)buffer) + 4;
}
static void * SF_SaveShort(JNIEnv *_env, jobject _obj, jfieldID _field, void *buffer)
{
- LOGE("Save Short");
_env->SetShortField(_obj, _field, ((int16_t *)buffer)[0]);
return ((uint8_t *)buffer) + 2;
}
static void * SF_SaveByte(JNIEnv *_env, jobject _obj, jfieldID _field, void *buffer)
{
- LOGE("Save Byte");
_env->SetByteField(_obj, _field, ((int8_t *)buffer)[0]);
return ((uint8_t *)buffer) + 1;
}
static void * SF_SaveFloat(JNIEnv *_env, jobject _obj, jfieldID _field, void *buffer)
{
- LOGE("Save Float");
_env->SetFloatField(_obj, _field, ((float *)buffer)[0]);
return ((uint8_t *)buffer) + 4;
}
@@ -601,11 +597,8 @@
void * buf = bufAlloc;
rsAllocationRead(con, (RsAllocation)alloc, bufAlloc);
- LOGE("size %i, ", tc->size);
-
for (int ct=0; ct < tc->fieldCount; ct++) {
const TypeFieldCache *tfc = &tc->fields[ct];
- LOGE("ct=%i, buf=%p", ct, buf);
buf = tfc->readPtr(_env, _o, tfc->field, buf);
}
free(bufAlloc);
diff --git a/libs/rs/rsScriptC_Lib.cpp b/libs/rs/rsScriptC_Lib.cpp
index d10076b..6dc3e8b 100644
--- a/libs/rs/rsScriptC_Lib.cpp
+++ b/libs/rs/rsScriptC_Lib.cpp
@@ -321,6 +321,16 @@
return v * v;
}
+static float SC_fracf(float v)
+{
+ return v - floorf(v);
+}
+
+static float SC_roundf(float v)
+{
+ return floorf(v + 0.4999999999);
+}
+
static float SC_distf2(float x1, float y1, float x2, float y2)
{
float x = x2 - x1;
@@ -1014,8 +1024,12 @@
"float", "(float, float)" },
{ "floorf", (void *)&floorf,
"float", "(float)" },
+ { "fracf", (void *)&SC_fracf,
+ "float", "(float)" },
{ "ceilf", (void *)&ceilf,
"float", "(float)" },
+ { "roundf", (void *)&SC_roundf,
+ "float", "(float)" },
{ "expf", (void *)&expf,
"float", "(float)" },
{ "logf", (void *)&logf,