From f11ffc1178645762b74f945b6c5ee068dc6000d3 Mon Sep 17 00:00:00 2001
From: Robert Ly Note: The Renderscript runtime makes its best effort to
refresh the frame at the specified rate. For example, if you are creating a live wallpaper
- and set the return value to 20, the Renderscript runtime renders the wallpaper at 20fps if it has just
+ and set the return value to 20, the Renderscript runtime renders the wallpaper at 50fps if it has just
enough or more resources to do so. It renders as fast as it can if not enough resources
are available.
int float2VtxSize = 2; -Mesh.TriangleMeshBuilder triangle = new Mesh.TriangleMeshBuilder(renderscriptGL, +Mesh.TriangleMeshBuilder triangles = new Mesh.TriangleMeshBuilder(renderscriptGL, float2VtxSize, Mesh.TriangleMeshBuilder.COLOR); triangles.addVertex(300.f, 300.f); triangles.addVertex(150.f, 450.f); diff --git a/docs/html/guide/topics/renderscript/index.jd b/docs/html/guide/topics/renderscript/index.jd index a0e8876f07e6..24b9750161f9 100644 --- a/docs/html/guide/topics/renderscript/index.jd +++ b/docs/html/guide/topics/renderscript/index.jd @@ -231,7 +231,8 @@ would block until the value was returned.-If you want the Renderscript code to send a value back to the Android framework, use the -
rsSendToClient()function. +rsSendToClient()+function.Variables
@@ -256,53 +257,6 @@ public long get_unsignedInteger(){ }
Pointers are reflected into the script class itself, located in
-project_root/gen/package/name/ScriptC_renderscript_filename. You
-can declare pointers to a struct or any of the supported Renderscript types, but a
-struct cannot contain pointers or nested arrays. For example, if you declare the
-following pointers to a struct and int32_t
-typedef struct Point {
- float2 point;
-} Point_t;
-
-Point_t *touchPoints;
-int32_t *intPointer;
-
- then the following code is generated in:
- -
-private ScriptField_Point mExportVar_touchPoints;
-public void bind_touchPoints(ScriptField_Point v) {
- mExportVar_touchPoints = v;
- if (v == null) bindAllocation(null, mExportVarIdx_touchPoints);
- else bindAllocation(v.getAllocation(), mExportVarIdx_touchPoints);
- }
-
- public ScriptField_Point get_touchPoints() {
- return mExportVar_touchPoints;
- }
-
- private Allocation mExportVar_intPointer;
- public void bind_intPointer(Allocation v) {
- mExportVar_intPointer = v;
- if (v == null) bindAllocation(null, mExportVarIdx_intPointer);
- else bindAllocation(v, mExportVarIdx_intPointer);
- }
-
- public Allocation get_intPointer() {
- return mExportVar_intPointer;
- }
-
-
-A get method and a special method named bind_pointer_name
-(instead of a set() method) is generated. This method allows you to bind the memory
-that is allocated in the Android VM to the Renderscript runtime (you cannot allocate
-memory in your .rs file). For more information, see Working
-with Allocated Memory.
-
Structs are reflected into their own classes, located in
@@ -311,7 +265,8 @@ with Allocated Memory.
specified number of structs. For example, if you declare the following struct:
typedef struct Point {
-float2 point;
+ float2 position;
+ float size;
} Point_t;
@@ -478,7 +433,8 @@ in memory. Each struct's class defines the following methods and co
If you modify the memory in one memory space and want to push the updates to the rest of
- the memory spaces, call rsgAllocationSyncAll() in your Renderscript code to
+ the memory spaces, call
+ rsgAllocationSyncAll() in your Renderscript code to
synchronize the memory.
Pointers are reflected into the script class itself, located in
+project_root/gen/package/name/ScriptC_renderscript_filename. You
+can declare pointers to a struct or any of the supported Renderscript types, but a
+struct cannot contain pointers or nested arrays. For example, if you declare the
+following pointers to a struct and int32_t
+typedef struct Point {
+ float2 position;
+ float size;
+} Point_t;
+
+Point_t *touchPoints;
+int32_t *intPointer;
+
+ then the following code is generated in:
+ +
+private ScriptField_Point mExportVar_touchPoints;
+public void bind_touchPoints(ScriptField_Point v) {
+ mExportVar_touchPoints = v;
+ if (v == null) bindAllocation(null, mExportVarIdx_touchPoints);
+ else bindAllocation(v.getAllocation(), mExportVarIdx_touchPoints);
+}
+
+public ScriptField_Point get_touchPoints() {
+ return mExportVar_touchPoints;
+}
+
+private Allocation mExportVar_intPointer;
+public void bind_intPointer(Allocation v) {
+ mExportVar_intPointer = v;
+ if (v == null) bindAllocation(null, mExportVarIdx_intPointer);
+ else bindAllocation(v, mExportVarIdx_intPointer);
+}
+
+public Allocation get_intPointer() {
+ return mExportVar_intPointer;
+}
+
+
+A get method and a special method named bind_pointer_name
+(instead of a set() method) is generated. This method allows you to bind the memory
+that is allocated in the Android VM to the Renderscript runtime (you cannot allocate
+memory in your .rs file). For more information, see Working
+with Allocated Memory.
+
Applications that use Renderscript still run in the Android VM. The actual Renderscript code, however, runs natively and
@@ -693,7 +699,8 @@ communicated back to the Android framework layer for efficiency purposes. The la
that is set from the Android framework is always returned during a call to a get
method. However, when Android framework code modifies a variable, that change can be communicated to
the Renderscript runtime automatically or synchronized at a later time. If you need to send data
-from the Renderscript runtime to the Android framework layer, you can use the rsSendToClient() function
+from the Renderscript runtime to the Android framework layer, you can use the
+rsSendToClient() function
to overcome this limitation.
When working with dynamically allocated memory, any changes at the Renderscript runtime layer are propagated diff --git a/graphics/java/android/renderscript/Mesh.java b/graphics/java/android/renderscript/Mesh.java index 7b3b73f505c6..7ffaaf9e25c5 100644 --- a/graphics/java/android/renderscript/Mesh.java +++ b/graphics/java/android/renderscript/Mesh.java @@ -631,7 +631,7 @@ public class Mesh extends BaseObj { } /** - * Sets the texture coordinate for the last added vertex + * Sets the texture coordinate for the vertices that are added after this method call. * * @param s texture coordinate s * @param t texture coordinate t @@ -648,7 +648,7 @@ public class Mesh extends BaseObj { } /** - * Sets the normal vector for the last added vertex + * Sets the normal vector for the vertices that are added after this method call. * * @param x normal vector x * @param y normal vector y @@ -667,7 +667,7 @@ public class Mesh extends BaseObj { } /** - * Sets the color for the last added vertex + * Sets the color for the vertices that are added after this method call. * * @param r red component * @param g green component -- cgit v1.2.3-59-g8ed1b