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
diff --git a/libs/hwui/OpenGLRenderer.h b/libs/hwui/OpenGLRenderer.h
index 88cbc1c..bef4193 100644
--- a/libs/hwui/OpenGLRenderer.h
+++ b/libs/hwui/OpenGLRenderer.h
@@ -72,10 +72,9 @@
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 @@
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 @@
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 @@
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