Move GrDrawTarget::clear logic into GrDrawContext
I found it a bit worrisome that GrDrawTarget was calling back into GrDrawContext. This also moves GrDrawTarget closer to being a simple-ish container of batches.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2145643003
Review-Url: https://codereview.chromium.org/2145643003
diff --git a/src/gpu/GrDrawTarget.h b/src/gpu/GrDrawTarget.h
index 7b268c2..5f91baa 100644
--- a/src/gpu/GrDrawTarget.h
+++ b/src/gpu/GrDrawTarget.h
@@ -106,6 +106,8 @@
void drawBatch(const GrPipelineBuilder&, GrDrawContext*, const GrClip&, GrDrawBatch*);
+ void addBatch(sk_sp<GrBatch>);
+
/**
* Draws path into the stencil buffer. The fill must be either even/odd or
* winding (not inverse or hairline). It will respect the HW antialias flag
@@ -116,16 +118,6 @@
const GrClip&, const SkMatrix& viewMatrix,
const GrPath*, GrPathRendering::FillType);
- /**
- * Clear the passed in drawContext. Ignores the GrPipelineBuilder and clip. Clears the whole
- * thing if rect is nullptr, otherwise just the rect. If canIgnoreRect is set then the entire
- * drawContext can be optionally cleared.
- */
- void clear(const SkIRect* rect,
- GrColor color,
- bool canIgnoreRect,
- GrDrawContext*);
-
/** Discards the contents render target. */
void discard(GrRenderTarget*);