src/opengl/gl2paintengineex/qgl2pexvertexarray_p.h
changeset 30 5dc02b23752f
parent 18 2f34d5167611
--- a/src/opengl/gl2paintengineex/qgl2pexvertexarray_p.h	Wed Jun 23 19:07:03 2010 +0300
+++ b/src/opengl/gl2paintengineex/qgl2pexvertexarray_p.h	Tue Jul 06 15:10:48 2010 +0300
@@ -100,10 +100,45 @@
 {
 public:
     QGL2PEXVertexArray() :
+        vertexArray(0), vertexArrayStops(0),
         maxX(-2e10), maxY(-2e10), minX(2e10), minY(2e10),
-        boundingRectDirty(true) {}
+        boundingRectDirty(true)
+    { }
+    
+    inline void addRect(const QRectF &rect)
+    {
+        qreal top = rect.top();
+        qreal left = rect.left();
+        qreal bottom = rect.bottom();
+        qreal right = rect.right();
+    
+        vertexArray << QGLPoint(left, top)
+                    << QGLPoint(right, top)
+                    << QGLPoint(right, bottom)
+                    << QGLPoint(right, bottom)
+                    << QGLPoint(left, bottom)
+                    << QGLPoint(left, top);        
+    }
 
-    void addRect(const QRectF &rect);
+    inline void addQuad(const QRectF &rect)
+    {
+        qreal top = rect.top();
+        qreal left = rect.left();
+        qreal bottom = rect.bottom();
+        qreal right = rect.right();
+
+        vertexArray << QGLPoint(left, top)
+                    << QGLPoint(right, top)
+                    << QGLPoint(left, bottom)
+                    << QGLPoint(right, bottom);
+
+    }
+
+    inline void addVertex(const GLfloat x, const GLfloat y)
+    {
+        vertexArray.add(QGLPoint(x, y));
+    }
+
     void addPath(const QVectorPath &path, GLfloat curveInverseScale, bool outline = true);
     void clear();