From 07f0a87e4409f27854b3a1d17f270a3497f38947 Mon Sep 17 00:00:00 2001 From: Stephan Hartmann 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 Commit-Queue: Stephan Hartmann 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;