Loading libs/rs/Android.mk +1 −0 Original line number Diff line number Diff line Loading @@ -85,6 +85,7 @@ LOCAL_SRC_FILES:= \ rsContext.cpp \ rsDevice.cpp \ rsElement.cpp \ rsLight.cpp \ rsLocklessFifo.cpp \ rsObjectBase.cpp \ rsMatrix.cpp \ Loading libs/rs/RenderScript.h +1 −0 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ typedef void * RsScript; typedef void * RsScriptBasicTemp; typedef void * RsTriangleMesh; typedef void * RsType; typedef void * RsLight; typedef void * RsProgramVertex; typedef void * RsProgramFragment; Loading libs/rs/RenderScriptEnv.h +1 −0 Original line number Diff line number Diff line Loading @@ -14,6 +14,7 @@ typedef void * RsTriangleMesh; typedef void * RsType; typedef void * RsProgramFragment; typedef void * RsProgramFragmentStore; typedef void * RsLight; typedef struct { Loading libs/rs/java/Film/src/com/android/film/FilmRS.java +5 −0 Original line number Diff line number Diff line Loading @@ -85,6 +85,7 @@ public class FilmRS { private RenderScript.Allocation mAllocState; private RenderScript.Allocation mAllocPV; private RenderScript.TriangleMesh mMesh; private RenderScript.Light mLight; private float[] mBufferPos; private float[] mBufferPV; Loading Loading @@ -144,6 +145,10 @@ public class FilmRS { mPV = mRS.programVertexCreate(); mPV.setName("PV"); mRS.lightBegin(); mLight = mRS.lightCreate(); mLight.setPosition(0, -0.5f, -1.0f); Log.e("rs", "Done loading named"); } Loading libs/rs/java/RenderScript/android/renderscript/RenderScript.java +46 −0 Original line number Diff line number Diff line Loading @@ -157,6 +157,14 @@ public class RenderScript { native private void nProgramVertexSetTextureMatrixEnable(boolean enable); native private int nProgramVertexCreate(); native private void nLightBegin(); native private void nLightSetIsMono(boolean isMono); native private void nLightSetIsLocal(boolean isLocal); native private int nLightCreate(); native private void nLightDestroy(int l); native private void nLightSetColor(int l, float r, float g, float b); native private void nLightSetPosition(int l, float x, float y, float z); private int mDev; private int mContext; Loading Loading @@ -869,6 +877,44 @@ public class RenderScript { return new Sampler(id); } ////////////////////////////////////////////////////////////////////////////////// // Light public class Light extends BaseObj { Light(int id) { mID = id; } public void destroy() { nLightDestroy(mID); mID = 0; } public void setColor(float r, float g, float b) { nLightSetColor(mID, r, g, b); } public void setPosition(float x, float y, float z) { nLightSetPosition(mID, x, y, z); } } public void lightBegin() { nLightBegin(); } public void lightSetIsMono(boolean isMono) { nLightSetIsMono(isMono); } public void lightSetIsLocal(boolean isLocal) { nLightSetIsLocal(isLocal); } public Light lightCreate() { int id = nLightCreate(); return new Light(id); } /////////////////////////////////////////////////////////////////////////////////// // Root state Loading Loading
libs/rs/Android.mk +1 −0 Original line number Diff line number Diff line Loading @@ -85,6 +85,7 @@ LOCAL_SRC_FILES:= \ rsContext.cpp \ rsDevice.cpp \ rsElement.cpp \ rsLight.cpp \ rsLocklessFifo.cpp \ rsObjectBase.cpp \ rsMatrix.cpp \ Loading
libs/rs/RenderScript.h +1 −0 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ typedef void * RsScript; typedef void * RsScriptBasicTemp; typedef void * RsTriangleMesh; typedef void * RsType; typedef void * RsLight; typedef void * RsProgramVertex; typedef void * RsProgramFragment; Loading
libs/rs/RenderScriptEnv.h +1 −0 Original line number Diff line number Diff line Loading @@ -14,6 +14,7 @@ typedef void * RsTriangleMesh; typedef void * RsType; typedef void * RsProgramFragment; typedef void * RsProgramFragmentStore; typedef void * RsLight; typedef struct { Loading
libs/rs/java/Film/src/com/android/film/FilmRS.java +5 −0 Original line number Diff line number Diff line Loading @@ -85,6 +85,7 @@ public class FilmRS { private RenderScript.Allocation mAllocState; private RenderScript.Allocation mAllocPV; private RenderScript.TriangleMesh mMesh; private RenderScript.Light mLight; private float[] mBufferPos; private float[] mBufferPV; Loading Loading @@ -144,6 +145,10 @@ public class FilmRS { mPV = mRS.programVertexCreate(); mPV.setName("PV"); mRS.lightBegin(); mLight = mRS.lightCreate(); mLight.setPosition(0, -0.5f, -1.0f); Log.e("rs", "Done loading named"); } Loading
libs/rs/java/RenderScript/android/renderscript/RenderScript.java +46 −0 Original line number Diff line number Diff line Loading @@ -157,6 +157,14 @@ public class RenderScript { native private void nProgramVertexSetTextureMatrixEnable(boolean enable); native private int nProgramVertexCreate(); native private void nLightBegin(); native private void nLightSetIsMono(boolean isMono); native private void nLightSetIsLocal(boolean isLocal); native private int nLightCreate(); native private void nLightDestroy(int l); native private void nLightSetColor(int l, float r, float g, float b); native private void nLightSetPosition(int l, float x, float y, float z); private int mDev; private int mContext; Loading Loading @@ -869,6 +877,44 @@ public class RenderScript { return new Sampler(id); } ////////////////////////////////////////////////////////////////////////////////// // Light public class Light extends BaseObj { Light(int id) { mID = id; } public void destroy() { nLightDestroy(mID); mID = 0; } public void setColor(float r, float g, float b) { nLightSetColor(mID, r, g, b); } public void setPosition(float x, float y, float z) { nLightSetPosition(mID, x, y, z); } } public void lightBegin() { nLightBegin(); } public void lightSetIsMono(boolean isMono) { nLightSetIsMono(isMono); } public void lightSetIsLocal(boolean isLocal) { nLightSetIsLocal(isLocal); } public Light lightCreate() { int id = nLightCreate(); return new Light(id); } /////////////////////////////////////////////////////////////////////////////////// // Root state Loading