Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(200)

Unified Diff: src/gpu/GrDrawTarget.cpp

Issue 1293563003: Put clear and discard into GrBatch. (Closed) Base URL: https://skia.googlesource.com/skia.git@protectedprepare
Patch Set: tiny Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrDrawTarget.h ('k') | src/gpu/GrImmediateDrawTarget.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
}
}
« no previous file with comments | « src/gpu/GrDrawTarget.h ('k') | src/gpu/GrImmediateDrawTarget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698