Revert "Some scissor state cleanup."

This reverts commit a219419c9d76432dca74494b611ff1f59086d139.

Reason for revert: breaking things
Original change's description:
> Some scissor state cleanup.
> 
> Separate flushing the enablement of scissor from the rect in GrGLGpu.
> 
> Move GrPipeline::ScissorState to a global enum and use more broadly.
> Rename to GrScissorTest to avoid name conflict with existing
> GrScissorState.
> 
> Change-Id: Ib32160b3300bc12de2d2e1761d152fd1bba8b683
> Reviewed-on: https://skia-review.googlesource.com/137395
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Chris Dalton <csmartdalton@google.com>

TBR=bsalomon@google.com,csmartdalton@google.com

Change-Id: If71a5c5efc86d4239b40675bad2a6cb1f77460f8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/138900
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
diff --git a/tests/GLProgramsTest.cpp b/tests/GLProgramsTest.cpp
index 06b8f71..359527f 100644
--- a/tests/GLProgramsTest.cpp
+++ b/tests/GLProgramsTest.cpp
@@ -292,6 +292,9 @@
         return false;
     }
 
+    // dummy scissor state
+    GrScissorState scissor;
+
     SkRandom random;
     static const int NUM_TESTS = 1024;
     for (int t = 0; t < NUM_TESTS; t++) {
diff --git a/tests/GrMeshTest.cpp b/tests/GrMeshTest.cpp
index e8c124d..aa951c0 100644
--- a/tests/GrMeshTest.cpp
+++ b/tests/GrMeshTest.cpp
@@ -392,7 +392,7 @@
 
 void DrawMeshHelper::drawMesh(const GrMesh& mesh) {
     GrRenderTargetProxy* proxy = fState->drawOpArgs().fProxy;
-    GrPipeline pipeline(proxy, GrScissorTest::kDisabled, SkBlendMode::kSrc);
+    GrPipeline pipeline(proxy, GrPipeline::ScissorState::kDisabled, SkBlendMode::kSrc);
     GrMeshTestProcessor mtp(mesh.isInstanced(), mesh.hasVertexData());
     fState->rtCommandBuffer()->draw(mtp, pipeline, nullptr, nullptr, &mesh, 1,
                                     SkRect::MakeIWH(kImageWidth, kImageHeight));
diff --git a/tests/GrPipelineDynamicStateTest.cpp b/tests/GrPipelineDynamicStateTest.cpp
index ad63189..b2aaecc 100644
--- a/tests/GrPipelineDynamicStateTest.cpp
+++ b/tests/GrPipelineDynamicStateTest.cpp
@@ -28,6 +28,8 @@
  * scissor rectangles then reads back the result to verify a successful test.
  */
 
+using ScissorState = GrPipeline::ScissorState;
+
 static constexpr int kScreenSize = 6;
 static constexpr int kNumMeshes = 4;
 static constexpr int kScreenSplitX = kScreenSize/2;
@@ -111,18 +113,20 @@
     DEFINE_OP_CLASS_ID
 
     static std::unique_ptr<GrDrawOp> Make(GrContext* context,
-                                          GrScissorTest scissorTest,
+                                          ScissorState scissorState,
                                           sk_sp<const GrBuffer> vbuff) {
         GrOpMemoryPool* pool = context->contextPriv().opMemoryPool();
 
-        return pool->allocate<GrPipelineDynamicStateTestOp>(scissorTest, std::move(vbuff));
+        return pool->allocate<GrPipelineDynamicStateTestOp>(scissorState, std::move(vbuff));
     }
 
 private:
     friend class GrOpMemoryPool;
 
-    GrPipelineDynamicStateTestOp(GrScissorTest scissorTest, sk_sp<const GrBuffer> vbuff)
-            : INHERITED(ClassID()), fScissorTest(scissorTest), fVertexBuffer(std::move(vbuff)) {
+    GrPipelineDynamicStateTestOp(ScissorState scissorState, sk_sp<const GrBuffer> vbuff)
+        : INHERITED(ClassID())
+        , fScissorState(scissorState)
+        , fVertexBuffer(std::move(vbuff)) {
         this->setBounds(SkRect::MakeIWH(kScreenSize, kScreenSize),
                         HasAABloat::kNo, IsZeroArea::kNo);
     }
@@ -137,7 +141,7 @@
     void onPrepare(GrOpFlushState*) override {}
     void onExecute(GrOpFlushState* state) override {
         GrRenderTargetProxy* proxy = state->drawOpArgs().fProxy;
-        GrPipeline pipeline(proxy, fScissorTest, SkBlendMode::kSrc);
+        GrPipeline pipeline(proxy, fScissorState, SkBlendMode::kSrc);
         SkSTArray<kNumMeshes, GrMesh> meshes;
         for (int i = 0; i < kNumMeshes; ++i) {
             GrMesh& mesh = meshes.emplace_back(GrPrimitiveType::kTriangleStrip);
@@ -151,7 +155,7 @@
                                        SkRect::MakeIWH(kScreenSize, kScreenSize));
     }
 
-    GrScissorTest               fScissorTest;
+    ScissorState                fScissorState;
     const sk_sp<const GrBuffer> fVertexBuffer;
 
     typedef GrDrawOp INHERITED;
@@ -204,17 +208,17 @@
 
     uint32_t resultPx[kScreenSize * kScreenSize];
 
-    for (GrScissorTest scissorTest : {GrScissorTest::kEnabled, GrScissorTest::kDisabled}) {
+    for (ScissorState scissorState : {ScissorState::kEnabled, ScissorState::kDisabled}) {
         rtc->clear(nullptr, 0xbaaaaaad, GrRenderTargetContext::CanClearFullscreen::kYes);
         rtc->priv().testingOnly_addDrawOp(
-                GrPipelineDynamicStateTestOp::Make(context, scissorTest, vbuff));
+            GrPipelineDynamicStateTestOp::Make(context, scissorState, vbuff));
         rtc->readPixels(SkImageInfo::Make(kScreenSize, kScreenSize,
                                           kRGBA_8888_SkColorType, kPremul_SkAlphaType),
                         resultPx, 4 * kScreenSize, 0, 0, 0);
         for (int y = 0; y < kScreenSize; ++y) {
             for (int x = 0; x < kScreenSize; ++x) {
                 int expectedColorIdx;
-                if (scissorTest == GrScissorTest::kEnabled) {
+                if (ScissorState::kEnabled == scissorState) {
                     expectedColorIdx = (x < kScreenSplitX ? 0 : 2) + (y < kScreenSplitY ? 0 : 1);
                 } else {
                     expectedColorIdx = kNumMeshes - 1;
@@ -223,7 +227,7 @@
                 uint32_t actual = resultPx[y * kScreenSize + x];
                 if (expected != actual) {
                     ERRORF(reporter, "[scissor=%s] pixel (%i,%i): got 0x%x expected 0x%x",
-                           scissorTest == GrScissorTest::kEnabled ? "enabled" : "disabled", x, y,
+                           ScissorState::kEnabled == scissorState ? "enabled" : "disabled", x, y,
                            actual, expected);
                     return;
                 }