| Index: src/gpu/GrDrawTarget.cpp
|
| diff --git a/src/gpu/GrDrawTarget.cpp b/src/gpu/GrDrawTarget.cpp
|
| index 0184890cf2ce8631bc4b19e09b2b08a53b1ff039..d2c258d1d0760bd2244a3bc20f4438b4c5a49b68 100644
|
| --- a/src/gpu/GrDrawTarget.cpp
|
| +++ b/src/gpu/GrDrawTarget.cpp
|
| @@ -20,6 +20,8 @@
|
| #include "GrTexture.h"
|
| #include "GrVertexBuffer.h"
|
|
|
| +#include "batches/GrClearBatch.h"
|
| +#include "batches/GrDiscardBatch.h"
|
| #include "batches/GrDrawBatch.h"
|
| #include "batches/GrRectBatchFactory.h"
|
|
|
| @@ -340,8 +342,18 @@ void GrDrawTarget::clear(const SkIRect* rect,
|
| pipelineBuilder.setRenderTarget(renderTarget);
|
|
|
| this->drawSimpleRect(pipelineBuilder, color, SkMatrix::I(), *rect);
|
| - } else {
|
| - this->onClear(*rect, color, renderTarget);
|
| + } else {
|
| + GrBatch* batch = SkNEW_ARGS(GrClearBatch, (*rect, color, renderTarget));
|
| + this->onDrawBatch(batch);
|
| + batch->unref();
|
| + }
|
| +}
|
| +
|
| +void GrDrawTarget::discard(GrRenderTarget* renderTarget) {
|
| + if (this->caps()->discardRenderTargetSupport()) {
|
| + GrBatch* batch = SkNEW_ARGS(GrDiscardBatch, (renderTarget));
|
| + this->onDrawBatch(batch);
|
| + batch->unref();
|
| }
|
| }
|
|
|
|
|