summaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorRobert Ly <robertly@google.com>2012-02-22 10:59:12 -0800
committerRobert Ly <robertly@google.com>2012-02-22 16:35:42 -0800
commitf11ffc1178645762b74f945b6c5ee068dc6000d3 (patch)
tree46194c12e1bea7a1b1be90f2b02b24b9713bc154 /docs
parent197fe26940022be75384f4038dd789f446d33122 (diff)
downloadframeworks_base-f11ffc1178645762b74f945b6c5ee068dc6000d3.zip
frameworks_base-f11ffc1178645762b74f945b6c5ee068dc6000d3.tar.gz
frameworks_base-f11ffc1178645762b74f945b6c5ee068dc6000d3.tar.bz2
docs: fixing bug 5942573
Change-Id: I2479dc8916f98a8bf7dbec95dc29cbd871c51be5
Diffstat (limited to 'docs')
-rw-r--r--docs/html/guide/topics/renderscript/graphics.jd4
-rw-r--r--docs/html/guide/topics/renderscript/index.jd109
2 files changed, 60 insertions, 53 deletions
diff --git a/docs/html/guide/topics/renderscript/graphics.jd b/docs/html/guide/topics/renderscript/graphics.jd
index 1c6d0de..462a990 100644
--- a/docs/html/guide/topics/renderscript/graphics.jd
+++ b/docs/html/guide/topics/renderscript/graphics.jd
@@ -142,7 +142,7 @@ href="{@docRoot}resources/samples/RenderScript/MiscSamples/index.html">Misc Samp
<p class="note"><strong>Note:</strong> 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.</p>
@@ -570,7 +570,7 @@ point if this is your first time using Renderscript.</p>
vertex 0, 1, and 2 (the vertices are drawn counter-clockwise).</p>
<pre>
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 a0e8876..24b9750 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.</p>
<p>
If you want the Renderscript code to send a value back to the Android framework, use the
-<code>rsSendToClient()</code> function.
+<a href="{@docRoot}reference/renderscript/rs__core_8rsh.html"><code>rsSendToClient()</code></a>
+function.
</p>
<h3 id="var">Variables</h3>
@@ -256,53 +257,6 @@ public long get_unsignedInteger(){
}
</pre>
- <h3 id="pointer">Pointers</h3>
- <p>Pointers are reflected into the script class itself, located in
-<code>project_root/gen/package/name/ScriptC_renderscript_filename</code>. You
-can declare pointers to a <code>struct</code> or any of the supported Renderscript types, but a
-<code>struct</code> cannot contain pointers or nested arrays. For example, if you declare the
-following pointers to a <code>struct</code> and <code>int32_t</code></p>
-
-<pre>
-typedef struct Point {
- float2 point;
-} Point_t;
-
-Point_t *touchPoints;
-int32_t *intPointer;
-</pre>
- <p>then the following code is generated in:</p>
-
- <pre>
-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;
- }
- </pre>
-
-<p>A <code>get</code> method and a special method named <code>bind_<em>pointer_name</em></code>
-(instead of a <code>set()</code> 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 <code>.rs</code> file). For more information, see <a href="#memory">Working
-with Allocated Memory</a>.
-</p>
<h3 id="struct">Structs</h3>
<p>Structs are reflected into their own classes, located in
@@ -311,7 +265,8 @@ with Allocated Memory</a>.
specified number of <code>struct</code>s. For example, if you declare the following struct:</p>
<pre>
typedef struct Point {
-float2 point;
+ float2 position;
+ float size;
} Point_t;
</pre>
@@ -478,7 +433,8 @@ in memory. Each <code>struct</code>'s class defines the following methods and co
</pre>
<p>If you modify the memory in one memory space and want to push the updates to the rest of
- the memory spaces, call <code>rsgAllocationSyncAll()</code> in your Renderscript code to
+ the memory spaces, call <a href="{@docRoot}reference/renderscript/rs__graphics_8rsh.html">
+ <code>rsgAllocationSyncAll()</code></a> in your Renderscript code to
synchronize the memory.</p>
</li>
@@ -511,6 +467,56 @@ Renderscript runtime. When you call a set accessor method on a member, there is
properties that are not yet synchronized.</li>
</ul>
+ <h3 id="pointer">Pointers</h3>
+ <p>Pointers are reflected into the script class itself, located in
+<code>project_root/gen/package/name/ScriptC_renderscript_filename</code>. You
+can declare pointers to a <code>struct</code> or any of the supported Renderscript types, but a
+<code>struct</code> cannot contain pointers or nested arrays. For example, if you declare the
+following pointers to a <code>struct</code> and <code>int32_t</code></p>
+
+<pre>
+typedef struct Point {
+ float2 position;
+ float size;
+} Point_t;
+
+Point_t *touchPoints;
+int32_t *intPointer;
+</pre>
+ <p>then the following code is generated in:</p>
+
+<pre>
+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;
+}
+ </pre>
+
+<p>A <code>get</code> method and a special method named <code>bind_<em>pointer_name</em></code>
+(instead of a <code>set()</code> 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 <code>.rs</code> file). For more information, see <a href="#memory">Working
+with Allocated Memory</a>.
+</p>
+
+
<h2 id="mem-allocation">Memory Allocation APIs</h2>
<p>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 <code>get</code>
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 <code>rsSendToClient()</code> function
+from the Renderscript runtime to the Android framework layer, you can use the
+<a href="{@docRoot}reference/renderscript/rs__core_8rsh.html"><code>rsSendToClient()</code></a> function
to overcome this limitation.
</p>
<p>When working with dynamically allocated memory, any changes at the Renderscript runtime layer are propagated