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

Unified Diff: src/gpu/GrTargetCommands.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/GrTargetCommands.h ('k') | src/gpu/batches/GrBatch.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrTargetCommands.cpp
diff --git a/src/gpu/GrTargetCommands.cpp b/src/gpu/GrTargetCommands.cpp
index c2006d731fcda528a0968c93ed1295caef191258..7a7566113f1372dae40e0f6154c6753aff39b47a 100644
--- a/src/gpu/GrTargetCommands.cpp
+++ b/src/gpu/GrTargetCommands.cpp
@@ -30,11 +30,7 @@ void GrTargetCommands::flush(GrGpu* gpu, GrResourceProvider* resourceProvider) {
while (genIter.next()) {
if (Cmd::kDrawBatch_CmdType == genIter->type()) {
DrawBatch* db = reinterpret_cast<DrawBatch*>(genIter.get());
- // TODO: encapsulate the specialization of GrVertexBatch in GrVertexBatch so that we can
- // remove this cast. Currently all GrDrawBatches are in fact GrVertexBatch.
- GrVertexBatch* vertexBatch = static_cast<GrVertexBatch*>(db->batch());
-
- vertexBatch->prepareDraws(&flushState);
+ db->batch()->prepare(&flushState);
}
}
@@ -77,19 +73,7 @@ void GrTargetCommands::DrawPaths::execute(GrBatchFlushState* state) {
}
void GrTargetCommands::DrawBatch::execute(GrBatchFlushState* state) {
- // TODO: encapsulate the specialization of GrVertexBatch in GrVertexBatch so that we can
- // remove this cast. Currently all GrDrawBatches are in fact GrVertexBatch.
- GrVertexBatch* vertexBatch = static_cast<GrVertexBatch*>(fBatch.get());
- vertexBatch->issueDraws(state);
-}
-
-
-void GrTargetCommands::Clear::execute(GrBatchFlushState* state) {
- if (GrColor_ILLEGAL == fColor) {
- state->gpu()->discard(this->renderTarget());
- } else {
- state->gpu()->clear(fRect, fColor, this->renderTarget());
- }
+ fBatch->draw(state);
}
void GrTargetCommands::ClearStencilClip::execute(GrBatchFlushState* state) {
« no previous file with comments | « src/gpu/GrTargetCommands.h ('k') | src/gpu/batches/GrBatch.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698