summaryrefslogtreecommitdiff
path: root/libs/hwui/OpenGLRenderer.h
diff options
context:
space:
mode:
author Romain Guy <romainguy@android.com> 2010-06-25 13:41:57 -0700
committer Romain Guy <romainguy@android.com> 2010-06-25 13:41:57 -0700
commitc7d53494f1fbd9f9d74af89053ff9fdb1ccbac6c (patch)
treee9fa1c80906aa67991fea69f664fdddc94897327 /libs/hwui/OpenGLRenderer.h
parent5b7e333cf2f91c94e37dbb7024fa38da3db34619 (diff)
Implement quickReject() and drawRect().
The OpenGL ES 2.0 renderer can now draw colored rectangles. At least there's something on screen now. Change-Id: I80a13ccc1dd56784edf74f2670a364f30700234a
Diffstat (limited to 'libs/hwui/OpenGLRenderer.h')
-rw-r--r--libs/hwui/OpenGLRenderer.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/libs/hwui/OpenGLRenderer.h b/libs/hwui/OpenGLRenderer.h
index 88cbc1c78377..bef41938e38d 100644
--- a/libs/hwui/OpenGLRenderer.h
+++ b/libs/hwui/OpenGLRenderer.h
@@ -72,10 +72,9 @@ private:
Rect mappedClip;
}; // class Snapshot
-struct Vertex {
+struct SimpleVertex {
float position[2];
- float color[4];
-}; // struct Vertex
+}; // struct SimpleVertex
typedef char* shader;
@@ -112,11 +111,15 @@ class DrawColorProgram: public Program {
public:
DrawColorProgram();
+ void use(const GLfloat* projectionMatrix, const GLfloat* modelViewMatrix,
+ const GLfloat* transformMatrix);
+
int position;
int color;
int projection;
int modelView;
+ int transform;
};
///////////////////////////////////////////////////////////////////////////////
@@ -145,9 +148,11 @@ public:
void concatMatrix(SkMatrix* matrix);
const Rect& getClipBounds();
+ bool quickReject(float left, float top, float right, float bottom);
bool clipRect(float left, float top, float right, float bottom);
void drawColor(int color, SkXfermode::Mode mode);
+ void drawRect(float left, float top, float right, float bottom, SkPaint* paint);
private:
int saveSnapshot();
@@ -155,12 +160,17 @@ private:
void setScissorFromClip();
+ void drawColorRect(float left, float top, float right, float bottom, int color);
+
// Dimensions of the drawing surface
int mWidth, mHeight;
// Matrix used for ortho projection in shaders
float mOrthoMatrix[16];
+ // Model-view matrix used to position/size objects
+ mat4 mModelView;
+
// Number of saved states
int mSaveCount;
// Base state