summaryrefslogtreecommitdiffstats
path: root/libs/hwui/OpenGLRenderer.h
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2010-07-12 14:41:06 -0700
committerRomain Guy <romainguy@google.com>2010-07-12 14:43:40 -0700
commit260e102162322958cf17dbd895cd6bd30dc87e32 (patch)
treee7ff653e0e68525f1f90edeb2fbccc88fb81caeb /libs/hwui/OpenGLRenderer.h
parentd12315ae7ee06902f4b7470259ce33076b6f542c (diff)
downloadframeworks_base-260e102162322958cf17dbd895cd6bd30dc87e32.zip
frameworks_base-260e102162322958cf17dbd895cd6bd30dc87e32.tar.gz
frameworks_base-260e102162322958cf17dbd895cd6bd30dc87e32.tar.bz2
Optimize shader binding changes.
This change also cleans up the internal API a little bit by using mat4 everywhere instead of float[16] (for the ortho matrix for instance.) Change-Id: I35924c7dc17bad17f30307118d5ed437c2ed37e0
Diffstat (limited to 'libs/hwui/OpenGLRenderer.h')
-rw-r--r--libs/hwui/OpenGLRenderer.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/libs/hwui/OpenGLRenderer.h b/libs/hwui/OpenGLRenderer.h
index 76d6e06..afb747f 100644
--- a/libs/hwui/OpenGLRenderer.h
+++ b/libs/hwui/OpenGLRenderer.h
@@ -247,11 +247,19 @@ private:
*/
inline void chooseBlending(bool blend, SkXfermode::Mode mode, bool isPremultiplied);
+ /**
+ * Use the specified shader with the current GL context. If the shader is already
+ * in use, it will not be bound again. If it is not in use, the current shader is
+ * marked unused and the specified shader becomes used and becomes the new
+ * current shader.
+ */
+ inline void useShader(const sp<Program>& shader);
+
// Dimensions of the drawing surface
int mWidth, mHeight;
// Matrix used for ortho projection in shaders
- float mOrthoMatrix[16];
+ mat4 mOrthoMatrix;
// Model-view matrix used to position/size objects
mat4 mModelView;
@@ -264,6 +272,7 @@ private:
sp<Snapshot> mSnapshot;
// Shaders
+ sp<Program> mCurrentShader;
sp<DrawColorProgram> mDrawColorShader;
sp<DrawTextureProgram> mDrawTextureShader;