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

Unified Diff: src/gpu/batches/GrDrawVerticesBatch.cpp

Issue 1293583002: Introduce GrBatch subclasses GrDrawBatch and GrVertexBatch to prepare for non-drawing batches (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: remove duplicated fields in GrVertexBatch 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/batches/GrDrawVerticesBatch.h ('k') | src/gpu/batches/GrRectBatchFactory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/batches/GrDrawVerticesBatch.cpp
diff --git a/src/gpu/batches/GrDrawVerticesBatch.cpp b/src/gpu/batches/GrDrawVerticesBatch.cpp
index f36c54b067f1d18f14de02cb164e294ba7f9eaf6..ebfda362960433288fd7ff8e67d0b7ad64899175 100644
--- a/src/gpu/batches/GrDrawVerticesBatch.cpp
+++ b/src/gpu/batches/GrDrawVerticesBatch.cpp
@@ -184,13 +184,13 @@ void GrDrawVerticesBatch::generateGeometry(GrBatchTarget* batchTarget) {
}
bool GrDrawVerticesBatch::onCombineIfPossible(GrBatch* t, const GrCaps& caps) {
- if (!GrPipeline::CanCombine(*this->pipeline(), this->bounds(), *t->pipeline(), t->bounds(),
- caps)) {
+ GrDrawVerticesBatch* that = t->cast<GrDrawVerticesBatch>();
+
+ if (!GrPipeline::CanCombine(*this->pipeline(), this->bounds(), *that->pipeline(),
+ that->bounds(), caps)) {
return false;
}
- GrDrawVerticesBatch* that = t->cast<GrDrawVerticesBatch>();
-
if (!this->batchablePrimitiveType() || this->primitiveType() != that->primitiveType()) {
return false;
}
@@ -295,7 +295,7 @@ static void randomize_params(size_t count, size_t maxVertex, SkScalar min, SkSca
}
}
-BATCH_TEST_DEFINE(VerticesBatch) {
+DRAW_BATCH_TEST_DEFINE(VerticesBatch) {
GrPrimitiveType type = GrPrimitiveType(random->nextULessThan(kLast_GrPrimitiveType + 1));
uint32_t primitiveCount = random->nextRangeU(1, 100);
« no previous file with comments | « src/gpu/batches/GrDrawVerticesBatch.h ('k') | src/gpu/batches/GrRectBatchFactory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698