Introduce GrBatch subclasses GrDrawBatch and GrVertexBatch to prepare for non-drawing batches
Review URL: https://codereview.chromium.org/1293583002
diff --git a/src/gpu/batches/GrAAStrokeRectBatch.cpp b/src/gpu/batches/GrAAStrokeRectBatch.cpp
index 0083aaa..91ff230 100644
--- a/src/gpu/batches/GrAAStrokeRectBatch.cpp
+++ b/src/gpu/batches/GrAAStrokeRectBatch.cpp
@@ -204,13 +204,13 @@
}
bool GrAAStrokeRectBatch::onCombineIfPossible(GrBatch* t, const GrCaps& caps) {
- if (!GrPipeline::CanCombine(*this->pipeline(), this->bounds(), *t->pipeline(), t->bounds(),
- caps)) {
+ GrAAStrokeRectBatch* that = t->cast<GrAAStrokeRectBatch>();
+
+ if (!GrPipeline::CanCombine(*this->pipeline(), this->bounds(), *that->pipeline(),
+ that->bounds(), caps)) {
return false;
}
- GrAAStrokeRectBatch* that = t->cast<GrAAStrokeRectBatch>();
-
// TODO batch across miterstroke changes
if (this->miterStroke() != that->miterStroke()) {
return false;
@@ -356,7 +356,7 @@
#include "GrBatchTest.h"
-BATCH_TEST_DEFINE(AAStrokeRectBatch) {
+DRAW_BATCH_TEST_DEFINE(AAStrokeRectBatch) {
bool miterStroke = random->nextBool();
// Create mock stroke rect