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

Unified Diff: src/gpu/GrAAConvexPathRenderer.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 | « include/gpu/GrDrawContext.h ('k') | src/gpu/GrAADistanceFieldPathRenderer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrAAConvexPathRenderer.cpp
diff --git a/src/gpu/GrAAConvexPathRenderer.cpp b/src/gpu/GrAAConvexPathRenderer.cpp
index b5bea9f5533ae273db2eba0e9eaa8bb9f63d6c7a..ac142e2ad6cb490ebefffa4ace59e59b6b39111c 100644
--- a/src/gpu/GrAAConvexPathRenderer.cpp
+++ b/src/gpu/GrAAConvexPathRenderer.cpp
@@ -739,7 +739,7 @@ static const GrGeometryProcessor* create_fill_gp(bool tweakAlphaForCoverage,
return CreateForDeviceSpace(color, coverage, localCoords, viewMatrix);
}
-class AAConvexPathBatch : public GrBatch {
+class AAConvexPathBatch : public GrVertexBatch {
public:
struct Geometry {
GrColor fColor;
@@ -747,7 +747,7 @@ public:
SkPath fPath;
};
- static GrBatch* Create(const Geometry& geometry) {
+ static GrDrawBatch* Create(const Geometry& geometry) {
return SkNEW_ARGS(AAConvexPathBatch, (geometry));
}
@@ -941,13 +941,12 @@ private:
}
bool onCombineIfPossible(GrBatch* t, const GrCaps& caps) override {
- if (!GrPipeline::CanCombine(*this->pipeline(), this->bounds(), *t->pipeline(), t->bounds(),
- caps)) {
+ AAConvexPathBatch* that = t->cast<AAConvexPathBatch>();
+ if (!GrPipeline::CanCombine(*this->pipeline(), this->bounds(), *that->pipeline(),
+ that->bounds(), caps)) {
return false;
}
- AAConvexPathBatch* that = t->cast<AAConvexPathBatch>();
-
if (this->color() != that->color()) {
return false;
}
@@ -1002,7 +1001,7 @@ bool GrAAConvexPathRenderer::onDrawPath(const DrawPathArgs& args) {
geometry.fViewMatrix = *args.fViewMatrix;
geometry.fPath = *args.fPath;
- SkAutoTUnref<GrBatch> batch(AAConvexPathBatch::Create(geometry));
+ SkAutoTUnref<GrDrawBatch> batch(AAConvexPathBatch::Create(geometry));
args.fTarget->drawBatch(*args.fPipelineBuilder, batch);
return true;
@@ -1013,7 +1012,7 @@ bool GrAAConvexPathRenderer::onDrawPath(const DrawPathArgs& args) {
#ifdef GR_TEST_UTILS
-BATCH_TEST_DEFINE(AAConvexPathBatch) {
+DRAW_BATCH_TEST_DEFINE(AAConvexPathBatch) {
AAConvexPathBatch::Geometry geometry;
geometry.fColor = GrRandomColor(random);
geometry.fViewMatrix = GrTest::TestMatrixInvertible(random);
« no previous file with comments | « include/gpu/GrDrawContext.h ('k') | src/gpu/GrAADistanceFieldPathRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698