Add a full clear method to GrDrawTarget.

This will allow us to avoid ClearBatch creation for successive clears.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2233043002

Review-Url: https://codereview.chromium.org/2233043002
diff --git a/src/gpu/GrDrawTarget.cpp b/src/gpu/GrDrawTarget.cpp
index 4ab467c..c424f5a 100644
--- a/src/gpu/GrDrawTarget.cpp
+++ b/src/gpu/GrDrawTarget.cpp
@@ -26,6 +26,7 @@
 
 #include "SkStrokeRec.h"
 
+#include "batches/GrClearBatch.h"
 #include "batches/GrClearStencilClipBatch.h"
 #include "batches/GrCopySurfaceBatch.h"
 #include "batches/GrDiscardBatch.h"
@@ -456,7 +457,18 @@
     this->recordBatch(batch.get(), batch->bounds());
 }
 
+void GrDrawTarget::fullClear(GrRenderTarget* renderTarget, GrColor color) {
+    // Currently this just inserts a clear batch. However, once in MDB this can remove all the
+    // previously recorded batches and change the load op to clear with supplied color.
+    sk_sp<GrBatch> batch = GrClearBatch::Make(SkIRect::MakeWH(renderTarget->width(),
+                                                              renderTarget->height()),
+                                              color, renderTarget);
+    this->recordBatch(batch.get(), batch->bounds());
+}
+
 void GrDrawTarget::discard(GrRenderTarget* renderTarget) {
+    // Currently this just inserts a discard batch. However, once in MDB this can remove all the
+    // previously recorded batches and change the load op to discard.
     if (this->caps()->discardRenderTargetSupport()) {
         GrBatch* batch = new GrDiscardBatch(renderTarget);
         this->recordBatch(batch, batch->bounds());