Only use scissor state for native clears

This is the first of many CLs that progressively refine the clipping,
scissoring, and clearing APIs.

The series of changes focus on simplifying the clear APIs, consolidating
clip intersection logic, and moving towards a more explicitly sized
render target context (where confusion between approx-fit and exact-fit
is handled externally, although I don't take it that far).

Next step will be to propagate the simpler calls up to GrRTC.

Bug:skia:10205
Change-Id: Idb0c58a63b7a3950a92604dd4c03536d668be7c4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290123
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
diff --git a/src/gpu/ops/GrClearOp.cpp b/src/gpu/ops/GrClearOp.cpp
index 28529f4..dc1b939 100644
--- a/src/gpu/ops/GrClearOp.cpp
+++ b/src/gpu/ops/GrClearOp.cpp
@@ -15,17 +15,17 @@
 #include "src/gpu/GrRecordingContextPriv.h"
 
 std::unique_ptr<GrClearOp> GrClearOp::Make(GrRecordingContext* context,
-                                           const GrFixedClip& clip,
+                                           const GrScissorState& scissor,
                                            const SkPMColor4f& color,
                                            GrSurfaceProxy* dstProxy) {
     const SkIRect rect = SkIRect::MakeSize(dstProxy->dimensions());
-    if (clip.scissorEnabled() && !SkIRect::Intersects(clip.scissorRect(), rect)) {
+    if (scissor.enabled() && !SkIRect::Intersects(scissor.rect(), rect)) {
         return nullptr;
     }
 
     GrOpMemoryPool* pool = context->priv().opMemoryPool();
 
-    return pool->allocate<GrClearOp>(clip, color, dstProxy);
+    return pool->allocate<GrClearOp>(scissor, color, dstProxy);
 }
 
 std::unique_ptr<GrClearOp> GrClearOp::Make(GrRecordingContext* context,
@@ -39,27 +39,27 @@
     return pool->allocate<GrClearOp>(rect, color, fullScreen);
 }
 
-GrClearOp::GrClearOp(const GrFixedClip& clip, const SkPMColor4f& color, GrSurfaceProxy* proxy)
+GrClearOp::GrClearOp(const GrScissorState& scissor, const SkPMColor4f& color, GrSurfaceProxy* proxy)
         : INHERITED(ClassID())
-        , fClip(clip)
+        , fScissor(scissor)
         , fColor(color) {
     const SkIRect rtRect = SkIRect::MakeSize(proxy->dimensions());
-    if (fClip.scissorEnabled()) {
+    if (fScissor.enabled()) {
         // Don't let scissors extend outside the RT. This may improve op combining.
-        if (!fClip.intersect(rtRect)) {
+        if (!fScissor.intersect(rtRect)) {
             SkASSERT(0);  // should be caught upstream
-            fClip = GrFixedClip(SkIRect::MakeEmpty());
+            fScissor.set(SkIRect::MakeEmpty());
         }
 
-        if (proxy->isFunctionallyExact() && fClip.scissorRect() == rtRect) {
-            fClip.disableScissor();
+        if (proxy->isFunctionallyExact() && fScissor.rect() == rtRect) {
+            fScissor.setDisabled();
         }
     }
-    this->setBounds(SkRect::Make(fClip.scissorEnabled() ? fClip.scissorRect() : rtRect),
+    this->setBounds(SkRect::Make(fScissor.enabled() ? fScissor.rect() : rtRect),
                     HasAABloat::kNo, IsHairline::kNo);
 }
 
 void GrClearOp::onExecute(GrOpFlushState* state, const SkRect& chainBounds) {
     SkASSERT(state->opsRenderPass());
-    state->opsRenderPass()->clear(fClip, fColor);
+    state->opsRenderPass()->clear(fScissor, fColor);
 }