diff options
author | Alex Sakhartchouk <alexst@google.com> | 2010-12-21 14:43:30 -0800 |
---|---|---|
committer | Alex Sakhartchouk <alexst@google.com> | 2010-12-21 14:57:05 -0800 |
commit | c3842427d8cc634a45b2fe0966005e17949a0e36 (patch) | |
tree | 8cf67af5a4641d4cf9b638f71599352894e19880 /src/com/android | |
parent | 577d017732abf9969e9a5c1b6aa3ffb5b8fdae7f (diff) | |
download | packages_apps_trebuchet-c3842427d8cc634a45b2fe0966005e17949a0e36.zip packages_apps_trebuchet-c3842427d8cc634a45b2fe0966005e17949a0e36.tar.gz packages_apps_trebuchet-c3842427d8cc634a45b2fe0966005e17949a0e36.tar.bz2 |
renderscript API cleanup
Change-Id: I76b9ceccd73d7f1b83853763755e1ba28e009614
Diffstat (limited to 'src/com/android')
-rw-r--r-- | src/com/android/launcher2/AllApps3D.java | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/src/com/android/launcher2/AllApps3D.java b/src/com/android/launcher2/AllApps3D.java index 9f40b55..2ecf761 100644 --- a/src/com/android/launcher2/AllApps3D.java +++ b/src/com/android/launcher2/AllApps3D.java @@ -937,7 +937,7 @@ public class AllApps3D extends RSSurfaceView ScriptC_allapps mScript; private Mesh mMesh; - private ProgramVertex.MatrixAllocation mPVA; + private ProgramVertexFixedFunction.Constants mPVA; private ScriptField_VpConsts mUniformAlloc; @@ -1039,7 +1039,7 @@ public class AllApps3D extends RSSurfaceView void resize(int w, int h) { Matrix4f proj = getProjectionMatrix(w, h); - mPVA.loadProjection(proj); + mPVA.setProjection(proj); if (mUniformAlloc != null) { ScriptField_VpConsts.Item i = new ScriptField_VpConsts.Item(); @@ -1063,20 +1063,20 @@ public class AllApps3D extends RSSurfaceView } private void initProgramVertex() { - mPVA = new ProgramVertex.MatrixAllocation(sRS); + mPVA = new ProgramVertexFixedFunction.Constants(sRS); resize(mWidth, mHeight); - ProgramVertex.Builder pvb = new ProgramVertex.Builder(sRS, null, null); + ProgramVertexFixedFunction.Builder pvb = new ProgramVertexFixedFunction.Builder(sRS); pvb.setTextureMatrixEnable(true); ProgramVertex pv = pvb.create(); - pv.bindAllocation(mPVA); + ((ProgramVertexFixedFunction)pv).bindConstants(mPVA); sRS.bindProgramVertex(pv); mUniformAlloc = new ScriptField_VpConsts(sRS, 1); mScript.bind_vpConstants(mUniformAlloc); initMesh(); - ProgramVertex.ShaderBuilder sb = new ProgramVertex.ShaderBuilder(sRS); + ProgramVertex.Builder sb = new ProgramVertex.Builder(sRS); String t = "varying vec4 varColor;\n" + "varying vec2 varTex0;\n" + "void main() {\n" + @@ -1145,19 +1145,19 @@ public class AllApps3D extends RSSurfaceView private void initProgramFragment() { Sampler.Builder sb = new Sampler.Builder(sRS); - sb.setMin(Sampler.Value.LINEAR_MIP_LINEAR); - sb.setMag(Sampler.Value.NEAREST); + sb.setMinification(Sampler.Value.LINEAR_MIP_LINEAR); + sb.setMagnification(Sampler.Value.NEAREST); sb.setWrapS(Sampler.Value.CLAMP); sb.setWrapT(Sampler.Value.CLAMP); Sampler linear = sb.create(); - sb.setMin(Sampler.Value.NEAREST); - sb.setMag(Sampler.Value.NEAREST); + sb.setMinification(Sampler.Value.NEAREST); + sb.setMagnification(Sampler.Value.NEAREST); Sampler nearest = sb.create(); - ProgramFragment.Builder bf = new ProgramFragment.Builder(sRS); - bf.setTexture(ProgramFragment.Builder.EnvMode.MODULATE, - ProgramFragment.Builder.Format.RGBA, 0); + ProgramFragmentFixedFunction.Builder bf = new ProgramFragmentFixedFunction.Builder(sRS); + bf.setTexture(ProgramFragmentFixedFunction.Builder.EnvMode.MODULATE, + ProgramFragmentFixedFunction.Builder.Format.RGBA, 0); bf.setVaryingColor(true); ProgramFragment pfTexMip = bf.create(); pfTexMip.bindSampler(linear, 0); @@ -1166,8 +1166,8 @@ public class AllApps3D extends RSSurfaceView ProgramFragment pfTexNearest = bf.create(); pfTexNearest.bindSampler(nearest, 0); - bf.setTexture(ProgramFragment.Builder.EnvMode.MODULATE, - ProgramFragment.Builder.Format.ALPHA, 0); + bf.setTexture(ProgramFragmentFixedFunction.Builder.EnvMode.MODULATE, + ProgramFragmentFixedFunction.Builder.Format.ALPHA, 0); bf.setVaryingColor(true); ProgramFragment pfTexMipAlpha = bf.create(); pfTexMipAlpha.bindSampler(linear, 0); @@ -1178,10 +1178,10 @@ public class AllApps3D extends RSSurfaceView } private void initProgramStore() { - ProgramStore.Builder bs = new ProgramStore.Builder(sRS, null, null); + ProgramStore.Builder bs = new ProgramStore.Builder(sRS); bs.setDepthFunc(ProgramStore.DepthFunc.ALWAYS); - bs.setColorMask(true,true,true,false); - bs.setDitherEnable(true); + bs.setColorMaskEnabled(true,true,true,false); + bs.setDitherEnabled(true); bs.setBlendFunc(ProgramStore.BlendSrcFunc.SRC_ALPHA, ProgramStore.BlendDstFunc.ONE_MINUS_SRC_ALPHA); mScript.set_gPS(bs.create()); |