Commit ea8e3e76 authored by Juanmi Huertas's avatar Juanmi Huertas Committed by Commit Bot

Revert "Remove GTK scale factor workarounds"

This reverts commit 2c2f5494.

Reason for revert: Potential culprit of bots failing in linux trusty rel, https://bugs.chromium.org/p/chromium/issues/detail?id=1065074

Original change's description:
> 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/+/2121179
> Reviewed-by: Mitsuru Oshima <oshima@chromium.org>
> Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#753653}

TBR=oshima@chromium.org,thomasanderson@chromium.org

Change-Id: I8094718a8ddc3b041fddfe194260d0503ce61d43
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1033552
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2122688Reviewed-by: default avatarJuanmi Huertas <juanmihd@chromium.org>
Commit-Queue: Juanmi Huertas <juanmihd@chromium.org>
Cr-Commit-Position: refs/heads/master@{#753763}
parent 6d9b68de
......@@ -1096,7 +1096,12 @@ float GtkUi::GetRawDeviceScaleFactor() {
gint scale = gtk_widget_get_scale_factor(fake_window_);
DCHECK_GT(scale, 0);
gdouble resolution = gdk_screen_get_resolution(screen);
return resolution <= 0 ? scale : resolution * scale / kDefaultDPI;
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;
}
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