aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl/GrGLPath.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/gl/GrGLPath.cpp')
-rw-r--r--src/gpu/gl/GrGLPath.cpp27
1 files changed, 24 insertions, 3 deletions
diff --git a/src/gpu/gl/GrGLPath.cpp b/src/gpu/gl/GrGLPath.cpp
index e09d073ee2..1626bb0822 100644
--- a/src/gpu/gl/GrGLPath.cpp
+++ b/src/gpu/gl/GrGLPath.cpp
@@ -54,11 +54,12 @@ 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;
#ifndef SK_SCALAR_IS_FLOAT
- GrCrash("Expected scalar is float.");
+ GR_STATIC_ASSERT(false);
#endif
SkSTArray<16, SkPoint, true> pathPoints;
@@ -82,8 +83,8 @@ GrGLPath::GrGLPath(GrGpuGL* gpu, const SkPath& path) : INHERITED(gpu) {
GL_CALL(PathCommands(fPathID,
verbCnt, &pathCommands[0],
2 * pointCnt, GR_GL_FLOAT, &pathPoints[0]));
- GrRect bounds = path.getBounds();
- bounds.roundOut(&fBounds);
+ //GrPrintf("\tPathCommands ID: %d\n", fPathID);
+ fBounds = path.getBounds();
}
GrGLPath::~GrGLPath() {
@@ -92,7 +93,27 @@ 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
fPathID = 0;
}
}