From 5f970fe6bed7a40ba95365bfe3220f18699a9176 Mon Sep 17 00:00:00 2001 From: Brian Salomon Date: Fri, 16 Jun 2017 17:30:59 -0400 Subject: [PATCH] Fix logic error when drawing path as nested rects Bug: chromium:732350 Change-Id: I42770e9fa8c201780f16ce8df58b208e08aef640 Reviewed-on: https://skia-review.googlesource.com/20158 Reviewed-by: Brian Salomon Commit-Queue: Brian Salomon --- src/gpu/GrProcessorSet.cpp | 2 ++ src/gpu/GrRenderTargetContext.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/gpu/GrProcessorSet.cpp b/src/gpu/GrProcessorSet.cpp index e073679d44..6c9e55df86 100644 --- a/src/gpu/GrProcessorSet.cpp +++ b/src/gpu/GrProcessorSet.cpp @@ -23,9 +23,11 @@ GrProcessorSet::GrProcessorSet(GrPaint&& paint) : fXP(paint.getXPFactory()) { fFragmentProcessors.reset(paint.numTotalFragmentProcessors()); int i = 0; for (auto& fp : paint.fColorFragmentProcessors) { + SkASSERT(fp.get()); fFragmentProcessors[i++] = fp.release(); } for (auto& fp : paint.fCoverageFragmentProcessors) { + SkASSERT(fp.get()); fFragmentProcessors[i++] = fp.release(); } } else { diff --git a/src/gpu/GrRenderTargetContext.cpp b/src/gpu/GrRenderTargetContext.cpp index a6dcdf600a..2a04b1e651 100644 --- a/src/gpu/GrRenderTargetContext.cpp +++ b/src/gpu/GrRenderTargetContext.cpp @@ -1546,11 +1546,11 @@ void GrRenderTargetContext::drawPath(const GrClip& clip, if (fills_as_nested_rects(viewMatrix, path, rects)) { std::unique_ptr op = GrRectOpFactory::MakeAAFillNestedRects(std::move(paint), viewMatrix, rects); - if (!op) { - // A null return indicates that there is nothing to draw in this case. - return; + if (op) { + this->addDrawOp(clip, std::move(op)); } - this->addDrawOp(clip, std::move(op)); + // A null return indicates that there is nothing to draw in this case. + return; } } SkRect ovalRect;