Chromium Code Reviews| Index: src/gpu/GrDrawTarget.cpp |
| diff --git a/src/gpu/GrDrawTarget.cpp b/src/gpu/GrDrawTarget.cpp |
| index 4ab467ccf43ad16a6d69d4d6f76ca25e5f773ad7..cfe14fb4882abd5b5ea729b18714133de1f26294 100644 |
| --- a/src/gpu/GrDrawTarget.cpp |
| +++ b/src/gpu/GrDrawTarget.cpp |
| @@ -27,6 +27,7 @@ |
| #include "SkStrokeRec.h" |
| #include "batches/GrClearStencilClipBatch.h" |
|
robertphillips
2016/08/10 18:33:52
up one line ?
|
| +#include "batches/GrClearBatch.h" |
| #include "batches/GrCopySurfaceBatch.h" |
| #include "batches/GrDiscardBatch.h" |
| #include "batches/GrDrawBatch.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()); |