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

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

Issue 2046483003: Fix dashing bug where hwaa was unintentionally disabled (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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
Index: src/gpu/batches/GrDashLinePathRenderer.cpp
diff --git a/src/gpu/batches/GrDashLinePathRenderer.cpp b/src/gpu/batches/GrDashLinePathRenderer.cpp
index 51ef0528aa1634cf72e9820da25bf0a9e7b65904..d75ca38b7d02562ca40860b19697e753e35d45fd 100644
--- a/src/gpu/batches/GrDashLinePathRenderer.cpp
+++ b/src/gpu/batches/GrDashLinePathRenderer.cpp
@@ -22,11 +22,15 @@ bool GrDashLinePathRenderer::onCanDrawPath(const CanDrawPathArgs& args) const {
bool GrDashLinePathRenderer::onDrawPath(const DrawPathArgs& args) {
GR_AUDIT_TRAIL_AUTO_FRAME(args.fDrawContext->auditTrail(),
"GrDashLinePathRenderer::onDrawPath");
- bool msaaIsEnabled = args.fDrawContext->isUnifiedMultisampled();
+ // We always take the msaa codepath, regardless of paint aa, if the platform won't be able to
+ // disable multisampling. Dashes use a mix of msaa and coverage aa, so if we took the bw path in
+ // this case we would wind up with external edges antialiased and internal edges unantialiased.
+ bool useHWAA = args.fDrawContext->isUnifiedMultisampled() &&
+ (!args.fDrawContext->caps()->multisampleDisableSupport() ||
+ args.fPaint->isAntiAlias());
+
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.
+ if (useHWAA) {
aaMode = GrDashingEffect::AAMode::kCoverageWithMSAA;
} else if (args.fAntiAlias) {
aaMode = GrDashingEffect::AAMode::kCoverage;
@@ -44,7 +48,8 @@ bool GrDashLinePathRenderer::onDrawPath(const DrawPathArgs& args) {
return false;
}
- GrPipelineBuilder pipelineBuilder(*args.fPaint, msaaIsEnabled);
+ GrPipelineBuilder pipelineBuilder(*args.fPaint, args.fDrawContext->isUnifiedMultisampled());
+ pipelineBuilder.setState(GrPipelineBuilder::kHWAntialias_Flag, useHWAA);
pipelineBuilder.setUserStencil(args.fUserStencilSettings);
args.fDrawContext->drawBatch(pipelineBuilder, *args.fClip, batch);
« include/gpu/GrDrawContext.h ('K') | « src/gpu/GrCaps.cpp ('k') | src/gpu/gl/GrGLCaps.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698