Fix bug in calling NV DeletePaths
authorbsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Mon, 9 Jul 2012 14:30:26 +0000 (14:30 +0000)
committerbsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Mon, 9 Jul 2012 14:30:26 +0000 (14:30 +0000)
Review URL: http://codereview.appspot.com/6345078/

git-svn-id: http://skia.googlecode.com/svn/trunk@4467 2bbb7eff-a529-9590-31e7-b0007b416f81

src/gpu/gl/GrGLPath.cpp
src/gpu/gl/GrGpuGL.cpp

index 34be43b..217cf4d 100644 (file)
@@ -54,7 +54,6 @@ inline int num_pts(const SkPath::Verb verb) {
 
 GrGLPath::GrGLPath(GrGpuGL* gpu, const SkPath& path) : INHERITED(gpu) {
     GL_CALL_RET(fPathID, GenPaths(1));
-    //GrPrintf("\tGenPaths ID: %d\n", fPathID);
     SkPath::Iter iter(path, true);
 
     SkSTArray<16, GrGLubyte, true> pathCommands;
@@ -83,7 +82,6 @@ GrGLPath::GrGLPath(GrGpuGL* gpu, const SkPath& path) : INHERITED(gpu) {
     GL_CALL(PathCommands(fPathID,
                          verbCnt, &pathCommands[0],
                          2 * pointCnt, GR_GL_FLOAT, &pathPoints[0]));
-    //GrPrintf("\tPathCommands ID: %d\n", fPathID);
     fBounds = path.getBounds();
 }
 
@@ -93,27 +91,7 @@ GrGLPath::~GrGLPath() {
 
 void GrGLPath::onRelease() {
     if (0 != fPathID) {
-    // FIXME: When we draw a clipped path we may get a call sequence that looks
-    // like this:
-    // GenPaths(1, &fPathID); // fPathID = 1, the path to draw
-    // PathCommands(1, ...);
-    // GenPaths(1, &fPathID); // fPathID = 2, the clip path
-    // PathCommands(2, ...);
-    // PathStencilFunc(...);
-    // StencilFillPath(2, ...); // draw the clip
-    // DeletePath(1, &fPathID); // fPathID == 2
-    // PathStencilFunc(...);
-    // StencilFillPath(2, ...); // draw the path
-    // DeletePath(1, &fPathID); // fPathID == 1
-    //
-    // Deleting the clip path causes the second StencilFillPath to fail with
-    // INVALID_OPERATION.
-#if 0
-        GL_CALL(DeletePaths(1, fPathID));
-        //GrPrintf("\tDeletePaths ID: %d\n", fPathID);
-#else
-        //GrPrintf("\tLeak Path ID: %d\n", fPathID);
-#endif
+        GL_CALL(DeletePaths(fPathID, 1));
         fPathID = 0;
     }
 }
index e49c664..5baca24 100644 (file)
@@ -1812,7 +1812,6 @@ void GrGpuGL::onGpuStencilPath(const GrPath* path, GrPathFill fill) {
     }
     GrGLint writeMask = fStencilSettings.writeMask(GrStencilSettings::kFront_Face);
     GL_CALL(StencilFillPath(id, fillMode, writeMask));
-    //GrPrintf("\tStencilFillPath ID: %d\n", id);
 }
 
 void GrGpuGL::onResolveRenderTarget(GrRenderTarget* target) {