From 19dd017a6256be636ccb550752bb563c4e7caeb5 Mon Sep 17 00:00:00 2001 From: "commit-bot@chromium.org" Date: Mon, 5 Aug 2013 13:28:55 +0000 Subject: Fix a crash on stroking empty paths with nv_path_rendering enabled Fix the crash by defining that GrPathRenderer::drawPath and GrPathRenderer::stencilPath are called only with non-empty paths. Adds a new test "GpuDrawPath" and tests the condition. BUG=1477 R=bsalomon@google.com Author: kkinnunen@nvidia.com Review URL: https://chromiumcodereview.appspot.com/22173002 git-svn-id: http://skia.googlecode.com/svn/trunk@10528 2bbb7eff-a529-9590-31e7-b0007b416f81 --- src/gpu/GrPathRenderer.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/gpu/GrPathRenderer.h') diff --git a/src/gpu/GrPathRenderer.h b/src/gpu/GrPathRenderer.h index f1402d6b23..a64b9e3444 100644 --- a/src/gpu/GrPathRenderer.h +++ b/src/gpu/GrPathRenderer.h @@ -117,6 +117,7 @@ public: const SkStrokeRec& stroke, GrDrawTarget* target, bool antiAlias) { + GrAssert(!path.isEmpty()); GrAssert(this->canDrawPath(path, stroke, target, antiAlias)); GrAssert(target->drawState()->getStencil().isDisabled() || kNoRestriction_StencilSupport == this->getStencilSupport(path, stroke, target)); @@ -132,6 +133,7 @@ public: * @param target target that the path will be rendered to */ void stencilPath(const SkPath& path, const SkStrokeRec& stroke, GrDrawTarget* target) { + GrAssert(!path.isEmpty()); GrAssert(kNoSupport_StencilSupport != this->getStencilSupport(path, stroke, target)); this->onStencilPath(path, stroke, target); } -- cgit v1.2.3