Fix Pango font rendering with HiDPi displays on Linux.

Don’t scale fonts up twice when running with device_scale_factor > 1.0.

Chrome’s UI is scaled up to device_scale_factor (e.g. 2x) by calling
SkCanvas->scale(). See Chrome’s gfx::Canvas class which calls
canvas.scale(image_scale, image_scale):
https://code.google.com/p/chromium/codesearch#chromium/src/ui/gfx/canvas.cc

Here is a skia fiddle which renders text with .setTextSize(21):
https://fiddle.skia.org/c/098cb32edac7e394aba5b9ff4c08b06c

Here is the same fiddle, but calling canvas.Scale(2.0, 2.0) before rendering to simulate what Chrome does:
https://fiddle.skia.org/c/a7b456338776239278e398741e1098d9

As you can see, the text is twice as large.

Therefore, this commit changes Chrome to take into account the DPI that
GTK provides, but set it in perspective to the device scale factor. This
preserves the same behavior when device scale factor == 1 but yields
correct rendering when device scale factor > 1.0 (hi-dpi displays).

Before this change:
http://t.zekjur.net/chrome-hidpi-enabled.png

After this change:
http://t.zekjur.net/chrome-hidpi-enabled-scalefix.png

This change also enables subpixel rendering on HiDPi displays, which is what Chrome OS also does.
Without subpixel rendering:
http://t.zekjur.net/without-subpixel.png

With subpixel rendering:
http://t.zekjur.net/with-subpixel.png

BUG=143619

Review URL: https://codereview.chromium.org/929733002

Cr-Commit-Position: refs/heads/master@{#321457}
5 files changed