aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrDrawTarget.cpp
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2015-08-18 09:20:09 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-08-18 09:20:09 -0700
commit5346983b2e0726b4009cc546b01c58a8919e6c36 (patch)
treed2b83b17e9f0c2482278d9b808199f95462d942d /src/gpu/GrDrawTarget.cpp
parentd55d13af4f73d00e9d8f95d233f977de3df83d05 (diff)
Put clear and discard into GrBatch.
Diffstat (limited to 'src/gpu/GrDrawTarget.cpp')
-rw-r--r--src/gpu/GrDrawTarget.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/gpu/GrDrawTarget.cpp b/src/gpu/GrDrawTarget.cpp
index 0184890cf2..d2c258d1d0 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();
}
}