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

Unified Diff: src/gpu/effects/GrDashingEffect.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/GrTessellatingPathRenderer.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/effects/GrDashingEffect.cpp
diff --git a/src/gpu/effects/GrDashingEffect.cpp b/src/gpu/effects/GrDashingEffect.cpp
index afb09b9539c678f6217ec8be6382f5f62efc9b00..550823aacb9e2b8ce5fdcf0b17f4b9c229bd0198 100644
--- a/src/gpu/effects/GrDashingEffect.cpp
+++ b/src/gpu/effects/GrDashingEffect.cpp
@@ -300,28 +300,30 @@
void generateGeometry(GrBatchTarget* batchTarget, const GrPipeline* pipeline) override {
int instanceCount = fGeoData.count();
+
+ SkMatrix invert;
+ if (this->usesLocalCoords() && !this->viewMatrix().invert(&invert)) {
+ SkDebugf("Failed to invert\n");
+ return;
+ }
+
SkPaint::Cap cap = this->cap();
+
+ SkAutoTUnref<const GrGeometryProcessor> gp;
+
bool isRoundCap = SkPaint::kRound_Cap == cap;
DashCap capType = isRoundCap ? kRound_DashCap : kNonRound_DashCap;
-
- SkAutoTUnref<const GrGeometryProcessor> gp;
if (this->fullDash()) {
- gp.reset(create_dash_gp(this->color(), this->aaMode(), capType, this->viewMatrix(),
+ gp.reset(create_dash_gp(this->color(), this->aaMode(), capType, invert,
this->usesLocalCoords()));
} else {
// Set up the vertex data for the line and start/end dashes
- using namespace GrDefaultGeoProcFactory;
- Color color(this->color());
- Coverage coverage(this->coverageIgnored() ? Coverage::kNone_Type :
- Coverage::kSolid_Type);
- LocalCoords localCoords(this->usesLocalCoords() ? LocalCoords::kUsePosition_Type :
- LocalCoords::kUnused_Type);
- gp.reset(CreateForDeviceSpace(color, coverage, localCoords, this->viewMatrix()));
- }
-
- if (!gp) {
- SkDebugf("Could not create GrGeometryProcessor\n");
- return;
+ gp.reset(GrDefaultGeoProcFactory::Create(GrDefaultGeoProcFactory::kPosition_GPType,
+ this->color(),
+ this->usesLocalCoords(),
+ this->coverageIgnored(),
+ SkMatrix::I(),
+ invert));
}
batchTarget->initDraw(gp, pipeline);
@@ -1207,19 +1209,15 @@
static GrGeometryProcessor* create_dash_gp(GrColor color,
DashAAMode dashAAMode,
DashCap cap,
- const SkMatrix& viewMatrix,
+ const SkMatrix& localMatrix,
bool usesLocalCoords) {
- SkMatrix invert;
- if (usesLocalCoords && !viewMatrix.invert(&invert)) {
- SkDebugf("Failed to invert\n");
- return NULL;
- }
-
switch (cap) {
case kRound_DashCap:
- return DashingCircleEffect::Create(color, dashAAMode, invert, usesLocalCoords);
+ return DashingCircleEffect::Create(color, dashAAMode, localMatrix, usesLocalCoords);
case kNonRound_DashCap:
- return DashingLineEffect::Create(color, dashAAMode, invert, usesLocalCoords);
+ return DashingLineEffect::Create(color, dashAAMode, localMatrix, usesLocalCoords);
+ default:
+ SkFAIL("Unexpected dashed cap.");
}
return NULL;
}
« no previous file with comments | « src/gpu/GrTessellatingPathRenderer.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698