Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(693)

Unified Diff: src/gpu/gl/GrGLPath.cpp

Issue 22173002: Fix a crash on stroking empty paths with nv_path_rendering enabled (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrPathRenderer.h ('k') | tests/GpuDrawPathTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLPath.cpp
diff --git a/src/gpu/gl/GrGLPath.cpp b/src/gpu/gl/GrGLPath.cpp
index 63c2fa107c66a0c3e2490636de81eda5fc9b3200..d46fa03b5e039e04248b4dfdc33466783edd0bce 100644
--- a/src/gpu/gl/GrGLPath.cpp
+++ b/src/gpu/gl/GrGLPath.cpp
@@ -59,13 +59,14 @@ inline int num_pts(const SkPath::Verb verb) {
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);
-
- SkSTArray<16, GrGLubyte, true> pathCommands;
#ifndef SK_SCALAR_IS_FLOAT
GrCrash("Assumes scalar is float.");
#endif
+ SkASSERT(!path.isEmpty());
+
+ GL_CALL_RET(fPathID, GenPaths(1));
+
+ SkSTArray<16, GrGLubyte, true> pathCommands;
SkSTArray<16, SkPoint, true> pathPoints;
int verbCnt = path.countVerbs();
« no previous file with comments | « src/gpu/GrPathRenderer.h ('k') | tests/GpuDrawPathTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698