Bug 1546985 - Use JoinStyle::ROUND when stroking glyph outlines, to avoid artifacts at sharp corners. r=lsalzman
☠☠ backed out by d9e0ffa11ce7 ☠ ☠
authorJonathan Kew <jkew@mozilla.com>
Thu, 25 Apr 2019 17:34:52 +0000
changeset 530165 bd68b6dfd83e13a9ec3ff273b17fcb1992ae10ec
parent 530164 3096a547bb84ea6bdf0f543b36591e920c90ae51
child 530166 80374044414da9f5b3634c91345d07612754fcda
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslsalzman
bugs1546985
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1546985 - Use JoinStyle::ROUND when stroking glyph outlines, to avoid artifacts at sharp corners. r=lsalzman Differential Revision: https://phabricator.services.mozilla.com/D28855
layout/generic/nsTextFrame.cpp
--- a/layout/generic/nsTextFrame.cpp
+++ b/layout/generic/nsTextFrame.cpp
@@ -6680,19 +6680,20 @@ static void DrawTextRun(const gfxTextRun
                 params.drawMode |= DrawMode::GLYPH_STROKE_UNDERNEATH;
                 paintOrder = 0;
                 break;
             }
             paintOrder >>= NS_STYLE_PAINT_ORDER_BITWIDTH;
           }
         }
       }
-      StrokeOptions strokeOpts;
+      // Use ROUND joins as they are less likely to produce ugly artifacts
+      // when stroking glyphs with sharp angles (see bug 1546985).
+      StrokeOptions strokeOpts(aParams.textStrokeWidth, JoinStyle::ROUND);
       params.textStrokeColor = aParams.textStrokeColor;
-      strokeOpts.mLineWidth = aParams.textStrokeWidth;
       params.strokeOpts = &strokeOpts;
       aTextRun->Draw(aRange, aTextBaselinePt, params);
     } else {
       aTextRun->Draw(aRange, aTextBaselinePt, params);
     }
   }
 }