Refactor how Gr handles vertex and index data. GrGpu and GrInOrderDrawBuffer both GrBufferAllocPool to manage reserved and set-to-array vertex and index data.

rietveld issue 4188049

git-svn-id: http://skia.googlecode.com/svn/trunk@786 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gpu/include/GrContext.h b/gpu/include/GrContext.h
index ccc045e..6b9c3f3 100644
--- a/gpu/include/GrContext.h
+++ b/gpu/include/GrContext.h
@@ -20,12 +20,13 @@
 #include "GrClip.h"

 #include "GrGpu.h"

 #include "GrTextureCache.h"

-#include "GrInOrderDrawBuffer.h"

-#include "GrVertexBufferAllocPool.h"

 #include "GrPaint.h"

 

 class GrFontCache;

 class GrPathIter;

+class GrVertexBufferAllocPool;

+class GrIndexBufferAllocPool;

+class GrInOrderDrawBuffer;

 

 class GrContext : public GrRefCnt {

 public:

@@ -236,21 +237,21 @@
      *  @param paint        describes how to color pixels.

      *  @param strokeWidth  If strokeWidth < 0, then the rect is filled, else

      *                      the rect is mitered stroked based on strokeWidth. If

-     *                      strokeWidth == 0, then the stroke is always a single 

+     *                      strokeWidth == 0, then the stroke is always a single

      *                      pixel thick.

-     *  @param matrix       Optional matrix applied to the rect. Applied before 

+     *  @param matrix       Optional matrix applied to the rect. Applied before

      *                      context's matrix or the paint's matrix.

      *  The rects coords are used to access the paint (through texture matrix)

      */

-    void drawRect(const GrPaint& paint, 

-                  const GrRect&, 

+    void drawRect(const GrPaint& paint,

+                  const GrRect&,

                   GrScalar strokeWidth = -1,

                   const GrMatrix* matrix = NULL);

 

     /**

      * Maps a rect of paint coordinates onto the a rect of destination

      * coordinates. Each rect can optionally be transformed. The srcRect

-     * is stretched over the dstRect. The dstRect is transformed by the 

+     * is stretched over the dstRect. The dstRect is transformed by the

      * context's matrix and the srcRect is transformed by the paint's matrix.

      * Additional optional matrices can be provided by parameters.

      *

@@ -453,8 +454,9 @@
     GrTextureCache* fTextureCache;

     GrFontCache*    fFontCache;

 

-    GrVertexBufferAllocPool fVBAllocPool;

-    GrInOrderDrawBuffer     fTextDrawBuffer;

+    GrVertexBufferAllocPool*    fTextVBAllocPool;

+    GrIndexBufferAllocPool*     fTextIBAllocPool;

+    GrInOrderDrawBuffer*        fTextDrawBuffer;

 

     GrContext(GrGpu* gpu);