Towards NV path rendering

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



git-svn-id: http://skia.googlecode.com/svn/trunk@4219 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/GrGpu.cpp b/src/gpu/GrGpu.cpp
index 9e26135..7765d24 100644
--- a/src/gpu/GrGpu.cpp
+++ b/src/gpu/GrGpu.cpp
@@ -226,6 +226,12 @@
     return this->onCreateIndexBuffer(size, dynamic);
 }
 
+GrPath* GrGpu::createPath(const SkPath& path) {
+    GrAssert(fCaps.fPathStencilingSupport);
+    this->handleDirtyContext();
+    return this->onCreatePath(path);
+}
+
 void GrGpu::clear(const GrIRect* rect, GrColor color) {
     if (NULL == this->getDrawState().getRenderTarget()) {
         return;
@@ -358,7 +364,7 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 
-bool GrGpu::setupClipAndFlushState(GrPrimitiveType type) {
+bool GrGpu::setupClipAndFlushState(DrawType type) {
 
     ScissoringSettings scissoringSettings;
 
@@ -410,7 +416,7 @@
 
     this->handleDirtyContext();
 
-    if (!this->setupClipAndFlushState(type)) {
+    if (!this->setupClipAndFlushState(PrimTypeToDrawType(type))) {
         return;
     }
 
@@ -423,11 +429,11 @@
 }
 
 void GrGpu::onDrawNonIndexed(GrPrimitiveType type,
-                           int startVertex,
-                           int vertexCount) {
+                             int startVertex,
+                             int vertexCount) {
     this->handleDirtyContext();
 
-    if (!this->setupClipAndFlushState(type)) {
+    if (!this->setupClipAndFlushState(PrimTypeToDrawType(type))) {
         return;
     }
 
@@ -437,6 +443,16 @@
     this->onGpuDrawNonIndexed(type, sVertex, vertexCount);
 }
 
+void GrGpu::onStencilPath(const GrPath& path, GrPathFill fill) {
+    this->handleDirtyContext();
+
+    if (!this->setupClipAndFlushState(kStencilPath_DrawType)) {
+        return;
+    }
+
+    this->onGpuStencilPath(path, fill);
+}
+
 void GrGpu::finalizeReservedVertices() {
     GrAssert(NULL != fVertexPool);
     fVertexPool->unlock();