summaryrefslogtreecommitdiffstats
path: root/graphics/jni
diff options
context:
space:
mode:
authorJason Sams <rjsams@android.com>2009-09-23 13:57:02 -0700
committerJason Sams <rjsams@android.com>2009-09-23 13:57:02 -0700
commitebfb436a49673693b98469683451bd9ede797557 (patch)
tree62300ba279079ae34c56dc883430afe4b336f7c6 /graphics/jni
parent59038ca98b5f258784687523ee3be11b5dfa995d (diff)
downloadframeworks_base-ebfb436a49673693b98469683451bd9ede797557.zip
frameworks_base-ebfb436a49673693b98469683451bd9ede797557.tar.gz
frameworks_base-ebfb436a49673693b98469683451bd9ede797557.tar.bz2
Add raster object to control point and line params. Add flag to force SW rendering.
Diffstat (limited to 'graphics/jni')
-rw-r--r--graphics/jni/android_renderscript_RenderScript.cpp49
1 files changed, 49 insertions, 0 deletions
diff --git a/graphics/jni/android_renderscript_RenderScript.cpp b/graphics/jni/android_renderscript_RenderScript.cpp
index 56a4223..4a8f8a3 100644
--- a/graphics/jni/android_renderscript_RenderScript.cpp
+++ b/graphics/jni/android_renderscript_RenderScript.cpp
@@ -143,6 +143,13 @@ nDeviceDestroy(JNIEnv *_env, jobject _this, jint dev)
return rsDeviceDestroy((RsDevice)dev);
}
+static void
+nDeviceSetConfig(JNIEnv *_env, jobject _this, jint dev, jint p, jint value)
+{
+ LOG_API("nDeviceSetConfig dev(%p), param(%i), value(%i)", (void *)dev, p, value);
+ return rsDeviceSetConfig((RsDevice)dev, (RsDeviceParam)p, value);
+}
+
static jint
nContextCreate(JNIEnv *_env, jobject _this, jint dev, jobject wnd, jint ver, jboolean useDepth)
{
@@ -1132,6 +1139,34 @@ nProgramVertexCreate(JNIEnv *_env, jobject _this)
}
+// ---------------------------------------------------------------------------
+
+static jint
+nProgramRasterCreate(JNIEnv *_env, jobject _this, jint in, jint out,
+ jboolean pointSmooth, jboolean lineSmooth, jboolean pointSprite)
+{
+ RsContext con = (RsContext)(_env->GetIntField(_this, gContextId));
+ LOG_API("nProgramRasterCreate, con(%p), in(%p), out(%p), pointSmooth(%i), lineSmooth(%i), pointSprite(%i)",
+ con, (RsElement)in, (RsElement)out, pointSmooth, lineSmooth, pointSprite);
+ return (jint)rsProgramRasterCreate(con, (RsElement)in, (RsElement)out, pointSmooth, lineSmooth, pointSprite);
+}
+
+static void
+nProgramRasterSetPointSize(JNIEnv *_env, jobject _this, jint vpr, jfloat v)
+{
+ RsContext con = (RsContext)(_env->GetIntField(_this, gContextId));
+ LOG_API("nProgramRasterSetPointSize, con(%p), vpf(%p), value(%f)", con, (RsProgramRaster)vpr, v);
+ rsProgramRasterSetPointSize(con, (RsProgramFragment)vpr, v);
+}
+
+static void
+nProgramRasterSetLineWidth(JNIEnv *_env, jobject _this, jint vpr, jfloat v)
+{
+ RsContext con = (RsContext)(_env->GetIntField(_this, gContextId));
+ LOG_API("nProgramRasterSetLineWidth, con(%p), vpf(%p), value(%f)", con, (RsProgramRaster)vpr, v);
+ rsProgramRasterSetLineWidth(con, (RsProgramFragment)vpr, v);
+}
+
// ---------------------------------------------------------------------------
@@ -1168,6 +1203,14 @@ nContextBindProgramVertex(JNIEnv *_env, jobject _this, jint pf)
}
static void
+nContextBindProgramRaster(JNIEnv *_env, jobject _this, jint pf)
+{
+ RsContext con = (RsContext)(_env->GetIntField(_this, gContextId));
+ LOG_API("nContextBindProgramRaster, con(%p), pf(%p)", con, (RsProgramRaster)pf);
+ rsContextBindProgramRaster(con, (RsProgramRaster)pf);
+}
+
+static void
nContextAddDefineI32(JNIEnv *_env, jobject _this, jstring name, jint value)
{
RsContext con = (RsContext)(_env->GetIntField(_this, gContextId));
@@ -1306,6 +1349,7 @@ static JNINativeMethod methods[] = {
{"nDeviceCreate", "()I", (void*)nDeviceCreate },
{"nDeviceDestroy", "(I)V", (void*)nDeviceDestroy },
+{"nDeviceSetConfig", "(III)V", (void*)nDeviceSetConfig },
{"nContextCreate", "(ILandroid/view/Surface;IZ)I", (void*)nContextCreate },
{"nContextDestroy", "(I)V", (void*)nContextDestroy },
{"nAssignName", "(I[B)V", (void*)nAssignName },
@@ -1396,6 +1440,10 @@ static JNINativeMethod methods[] = {
{"nProgramFragmentSetSlot", "(IZII)V", (void*)nProgramFragmentSetSlot },
{"nProgramFragmentCreate", "()I", (void*)nProgramFragmentCreate },
+{"nProgramRasterCreate", "(IIZZZ)I", (void*)nProgramRasterCreate },
+{"nProgramRasterSetPointSize", "(IF)V", (void*)nProgramRasterSetPointSize },
+{"nProgramRasterSetLineWidth", "(IF)V", (void*)nProgramRasterSetLineWidth },
+
{"nProgramVertexBindAllocation", "(II)V", (void*)nProgramVertexBindAllocation },
{"nProgramVertexBegin", "(II)V", (void*)nProgramVertexBegin },
{"nProgramVertexSetTextureMatrixEnable", "(Z)V", (void*)nProgramVertexSetTextureMatrixEnable },
@@ -1413,6 +1461,7 @@ static JNINativeMethod methods[] = {
{"nContextBindProgramFragmentStore","(I)V", (void*)nContextBindProgramFragmentStore },
{"nContextBindProgramFragment", "(I)V", (void*)nContextBindProgramFragment },
{"nContextBindProgramVertex", "(I)V", (void*)nContextBindProgramVertex },
+{"nContextBindProgramRaster", "(I)V", (void*)nContextBindProgramRaster },
{"nSamplerBegin", "()V", (void*)nSamplerBegin },
{"nSamplerSet", "(II)V", (void*)nSamplerSet },