Refactor GrPipeline dynamic state.

Remove scissor rect from GrPipeline.

Draws can specify "fixed dynamic state" which doesn't use the dynamism at
all or can specify dynamic state arrays with an entry per GrMesh.

When we state other than scissor rects this will allow the caller to
use a mix of truly dynamic and fixed dynamic state. So a caller that
only has dynamic scissor rects doesn't need to store its remaining
unvarying state in an array.

Change-Id: I8fcc07eb600c72a26cc712b185755c2116021a8a
Reviewed-on: https://skia-review.googlesource.com/137223
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
diff --git a/src/gpu/ops/GrTextureOp.cpp b/src/gpu/ops/GrTextureOp.cpp
index a895230..bced31d 100644
--- a/src/gpu/ops/GrTextureOp.cpp
+++ b/src/gpu/ops/GrTextureOp.cpp
@@ -793,8 +793,10 @@
             args.fFlags |= GrPipeline::kHWAntialias_Flag;
         }
 
-        const GrPipeline* pipeline = target->allocPipeline(args, GrProcessorSet::MakeEmptySet(),
-                                                           target->detachAppliedClip());
+        auto clip = target->detachAppliedClip();
+        const auto* fixedDynamicState = target->allocFixedDynamicState(clip.scissorState().rect());
+        const auto* pipeline =
+                target->allocPipeline(args, GrProcessorSet::MakeEmptySet(), std::move(clip));
         using TessFn =
                 decltype(&TextureOp::tess<SkPoint, MultiTexture::kNo, Domain::kNo, GrAA::kNo>);
 #define TESS_FN_AND_VERTEX_SIZE(Point, MT, Domain, AA)                          \
@@ -866,7 +868,7 @@
             mesh.setNonIndexedNonInstanced(4);
         }
         mesh.setVertexData(vbuffer, vstart);
-        target->draw(gp.get(), pipeline, mesh);
+        target->draw(gp.get(), pipeline, fixedDynamicState, mesh);
     }
 
     bool onCombineIfPossible(GrOp* t, const GrCaps& caps) override {