diff options
author | Romain Guy <romainguy@google.com> | 2010-07-29 14:37:42 -0700 |
---|---|---|
committer | Romain Guy <romainguy@google.com> | 2010-07-29 14:37:42 -0700 |
commit | 889f8d1403761d5668115ced6cbb3f767cfe966d (patch) | |
tree | 8620d3453e3811dce152630f1b17e0f5f42601c6 /libs/hwui/OpenGLRenderer.h | |
parent | 85d8daa889db113b51c5d98929245e80f7277388 (diff) | |
download | frameworks_base-889f8d1403761d5668115ced6cbb3f767cfe966d.zip frameworks_base-889f8d1403761d5668115ced6cbb3f767cfe966d.tar.gz frameworks_base-889f8d1403761d5668115ced6cbb3f767cfe966d.tar.bz2 |
Moved all the rendering code to the new shader generator.
The generator supports features that are not yet implement in the
renderer: color matrix, lighting, porterduff color blending and
composite shaders.
This change also adds support for repeated/mirrored non-power of 2
bitmap shaders.
Change-Id: I903a11a070c0eb9cc8850a60ef305751e5b47234
Diffstat (limited to 'libs/hwui/OpenGLRenderer.h')
-rw-r--r-- | libs/hwui/OpenGLRenderer.h | 28 |
1 files changed, 7 insertions, 21 deletions
diff --git a/libs/hwui/OpenGLRenderer.h b/libs/hwui/OpenGLRenderer.h index 975be05..5e5c021 100644 --- a/libs/hwui/OpenGLRenderer.h +++ b/libs/hwui/OpenGLRenderer.h @@ -47,22 +47,11 @@ namespace android { namespace uirenderer { /////////////////////////////////////////////////////////////////////////////// -// Support -/////////////////////////////////////////////////////////////////////////////// - -/** - * Structure mapping Skia xfermodes to OpenGL blending factors. - */ -struct Blender { - SkXfermode::Mode mode; - GLenum src; - GLenum dst; -}; // struct Blender - -/////////////////////////////////////////////////////////////////////////////// // Renderer /////////////////////////////////////////////////////////////////////////////// +#define REQUIRED_TEXTURE_UNITS_COUNT 3 + /** * OpenGL renderer used to draw accelerated 2D graphics. The API is a * simplified version of Skia's Canvas API. @@ -294,7 +283,7 @@ private: /** * Binds the specified texture with the specified wrap modes. */ - inline void bindTexture(GLuint texture, GLenum wrapS, GLenum wrapT); + inline void bindTexture(GLuint texture, GLenum wrapS, GLenum wrapT, GLuint textureUnit = 0); /** * Enable or disable blending as necessary. This function sets the appropriate @@ -312,7 +301,7 @@ private: * * @return true If the specified program was already in use, false otherwise. */ - inline bool useProgram(const sp<Program>& program); + inline bool useProgram(Program* program); // Dimensions of the drawing surface int mWidth, mHeight; @@ -331,17 +320,14 @@ private: sp<Snapshot> mSnapshot; // Shaders - sp<Program> mCurrentProgram; - sp<DrawColorProgram> mDrawColorProgram; - sp<DrawTextureProgram> mDrawTextureProgram; - sp<DrawTextProgram> mDrawTextProgram; - sp<DrawLinearGradientProgram> mDrawLinearGradientProgram; + Program* mCurrentProgram; // Used to draw textured quads TextureVertex mMeshVertices[4]; // Current texture state - GLuint mLastTexture; + GLuint mLastTexture[REQUIRED_TEXTURE_UNITS_COUNT]; + GLint mMaxTextureUnits; // Last known blend state bool mBlend; |