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

Unified Diff: src/gpu/batches/GrDashLinePathRenderer.cpp

Issue 2042923003: Make GrDashEffect take a AA mode enum. (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: rm unneeded scoping Created 4 years, 6 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 | « no previous file | src/gpu/effects/GrDashingEffect.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/batches/GrDashLinePathRenderer.cpp
diff --git a/src/gpu/batches/GrDashLinePathRenderer.cpp b/src/gpu/batches/GrDashLinePathRenderer.cpp
index 6a054589be0bfff26f85d18b03ac8775c78348bb..51ef0528aa1634cf72e9820da25bf0a9e7b65904 100644
--- a/src/gpu/batches/GrDashLinePathRenderer.cpp
+++ b/src/gpu/batches/GrDashLinePathRenderer.cpp
@@ -23,13 +23,22 @@ bool GrDashLinePathRenderer::onDrawPath(const DrawPathArgs& args) {
GR_AUDIT_TRAIL_AUTO_FRAME(args.fDrawContext->auditTrail(),
"GrDashLinePathRenderer::onDrawPath");
bool msaaIsEnabled = args.fDrawContext->isUnifiedMultisampled();
+ GrDashingEffect::AAMode aaMode;
+ if (msaaIsEnabled) {
+ // We ignore args.fAntiAlias here and force anti aliasing when using MSAA. Otherwise,
+ // we can wind up with external edges antialiased and internal edges unantialiased.
+ aaMode = GrDashingEffect::AAMode::kCoverageWithMSAA;
+ } else if (args.fAntiAlias) {
+ aaMode = GrDashingEffect::AAMode::kCoverage;
+ } else {
+ aaMode = GrDashingEffect::AAMode::kNone;
+ }
SkPoint pts[2];
SkAssertResult(args.fPath->isLine(pts));
SkAutoTUnref<GrDrawBatch> batch(GrDashingEffect::CreateDashLineBatch(args.fColor,
*args.fViewMatrix,
pts,
- args.fAntiAlias,
- msaaIsEnabled,
+ aaMode,
*args.fStyle));
if (!batch) {
return false;
« no previous file with comments | « no previous file | src/gpu/effects/GrDashingEffect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698