summaryrefslogtreecommitdiffstats
path: root/libs/rs/java
diff options
context:
space:
mode:
authorYing Wang <wangying@google.com>2010-07-16 10:21:48 -0700
committerYing Wang <wangying@google.com>2010-07-19 16:01:44 -0700
commitbc8112fd6db905aa02b86bc73c2a4086c89253d1 (patch)
tree118a760d2d2d2c3421a01cec03651c5fc026ad8c /libs/rs/java
parent6e738552ea8ae3ede4f5da4f9055feb4297bc486 (diff)
downloadframeworks_base-bc8112fd6db905aa02b86bc73c2a4086c89253d1.zip
frameworks_base-bc8112fd6db905aa02b86bc73c2a4086c89253d1.tar.gz
frameworks_base-bc8112fd6db905aa02b86bc73c2a4086c89253d1.tar.bz2
.rs files are now built by the build system.
Change-Id: Iba28bed6cc05883a28a59b8dd0ff12e1bfbe0c04
Diffstat (limited to 'libs/rs/java')
-rw-r--r--libs/rs/java/Fountain/Android.mk2
-rw-r--r--libs/rs/java/Fountain/res/raw/fountain_bc.bcbin2996 -> 0 bytes
-rw-r--r--libs/rs/java/Fountain/src/com/android/fountain/FountainRS.java4
-rw-r--r--libs/rs/java/Fountain/src/com/android/fountain/ScriptC_Fountain.java65
-rw-r--r--libs/rs/java/Fountain/src/com/android/fountain/ScriptField_Point.java80
-rw-r--r--libs/rs/java/Fountain/src/com/android/fountain/fountain.rs (renamed from libs/rs/java/Fountain/src/fountain.rs)6
6 files changed, 5 insertions, 152 deletions
diff --git a/libs/rs/java/Fountain/Android.mk b/libs/rs/java/Fountain/Android.mk
index f7e53a8..814d2ae 100644
--- a/libs/rs/java/Fountain/Android.mk
+++ b/libs/rs/java/Fountain/Android.mk
@@ -19,7 +19,7 @@ include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := optional
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
+LOCAL_SRC_FILES := $(call all-java-files-under, src) $(call all-renderscript-files-under, src)
#LOCAL_STATIC_JAVA_LIBRARIES := android.renderscript
LOCAL_PACKAGE_NAME := Fountain
diff --git a/libs/rs/java/Fountain/res/raw/fountain_bc.bc b/libs/rs/java/Fountain/res/raw/fountain_bc.bc
deleted file mode 100644
index 2c8ce8b..0000000
--- a/libs/rs/java/Fountain/res/raw/fountain_bc.bc
+++ /dev/null
Binary files differ
diff --git a/libs/rs/java/Fountain/src/com/android/fountain/FountainRS.java b/libs/rs/java/Fountain/src/com/android/fountain/FountainRS.java
index cfe8e27..3cfb457 100644
--- a/libs/rs/java/Fountain/src/com/android/fountain/FountainRS.java
+++ b/libs/rs/java/Fountain/src/com/android/fountain/FountainRS.java
@@ -41,7 +41,7 @@ public class FountainRS {
smb.addIndexType(Primitive.POINT);
Mesh sm = smb.create();
- mScript = new ScriptC_Fountain(mRS, mRes, R.raw.fountain_bc, true);
+ mScript = new ScriptC_Fountain(mRS, mRes, R.raw.fountain, true);
mScript.set_partMesh(sm);
mScript.bind_point(points);
mRS.contextBindRootScript(mScript);
@@ -65,5 +65,3 @@ public class FountainRS {
}
}
-
-
diff --git a/libs/rs/java/Fountain/src/com/android/fountain/ScriptC_Fountain.java b/libs/rs/java/Fountain/src/com/android/fountain/ScriptC_Fountain.java
deleted file mode 100644
index 0ec0009..0000000
--- a/libs/rs/java/Fountain/src/com/android/fountain/ScriptC_Fountain.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright (C) 2010 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.fountain;
-
-import android.renderscript.*;
-import android.content.res.Resources;
-import android.util.Log;
-
-public class ScriptC_Fountain extends ScriptC {
- // Constructor
- public ScriptC_Fountain(RenderScript rs, Resources resources, int id, boolean isRoot) {
- super(rs, resources, id, isRoot);
- }
-
- private final static int mExportVarIdx_partMesh = 0;
- private Mesh mExportVar_partMesh;
- public void set_partMesh(Mesh v) {
- mExportVar_partMesh = v;
- setVar(mExportVarIdx_partMesh, (v == null) ? 0 : v.getID());
- }
-
- public Mesh get_partMesh() {
- return mExportVar_partMesh;
- }
-
- private final static int mExportVarIdx_point = 1;
- private ScriptField_Point mExportVar_point;
- public void bind_point(ScriptField_Point v) {
- mExportVar_point = v;
- if(v == null) bindAllocation(null, mExportVarIdx_point);
- else bindAllocation(v.getAllocation(), mExportVarIdx_point);
- }
-
- public ScriptField_Point get_point() {
- return mExportVar_point;
- }
-
- private final static int mExportFuncIdx_addParticles = 0;
- public void invoke_addParticles(int rate, float x, float y, int index, boolean newColor) {
- FieldPacker addParticles_fp = new FieldPacker(20);
- addParticles_fp.addI32(rate);
- addParticles_fp.addF32(x);
- addParticles_fp.addF32(y);
- addParticles_fp.addI32(index);
- addParticles_fp.addBoolean(newColor);
- addParticles_fp.skip(3);
- invoke(mExportFuncIdx_addParticles, addParticles_fp);
- }
-
-}
-
diff --git a/libs/rs/java/Fountain/src/com/android/fountain/ScriptField_Point.java b/libs/rs/java/Fountain/src/com/android/fountain/ScriptField_Point.java
deleted file mode 100644
index d88f47b..0000000
--- a/libs/rs/java/Fountain/src/com/android/fountain/ScriptField_Point.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Copyright (C) 2010 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.fountain;
-
-import android.renderscript.*;
-import android.content.res.Resources;
-import android.util.Log;
-
-public class ScriptField_Point extends android.renderscript.Script.FieldBase {
- static public class Item {
- public static final int sizeof = 20;
-
- Float2 delta;
- Float2 position;
- Short4 color;
-
- Item() {
- delta = new Float2();
- position = new Float2();
- color = new Short4();
- }
-
- }
-
- private Item mItemArray[];
- private FieldPacker mIOBuffer;
- public static Element createElement(RenderScript rs) {
- Element.Builder eb = new Element.Builder(rs);
- eb.add(Element.createVector(rs, Element.DataType.FLOAT_32, 2), "delta");
- eb.add(Element.createVector(rs, Element.DataType.FLOAT_32, 2), "position");
- eb.add(Element.createVector(rs, Element.DataType.UNSIGNED_8, 4), "color");
- return eb.create();
- }
-
- public ScriptField_Point(RenderScript rs, int count) {
- mItemArray = null;
- mIOBuffer = null;
- mElement = createElement(rs);
- init(rs, count);
- }
-
- private void copyToArray(Item i, int index) {
- if (mIOBuffer == null) mIOBuffer = new FieldPacker(Item.sizeof * mType.getX() /* count */);
- mIOBuffer.reset(index * Item.sizeof);
- mIOBuffer.addF32(i.delta);
- mIOBuffer.addF32(i.position);
- mIOBuffer.addU8(i.color);
- }
-
- public void set(Item i, int index, boolean copyNow) {
- if (mItemArray == null) mItemArray = new Item[mType.getX() /* count */];
- mItemArray[index] = i;
- if (copyNow) {
- copyToArray(i, index);
- mAllocation.subData1D(index, 1, mIOBuffer.getData());
- }
-
- }
-
- public void copyAll() {
- for (int ct=0; ct < mItemArray.length; ct++) copyToArray(mItemArray[ct], ct);
- mAllocation.data(mIOBuffer.getData());
- }
-
-}
-
diff --git a/libs/rs/java/Fountain/src/fountain.rs b/libs/rs/java/Fountain/src/com/android/fountain/fountain.rs
index e3b85e8..4417197 100644
--- a/libs/rs/java/Fountain/src/fountain.rs
+++ b/libs/rs/java/Fountain/src/com/android/fountain/fountain.rs
@@ -3,9 +3,9 @@
#pragma rs java_package_name(com.android.fountain)
-#include "../../../scriptc/rs_types.rsh"
-#include "../../../scriptc/rs_math.rsh"
-#include "../../../scriptc/rs_graphics.rsh"
+#include "rs_types.rsh"
+#include "rs_math.rsh"
+#include "rs_graphics.rsh"
static int newPart = 0;
rs_mesh partMesh;