| Index: src/gpu/GrDrawTarget.cpp
|
| diff --git a/src/gpu/GrDrawTarget.cpp b/src/gpu/GrDrawTarget.cpp
|
| index 4ab467ccf43ad16a6d69d4d6f76ca25e5f773ad7..c424f5a593929b6ba7db0d15685f99b4a9d3cfb3 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 @@ void GrDrawTarget::addBatch(sk_sp<GrBatch> batch) {
|
| 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());
|
|
|