Skip to Content
Pro Android Apps Performance Optimization
book

Pro Android Apps Performance Optimization

by Hervé Guihot
January 2012
Intermediate to advanced
282 pages
7h 4m
English
Apress
Content preview from Pro Android Apps Performance Optimization

Adding Variables to Script

Let's modify Listing 9–5 a little bit to learn more about the reflected layer. So far, we only saw how the hello_world routine from the script was reflected in Listing 9–2. Here we are going to add more variables in the script, which we will call hellorendering2.rs, as shown in Listing 9–9.

Listing 9–9. Changing Background Color (Second Version)

#pragma version(1) #pragma rs java_package_name(com.apress.proandroid.ch9) #include "rs_graphics.rsh" // we removed init() as it was empty anyway float red = 0.0f; // initialized to 1.0f float green; // purposely not initialized static float blue; // purposely not initialized, static const float alpha = 1.0f; // constant int root() {     // clear the background color ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Android High Performance Programming

Android High Performance Programming

Enrique López Mañas, Diego Grancini
Pro Android Graphics

Pro Android Graphics

Wallace Jackson

Publisher Resources

ISBN: 9781430239994Purchase book