Make a separate path renderer object. Move enum types to GrTypes.h

Review URL http://codereview.appspot.com/4167067/



git-svn-id: http://skia.googlecode.com/svn/trunk@829 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gpu/include/GrContext.h b/gpu/include/GrContext.h
index 93c012c..9df7105 100644
--- a/gpu/include/GrContext.h
+++ b/gpu/include/GrContext.h
@@ -27,6 +27,7 @@
 class GrVertexBufferAllocPool;

 class GrIndexBufferAllocPool;

 class GrInOrderDrawBuffer;

+class GrPathRenderer;

 

 class GrContext : public GrRefCnt {

 public:

@@ -277,19 +278,6 @@
                         const GrMatrix* srcMatrix = NULL);

 

     /**

-     * Path filling rules

-     */

-    enum PathFills {

-        kWinding_PathFill,

-        kEvenOdd_PathFill,

-        kInverseWinding_PathFill,

-        kInverseEvenOdd_PathFill,

-        kHairLine_PathFill,

-

-        kPathFillCount

-    };

-

-    /**

      * Tessellates and draws a path.

      *

      * @param paint         describes how to color pixels.

@@ -300,7 +288,7 @@
      */

     void drawPath(const GrPaint& paint,

                   GrPathIter* path,

-                  PathFills fill,

+                  GrPathFill fill,

                   const GrPoint* translate = NULL);

     /**

      * Draws vertices with a paint.

@@ -319,7 +307,7 @@
      *                          number of indices.

      */

     void drawVertices(const GrPaint& paint,

-                      GrDrawTarget::PrimitiveType primitiveType,

+                      GrPrimitiveType primitiveType,

                       int vertexCount,

                       const GrPoint positions[],

                       const GrPoint texs[],

@@ -358,7 +346,7 @@
               typename COL_SRC,

               typename IDX_SRC>

     void drawCustomVertices(const GrPaint& paint,

-                            GrDrawTarget::PrimitiveType primitiveType,

+                            GrPrimitiveType primitiveType,

                             const POS_SRC& posSrc,

                             const TEX_SRC* texCoordSrc,

                             const COL_SRC* colorSrc,

@@ -369,16 +357,16 @@
      */

     template <typename POS_SRC>

     void drawCustomVertices(const GrPaint& paint,

-                            GrDrawTarget::PrimitiveType primitiveType,

+                            GrPrimitiveType primitiveType,

                             const POS_SRC& posSrc);

     template <typename POS_SRC, typename TEX_SRC>

     void drawCustomVertices(const GrPaint& paint,

-                            GrDrawTarget::PrimitiveType primitiveType,

+                            GrPrimitiveType primitiveType,

                             const POS_SRC& posSrc,

                             const TEX_SRC* texCoordSrc);

     template <typename POS_SRC, typename TEX_SRC, typename COL_SRC>

     void drawCustomVertices(const GrPaint& paint,

-                            GrDrawTarget::PrimitiveType primitiveType,

+                            GrPrimitiveType primitiveType,

                             const POS_SRC& posSrc,

                             const TEX_SRC* texCoordSrc,

                             const COL_SRC* colorSrc);

@@ -466,6 +454,7 @@
     GrGpu*          fGpu;

     GrTextureCache* fTextureCache;

     GrFontCache*    fFontCache;

+    GrPathRenderer* fPathRenderer;

 

     GrVertexBufferAllocPool*    fDrawBufferVBAllocPool;

     GrIndexBufferAllocPool*     fDrawBufferIBAllocPool;