From ac670c0433d19397d4e36ced2110475b6f54fe26 Mon Sep 17 00:00:00 2001 From: Romain Guy Date: Tue, 27 Jul 2010 17:39:27 -0700 Subject: 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 --- libs/hwui/Program.h | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'libs/hwui/Program.h') 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 { -- cgit v1.1