summaryrefslogtreecommitdiffstats
path: root/libs/hwui/Program.h
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2010-07-27 17:39:27 -0700
committerRomain Guy <romainguy@google.com>2010-07-27 19:52:29 -0700
commitac670c0433d19397d4e36ced2110475b6f54fe26 (patch)
tree10722cd4e465fc053f9536cc312c1125a694108a /libs/hwui/Program.h
parentbb2b2a996b2c0bea7e434136e20340f4f1b398ab (diff)
downloadframeworks_base-ac670c0433d19397d4e36ced2110475b6f54fe26.zip
frameworks_base-ac670c0433d19397d4e36ced2110475b6f54fe26.tar.gz
frameworks_base-ac670c0433d19397d4e36ced2110475b6f54fe26.tar.bz2
Generate shaders to cover all possible cases.
With this change, all the vertex and fragment shaders used by the GL renderer are now generated based on a program description supplied by the caller. This allows the renderer to generate a large number of shaders without having to write all the possible combinations by hand. The generated shaders are stored in a program cache. Change-Id: If54d286e77ae021c724d42090da476df12a18ebb
Diffstat (limited to 'libs/hwui/Program.h')
-rw-r--r--libs/hwui/Program.h28
1 files changed, 15 insertions, 13 deletions
diff --git a/libs/hwui/Program.h b/libs/hwui/Program.h
index 824aa05..2cdd905 100644
--- a/libs/hwui/Program.h
+++ b/libs/hwui/Program.h
@@ -53,6 +53,16 @@ public:
virtual void remove();
/**
+ * Returns the OpenGL name of the specified attribute.
+ */
+ int getAttrib(const char* name);
+
+ /**
+ * Returns the OpenGL name of the specified uniform.
+ */
+ int getUniform(const char* name);
+
+ /**
* Indicates whether this program is currently in use with
* the GL context.
*/
@@ -67,10 +77,6 @@ protected:
* @return The OpenGL name of the attribute.
*/
int addAttrib(const char* name);
- /**
- * Returns the OpenGL name of the specified attribute.
- */
- int getAttrib(const char* name);
/**
* Adds a uniform with the specified name.
@@ -78,10 +84,6 @@ protected:
* @return The OpenGL name of the uniform.
*/
int addUniform(const char* name);
- /**
- * Returns the OpenGL name of the specified uniform.
- */
- int getUniform(const char* name);
private:
/**
@@ -145,6 +147,11 @@ public:
int position;
/**
+ * Name of the texture coordinates attribute.
+ */
+ int texCoords;
+
+ /**
* Name of the color uniform.
*/
int color;
@@ -184,11 +191,6 @@ public:
* Name of the texture sampler uniform.
*/
int sampler;
-
- /**
- * Name of the texture coordinates attribute.
- */
- int texCoords;
};
class DrawTextProgram: public DrawTextureProgram {