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

Unified Diff: src/gpu/GrDrawContext.cpp

Issue 1264283004: Revert of Use new API everywhere for GrDefaultGeoProcFactory (Closed) Base URL: https://skia.googlesource.com/skia.git@lccleanup2
Patch Set: 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/GrDefaultPathRenderer.cpp ('k') | src/gpu/GrRectBatch.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 {
« no previous file with comments | « src/gpu/GrDefaultPathRenderer.cpp ('k') | src/gpu/GrRectBatch.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698