diff options
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; |