summaryrefslogtreecommitdiffstats
path: root/libs/hwui/Glop.h
diff options
context:
space:
mode:
Diffstat (limited to 'libs/hwui/Glop.h')
-rw-r--r--libs/hwui/Glop.h42
1 files changed, 31 insertions, 11 deletions
diff --git a/libs/hwui/Glop.h b/libs/hwui/Glop.h
index e2adff8..10dbd5c 100644
--- a/libs/hwui/Glop.h
+++ b/libs/hwui/Glop.h
@@ -17,6 +17,7 @@
#ifndef ANDROID_HWUI_GLOP_H
#define ANDROID_HWUI_GLOP_H
+#include "FloatColor.h"
#include "Matrix.h"
#include "Rect.h"
#include "utils/Macros.h"
@@ -29,6 +30,7 @@ namespace android {
namespace uirenderer {
class Program;
+class RoundRectClipState;
/*
* Enumerates optional vertex attributes
@@ -37,30 +39,27 @@ class Program;
* are enabled/disabled dynamically based on mesh content.
*/
enum VertexAttribFlags {
- // NOTE: position attribute always enabled
kNone_Attrib = 0,
kTextureCoord_Attrib = 1 << 0,
kColor_Attrib = 1 << 1,
kAlpha_Attrib = 1 << 2,
};
-
/**
- * Structure containing all data required to issue a single OpenGL draw
+ * Structure containing all data required to issue an OpenGL draw
*
* Includes all of the mesh, fill, and GL state required to perform
* the operation. Pieces of data are either directly copied into the
* structure, or stored as a pointer or GL object reference to data
- * managed
+ * managed.
+ *
+ * Eventually, a Glop should be able to be drawn multiple times from
+ * a single construction, up until GL context destruction. Currently,
+ * vertex/index/Texture/RoundRectClipState pointers prevent this from
+ * being safe.
*/
// TODO: PREVENT_COPY_AND_ASSIGN(...) or similar
struct Glop {
- struct FloatColor {
- float a, r, g, b;
- };
-
- Rect bounds;
-
/*
* Stores mesh - vertex and index data.
*
@@ -74,12 +73,20 @@ struct Glop {
GLuint indexBufferObject;
const void* vertices;
const void* indices;
- int vertexCount;
+ int elementCount;
GLsizei stride;
+ GLvoid* texCoordOffset;
+ TextureVertex mappedVertices[4];
} mesh;
struct Fill {
Program* program;
+
+ Texture* texture;
+ GLenum textureFilter;
+ GLenum textureClamp;
+
+ bool colorEnabled;
FloatColor color;
/* TODO
@@ -104,12 +111,25 @@ struct Glop {
bool fudgingOffset;
} transform;
+ const RoundRectClipState* roundRectClipState;
+
+ /**
+ * Blending to be used by this draw - both GL_NONE if blending is disabled.
+ *
+ * Defined by fill step, but can be force-enabled by presence of kAlpha_Attrib
+ */
struct Blend {
GLenum src;
GLenum dst;
} blend;
/**
+ * Bounds of the drawing command in layer space. Only mapped into layer
+ * space once GlopBuilder::build() is called.
+ */
+ Rect bounds;
+
+ /**
* Additional render state to enumerate:
* - scissor + (bits for whether each of LTRB needed?)
* - stencil mode (draw into, mask, count, etc)