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 <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This commit is contained in:
Brian Salomon 2017-06-16 17:30:59 -04:00 committed by Skia Commit-Bot
parent 7a808d618e
commit 5f970fe6be
2 changed files with 6 additions and 4 deletions

View File

@ -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 {

View File

@ -1546,11 +1546,11 @@ void GrRenderTargetContext::drawPath(const GrClip& clip,
if (fills_as_nested_rects(viewMatrix, path, rects)) {
std::unique_ptr<GrDrawOp> 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;