Skip to content

Commit 8969c2a

Browse files
mregoChromium LUCI CQ
authored andcommitted
Update spelling|grammar error markers rendering on Mac
Mac platform used to have a gradient on spelling|grammar error markers, but that's no longer the case anymore. This patch removes such gradient and also updates the colors so they match the ones used by WebKit on Mac. Change-Id: Ia6cd75a0c70f6ea4884493f6b8e69de48bf92b4e Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3139819 Reviewed-by: Philip Rogers <[email protected]> Reviewed-by: Avi Drissman <[email protected]> Commit-Queue: Manuel Rego <[email protected]> Cr-Commit-Position: refs/heads/main@{#918855}
1 parent 0e3e429 commit 8969c2a

File tree

39 files changed

+6
-11
lines changed

39 files changed

+6
-11
lines changed

third_party/blink/renderer/core/layout/layout_theme_mac.mm

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,15 @@ Color GetSystemColor(MacSystemColorID color_id,
7272
}
7373

7474
Color LayoutThemeMac::PlatformSpellingMarkerUnderlineColor() const {
75-
return Color(251, 45, 29);
75+
// Using the same color than WebKit (see
76+
// https://github.com/WebKit/WebKit/blob/main/Source/WebCore/platform/graphics/cocoa/GraphicsContextCocoa.mm#L167).
77+
return Color(255, 59, 48, 191);
7678
}
7779

7880
Color LayoutThemeMac::PlatformGrammarMarkerUnderlineColor() const {
79-
return Color(107, 107, 107);
81+
// Using the same color than WebKit (see
82+
// https://github.com/WebKit/WebKit/blob/main/Source/WebCore/platform/graphics/cocoa/GraphicsContextCocoa.mm#L175).
83+
return Color(25, 175, 50, 191);
8084
}
8185

8286
bool LayoutThemeMac::IsAccentColorCustomized(

third_party/blink/renderer/core/paint/document_marker_painter.cc

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -75,18 +75,9 @@ sk_sp<PaintRecord> RecordMarker(Color blink_color) {
7575
// Match the artwork used by the Mac.
7676
static const float kR = 1.5f;
7777

78-
// top->bottom translucent gradient.
79-
const SkColor colors[2] = {
80-
SkColorSetARGB(0x48, SkColorGetR(color), SkColorGetG(color),
81-
SkColorGetB(color)),
82-
color};
83-
const SkPoint pts[2] = {SkPoint::Make(0, 0), SkPoint::Make(0, 2 * kR)};
84-
8578
PaintFlags flags;
8679
flags.setAntiAlias(true);
8780
flags.setColor(color);
88-
flags.setShader(PaintShader::MakeLinearGradient(
89-
pts, colors, nullptr, base::size(colors), SkTileMode::kClamp));
9081
PaintRecorder recorder;
9182
recorder.beginRecording(kMarkerWidth, kMarkerHeight);
9283
recorder.getRecordingCanvas()->drawOval(SkRect::MakeWH(2 * kR, 2 * kR),
-31 Bytes
Loading
10 Bytes
Loading
-8 Bytes
Loading
6 Bytes
Loading
-35 Bytes
Loading
-31 Bytes
Loading
-7 Bytes
Loading
-5 Bytes
Loading

0 commit comments

Comments
 (0)