• Kazuhiro Inaba's avatar
    Round down 1.7777... and 2.6666... scale factor constants. · f3137fd6
    Kazuhiro Inaba authored
    The two source, display_util and display_change_observer, needs to
    agree on the precise values of DSF so that the correct zoom table
    is picked up.
    
    A previous CL crrev.com/c/1815353 did that by consolidating the
    constants to 1.77778 and 2.66667. The current CL does the reverse:
    use the rounded-down values 1.77777 and 2.66666.
    
    In many places, pixel-to-dip conversion looks to be done by flooring down.
      1920 / 1.777..... = 1080
      floor(1920 / 1.77778) = 1079
      floor(1920 / 1.77777) = 1080
    Using a bigger value (1.77778) can cause 1 DIP diff, leading to a strange screen
    size (like 1079*674) or bigger errors (b/141898654).
    
    Bug: b/141325696
    Bug: b/141898654
    Test: screen.width on the devloper console of Krane returns 1080 (not 1079)
    Test: chrome settings show multiple choices for display size
    Change-Id: I8cbe719b13cd5b6ca5f73bb25c0d27465f6a3e62
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1832846Reviewed-by: default avatarMitsuru Oshima <oshima@chromium.org>
    Commit-Queue: Kazuhiro Inaba <kinaba@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#701492}
    f3137fd6
display_util.cc 9.46 KB