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>
diff --git a/src/gpu/GrProcessorSet.cpp b/src/gpu/GrProcessorSet.cpp
index e073679..6c9e55d 100644
--- a/src/gpu/GrProcessorSet.cpp
+++ b/src/gpu/GrProcessorSet.cpp
@@ -23,9 +23,11 @@
         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 a6dcdf6..2a04b1e 100644
--- a/src/gpu/GrRenderTargetContext.cpp
+++ b/src/gpu/GrRenderTargetContext.cpp
@@ -1546,11 +1546,11 @@
             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;