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

Unified Diff: src/gpu/GrAALinearizingConvexPathRenderer.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/GrAAHairLinePathRenderer.cpp ('k') | src/gpu/GrAtlasTextContext.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrAALinearizingConvexPathRenderer.cpp
diff --git a/src/gpu/GrAALinearizingConvexPathRenderer.cpp b/src/gpu/GrAALinearizingConvexPathRenderer.cpp
index d1c6355daf2fba083366246af7a009a6e6f66db6..a019ed9fe0d66450111a0e7062265b18cae96a2e 100644
--- a/src/gpu/GrAALinearizingConvexPathRenderer.cpp
+++ b/src/gpu/GrAALinearizingConvexPathRenderer.cpp
@@ -114,7 +114,7 @@ static const GrGeometryProcessor* create_fill_gp(bool tweakAlphaForCoverage,
return CreateForDeviceSpace(color, coverage, localCoords, viewMatrix);
}
-class AAFlatteningConvexPathBatch : public GrBatch {
+class AAFlatteningConvexPathBatch : public GrVertexBatch {
public:
struct Geometry {
GrColor fColor;
@@ -125,7 +125,7 @@ public:
SkScalar fMiterLimit;
};
- static GrBatch* Create(const Geometry& geometry) {
+ static GrDrawBatch* Create(const Geometry& geometry) {
return SkNEW_ARGS(AAFlatteningConvexPathBatch, (geometry));
}
@@ -265,13 +265,12 @@ private:
}
bool onCombineIfPossible(GrBatch* t, const GrCaps& caps) override {
- if (!GrPipeline::CanCombine(*this->pipeline(), this->bounds(), *t->pipeline(), t->bounds(),
- caps)) {
+ AAFlatteningConvexPathBatch* that = t->cast<AAFlatteningConvexPathBatch>();
+ if (!GrPipeline::CanCombine(*this->pipeline(), this->bounds(), *that->pipeline(),
+ that->bounds(), caps)) {
return false;
}
- AAFlatteningConvexPathBatch* that = t->cast<AAFlatteningConvexPathBatch>();
-
SkASSERT(this->usesLocalCoords() == that->usesLocalCoords());
if (this->usesLocalCoords() && !this->viewMatrix().cheapEqualTo(that->viewMatrix())) {
return false;
@@ -321,7 +320,7 @@ bool GrAALinearizingConvexPathRenderer::onDrawPath(const DrawPathArgs& args) {
args.fStroke->getJoin();
geometry.fMiterLimit = args.fStroke->getMiter();
- SkAutoTUnref<GrBatch> batch(AAFlatteningConvexPathBatch::Create(geometry));
+ SkAutoTUnref<GrDrawBatch> batch(AAFlatteningConvexPathBatch::Create(geometry));
args.fTarget->drawBatch(*args.fPipelineBuilder, batch);
return true;
@@ -331,7 +330,7 @@ bool GrAALinearizingConvexPathRenderer::onDrawPath(const DrawPathArgs& args) {
#ifdef GR_TEST_UTILS
-BATCH_TEST_DEFINE(AAFlatteningConvexPathBatch) {
+DRAW_BATCH_TEST_DEFINE(AAFlatteningConvexPathBatch) {
AAFlatteningConvexPathBatch::Geometry geometry;
geometry.fColor = GrRandomColor(random);
geometry.fViewMatrix = GrTest::TestMatrixInvertible(random);
« no previous file with comments | « src/gpu/GrAAHairLinePathRenderer.cpp ('k') | src/gpu/GrAtlasTextContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698