Make GrResource know whether 3D objects' lifetimes are managed by Skia or not.
Review URL: https://codereview.appspot.com/7201046
git-svn-id: http://skia.googlecode.com/svn/trunk@7348 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/gl/GrGLPath.cpp b/src/gpu/gl/GrGLPath.cpp
index 1de8713..8c6e11e 100644
--- a/src/gpu/gl/GrGLPath.cpp
+++ b/src/gpu/gl/GrGLPath.cpp
@@ -54,7 +54,9 @@
#endif
}
-GrGLPath::GrGLPath(GrGpuGL* gpu, const SkPath& path) : INHERITED(gpu) {
+static const bool kIsWrapped = false; // The constructor creates the GL path object.
+
+GrGLPath::GrGLPath(GrGpuGL* gpu, const SkPath& path) : INHERITED(gpu, kIsWrapped) {
GL_CALL_RET(fPathID, GenPaths(1));
SkPath::Iter iter(path, true);
@@ -92,7 +94,7 @@
}
void GrGLPath::onRelease() {
- if (0 != fPathID) {
+ if (0 != fPathID && !this->isWrapped()) {
GL_CALL(DeletePaths(fPathID, 1));
fPathID = 0;
}
@@ -105,4 +107,3 @@
INHERITED::onAbandon();
}
-