Commit 2c2f5494 authored by Tom Anderson's avatar Tom Anderson Committed by Commit Bot

Remove GTK scale factor workarounds

The workarounds were initially added to fix rendering issues
when the scale factor was an odd value like 1.01.  Hopefully
the fractional scale factor support in Chrome is now good
enough to handle these cases.

This change prevents unexpected scale factor behavior like
1.25 remapping to 1.0.

BUG=1033552
R=oshima

Change-Id: I1d22c1ddcf463fed12061ef265d2a6b4a4bcbeb8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2121179Reviewed-by: default avatarMitsuru Oshima <oshima@chromium.org>
Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#753653}
parent 8ee501a0
......@@ -1096,12 +1096,7 @@ float GtkUi::GetRawDeviceScaleFactor() {
gint scale = gtk_widget_get_scale_factor(fake_window_);
DCHECK_GT(scale, 0);
gdouble resolution = gdk_screen_get_resolution(screen);
const float scale_factor =
resolution <= 0 ? scale : resolution * scale / kDefaultDPI;
// Blacklist scaling factors <120% (crbug.com/484400) and round
// to 1 decimal to prevent rendering problems (crbug.com/485183).
return scale_factor < 1.2f ? 1.0f : roundf(scale_factor * 10) / 10;
return resolution <= 0 ? scale : resolution * scale / kDefaultDPI;
}
void GtkUi::UpdateDeviceScaleFactor() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment