summaryrefslogtreecommitdiffstats
path: root/libs/rs/java/Film
diff options
context:
space:
mode:
authorJason Sams <rjsams@android.com>2009-12-23 14:35:29 -0800
committerJason Sams <rjsams@android.com>2009-12-23 14:35:29 -0800
commit718cd1f322ee5b62b6a49cb36195bcb18a5ab711 (patch)
treef2f8c9db5a8141eafa2f1547634d7586fdc6ef04 /libs/rs/java/Film
parentceedafacdb87307234c84196a12eeb6e657d6220 (diff)
downloadframeworks_base-718cd1f322ee5b62b6a49cb36195bcb18a5ab711.zip
frameworks_base-718cd1f322ee5b62b6a49cb36195bcb18a5ab711.tar.gz
frameworks_base-718cd1f322ee5b62b6a49cb36195bcb18a5ab711.tar.bz2
Element restructuring. Add support for new basic Element types including the RS objects and vectors(2-4). In theory this paves the way for maintaining type info for RS objects, passing elements for GLSL uiforms/attribs/varyings, and supporting nested structures.
This will break some apps, checkings for other projects will follow to unbreak them.
Diffstat (limited to 'libs/rs/java/Film')
-rw-r--r--libs/rs/java/Film/src/com/android/film/FilmRS.java14
1 files changed, 9 insertions, 5 deletions
diff --git a/libs/rs/java/Film/src/com/android/film/FilmRS.java b/libs/rs/java/Film/src/com/android/film/FilmRS.java
index dccc1d2..fcf487c 100644
--- a/libs/rs/java/Film/src/com/android/film/FilmRS.java
+++ b/libs/rs/java/Film/src/com/android/film/FilmRS.java
@@ -152,10 +152,13 @@ public class FilmRS {
mBufferIDs = new int[13];
mImages = new Allocation[13];
mAllocIDs = Allocation.createSized(mRS,
- Element.USER_F32(mRS), mBufferIDs.length);
+ Element.createUser(mRS, Element.DataType.FLOAT_32),
+ mBufferIDs.length);
- Element ie = Element.RGB_565(mRS);
+ Element ie = Element.createPixel(mRS, Element.DataType.UNSIGNED_5_6_5, Element.DataKind.PIXEL_RGB);
+ android.util.Log.e("rs", "load 1");
mImages[0] = Allocation.createFromBitmapResourceBoxed(mRS, mRes, R.drawable.p01, ie, true);
+ android.util.Log.e("rs", "load 2");
mImages[1] = Allocation.createFromBitmapResourceBoxed(mRS, mRes, R.drawable.p02, ie, true);
mImages[2] = Allocation.createFromBitmapResourceBoxed(mRS, mRes, R.drawable.p03, ie, true);
mImages[3] = Allocation.createFromBitmapResourceBoxed(mRS, mRes, R.drawable.p04, ie, true);
@@ -195,7 +198,8 @@ public class FilmRS {
{
mBufferState = new int[10];
mAllocState = Allocation.createSized(mRS,
- Element.USER_F32(mRS), mBufferState.length);
+ Element.createUser(mRS, Element.DataType.FLOAT_32),
+ mBufferState.length);
mBufferState[STATE_LAST_FOCUS] = -1;
mAllocState.data(mBufferState);
}
@@ -238,12 +242,12 @@ public class FilmRS {
mAllocOffsets = Allocation.createSized(mRS,
- Element.USER_I32(mRS), mFSM.mTriangleOffsets.length);
+ Element.createUser(mRS, Element.DataType.SIGNED_32), mFSM.mTriangleOffsets.length);
mAllocOffsets.data(mFSM.mTriangleOffsets);
mScriptStrip.bindAllocation(mAllocOffsets, 4);
mAllocOffsetsTex = Allocation.createSized(mRS,
- Element.USER_F32(mRS), mFSM.mTriangleOffsetsTex.length);
+ Element.createUser(mRS, Element.DataType.FLOAT_32), mFSM.mTriangleOffsetsTex.length);
mAllocOffsetsTex.data(mFSM.mTriangleOffsetsTex);
mScriptStrip.bindAllocation(mAllocOffsetsTex, 5);