• Brian Liu Xu's avatar
    Fix Views bug causing layers to get stuck at 100% DPI pixel boundaries · f5a240b6
    Brian Liu Xu authored
    This patch fixes logic for snapping layers to physical pixel boundaries,
    when pixel canvas is not enabled, by allowing the subpixel offset to be
    dynamically computed. Previously, layers could get stuck at 100% DPI
    pixel boundaries (making some UI blurry on platforms where fractional
    scale factors are used, e.g. Windows), as once an explicit value was
    set, the offset would no longer be dynamically computed.
    
    This patch
     - Updates SnapLayerToPixelBoundary to stop View from setting explicit
       subpixel offsets for non-pixel-canvas platforms so that they may be
       auto computed.
     - Updates view_unittest.
    
    Bug: 992730
    Change-Id: I8e8c87107f13157e92f125bcfb281226ebc6c422
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1761301Reviewed-by: default avatarMalay Keshav <malaykeshav@chromium.org>
    Reviewed-by: default avatarScott Violet <sky@chromium.org>
    Commit-Queue: Brian Liu Xu <brx@microsoft.com>
    Auto-Submit: Brian Liu Xu <brx@microsoft.com>
    Cr-Commit-Position: refs/heads/master@{#689171}
    f5a240b6
view_unittest.cc 184 KB