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

Unified Diff: src/gpu/batches/GrDrawAtlasBatch.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/GrDrawAtlasBatch.h ('k') | src/gpu/batches/GrDrawVerticesBatch.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/batches/GrDrawAtlasBatch.cpp
diff --git a/src/gpu/batches/GrDrawAtlasBatch.cpp b/src/gpu/batches/GrDrawAtlasBatch.cpp
index f79412be548562e40d6346011688e103c6767392..28c6922d99fadf4af0a4a6f54b43b28837932a3a 100644
--- a/src/gpu/batches/GrDrawAtlasBatch.cpp
+++ b/src/gpu/batches/GrDrawAtlasBatch.cpp
@@ -157,13 +157,13 @@ GrDrawAtlasBatch::GrDrawAtlasBatch(const Geometry& geometry, const SkMatrix& vie
}
bool GrDrawAtlasBatch::onCombineIfPossible(GrBatch* t, const GrCaps& caps) {
- if (!GrPipeline::CanCombine(*this->pipeline(), this->bounds(), *t->pipeline(), t->bounds(),
- caps)) {
+ GrDrawAtlasBatch* that = t->cast<GrDrawAtlasBatch>();
+
+ if (!GrPipeline::CanCombine(*this->pipeline(), this->bounds(), *that->pipeline(),
+ that->bounds(), caps)) {
return false;
}
-
- GrDrawAtlasBatch* that = t->cast<GrDrawAtlasBatch>();
-
+
// We currently use a uniform viewmatrix for this batch
if (!this->viewMatrix().cheapEqualTo(that->viewMatrix())) {
return false;
@@ -231,7 +231,7 @@ static void randomize_params(uint32_t count, SkRandom* random,
}
}
-BATCH_TEST_DEFINE(GrDrawAtlasBatch) {
+DRAW_BATCH_TEST_DEFINE(GrDrawAtlasBatch) {
uint32_t spriteCount = random->nextRangeU(1, 100);
SkTArray<SkRSXform> xforms(spriteCount);
« no previous file with comments | « src/gpu/batches/GrDrawAtlasBatch.h ('k') | src/gpu/batches/GrDrawVerticesBatch.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698