summaryrefslogtreecommitdiffstats
path: root/chromium-ungoogled/build/patches/chromium-110-NativeThemeBase-fabs.patch
blob: c7d0e8b1de8db828e81cdf48487b0b6d0f0bb778 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
From 07f0a87e4409f27854b3a1d17f270a3497f38947 Mon Sep 17 00:00:00 2001
From: Stephan Hartmann <stha09@googlemail.com>
Date: Mon, 19 Dec 2022 19:07:37 +0000
Subject: [PATCH] GCC: use fabsf in ui::NativeThemeBase::OutlineColor

Template deduction fails for base::clamp, because return type of
fabs is double and all other parameters are float.

Bug: 819294
Change-Id: I34f1c9c99d13f69097d899bfcb0526cbdf4fe1c1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4110869
Reviewed-by: Peter Kasting <pkasting@chromium.org>
Commit-Queue: Stephan Hartmann <stha09@googlemail.com>
Cr-Commit-Position: refs/heads/main@{#1085034}
---

diff --git a/ui/native_theme/native_theme_base.cc b/ui/native_theme/native_theme_base.cc
index 169c60c..36db49a 100644
--- a/ui/native_theme/native_theme_base.cc
+++ b/ui/native_theme/native_theme_base.cc
@@ -1336,7 +1336,7 @@
   // The following code has been tested to look OK with all of the
   // default GTK themes.
   SkScalar min_diff = base::clamp((hsv1[1] + hsv2[1]) * 1.2f, 0.28f, 0.5f);
-  SkScalar diff = base::clamp(fabs(hsv1[2] - hsv2[2]) / 2, min_diff, 0.5f);
+  SkScalar diff = base::clamp(fabsf(hsv1[2] - hsv2[2]) / 2, min_diff, 0.5f);
 
   if (hsv1[2] + hsv2[2] > 1.0)
     diff = -diff;