Index: src/gpu/GrDrawContext.cpp |
diff --git a/src/gpu/GrDrawContext.cpp b/src/gpu/GrDrawContext.cpp |
index 1a7734d0f808f8e6f7932af46ed37122566a77e1..5a496d2517cfc0dbd5018a02c742b6d9d5d522cf 100644 |
--- a/src/gpu/GrDrawContext.cpp |
+++ b/src/gpu/GrDrawContext.cpp |
@@ -288,17 +288,13 @@ |
} |
void generateGeometry(GrBatchTarget* batchTarget, const GrPipeline* pipeline) override { |
- SkAutoTUnref<const GrGeometryProcessor> gp; |
- { |
- using namespace GrDefaultGeoProcFactory; |
- Color color(this->color()); |
- Coverage coverage(this->coverageIgnored() ? Coverage::kSolid_Type : |
- Coverage::kNone_Type); |
- LocalCoords localCoords(this->usesLocalCoords() ? LocalCoords::kUsePosition_Type : |
- LocalCoords::kUnused_Type); |
- gp.reset(GrDefaultGeoProcFactory::Create(color, coverage, localCoords, |
- this->viewMatrix())); |
- } |
+ SkAutoTUnref<const GrGeometryProcessor> gp( |
+ GrDefaultGeoProcFactory::Create(GrDefaultGeoProcFactory::kPosition_GPType, |
+ this->color(), |
+ this->usesLocalCoords(), |
+ this->coverageIgnored(), |
+ this->viewMatrix(), |
+ SkMatrix::I())); |
batchTarget->initDraw(gp, pipeline); |
@@ -564,26 +560,23 @@ |
GrColor color, |
const SkMatrix& viewMatrix, |
bool coverageIgnored) { |
- using namespace GrDefaultGeoProcFactory; |
*texOffset = -1; |
*colorOffset = -1; |
- Color gpColor(color); |
- if (hasColors) { |
- gpColor.fType = Color::kAttribute_Type; |
- } |
- |
- Coverage coverage(coverageIgnored ? Coverage::kNone_Type : Coverage::kSolid_Type); |
- LocalCoords localCoords(hasLocalCoords ? LocalCoords::kHasExplicit_Type : |
- LocalCoords::kUsePosition_Type); |
+ uint32_t flags = GrDefaultGeoProcFactory::kPosition_GPType; |
if (hasLocalCoords && hasColors) { |
*colorOffset = sizeof(SkPoint); |
*texOffset = sizeof(SkPoint) + sizeof(GrColor); |
+ flags |= GrDefaultGeoProcFactory::kColor_GPType | |
+ GrDefaultGeoProcFactory::kLocalCoord_GPType; |
} else if (hasLocalCoords) { |
*texOffset = sizeof(SkPoint); |
+ flags |= GrDefaultGeoProcFactory::kLocalCoord_GPType; |
} else if (hasColors) { |
*colorOffset = sizeof(SkPoint); |
- } |
- return GrDefaultGeoProcFactory::Create(gpColor, coverage, localCoords, viewMatrix); |
+ flags |= GrDefaultGeoProcFactory::kColor_GPType; |
+ } |
+ return GrDefaultGeoProcFactory::Create(flags, color, hasLocalCoords, coverageIgnored, |
+ viewMatrix, SkMatrix::I()); |
} |
class DrawVerticesBatch : public GrBatch { |