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

Unified Diff: src/gpu/GrDefaultPathRenderer.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/GrCommandBuilder.h ('k') | src/gpu/GrDrawContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrDefaultPathRenderer.cpp
diff --git a/src/gpu/GrDefaultPathRenderer.cpp b/src/gpu/GrDefaultPathRenderer.cpp
index 1dd9deb891dfa8aef546b4dc85b7c589b9187ec8..5353877769086d65d00ceec5688f6929c8fb4500 100644
--- a/src/gpu/GrDefaultPathRenderer.cpp
+++ b/src/gpu/GrDefaultPathRenderer.cpp
@@ -209,7 +209,7 @@ static inline void add_quad(SkPoint** vert, const SkPoint* base, const SkPoint p
}
}
-class DefaultPathBatch : public GrBatch {
+class DefaultPathBatch : public GrVertexBatch {
public:
struct Geometry {
GrColor fColor;
@@ -217,8 +217,9 @@ public:
SkScalar fTolerance;
};
- static GrBatch* Create(const Geometry& geometry, uint8_t coverage, const SkMatrix& viewMatrix,
- bool isHairline, const SkRect& devBounds) {
+ static GrDrawBatch* Create(const Geometry& geometry, uint8_t coverage,
+ const SkMatrix& viewMatrix, bool isHairline,
+ const SkRect& devBounds) {
return SkNEW_ARGS(DefaultPathBatch, (geometry, coverage, viewMatrix, isHairline,
devBounds));
}
@@ -387,13 +388,12 @@ private:
}
bool onCombineIfPossible(GrBatch* t, const GrCaps& caps) override {
- if (!GrPipeline::CanCombine(*this->pipeline(), this->bounds(), *t->pipeline(), t->bounds(),
- caps)) {
+ DefaultPathBatch* that = t->cast<DefaultPathBatch>();
+ if (!GrPipeline::CanCombine(*this->pipeline(), this->bounds(), *that->pipeline(),
+ that->bounds(), caps)) {
return false;
}
- DefaultPathBatch* that = t->cast<DefaultPathBatch>();
-
if (this->color() != that->color()) {
return false;
}
@@ -697,8 +697,9 @@ bool GrDefaultPathRenderer::internalDrawPath(GrDrawTarget* target,
geometry.fPath = path;
geometry.fTolerance = srcSpaceTol;
- SkAutoTUnref<GrBatch> batch(DefaultPathBatch::Create(geometry, newCoverage, viewMatrix,
- isHairline, devBounds));
+ SkAutoTUnref<GrDrawBatch> batch(DefaultPathBatch::Create(geometry, newCoverage,
+ viewMatrix, isHairline,
+ devBounds));
target->drawBatch(*pipelineBuilder, batch);
}
@@ -734,7 +735,7 @@ void GrDefaultPathRenderer::onStencilPath(const StencilPathArgs& args) {
#ifdef GR_TEST_UTILS
-BATCH_TEST_DEFINE(DefaultPathBatch) {
+DRAW_BATCH_TEST_DEFINE(DefaultPathBatch) {
GrColor color = GrRandomColor(random);
SkMatrix viewMatrix = GrTest::TestMatrix(random);
« no previous file with comments | « src/gpu/GrCommandBuilder.h ('k') | src/gpu/GrDrawContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698