Set correct pixel size for the compositor
Right now we clip(GL_SCISSOR) the display buffer based on the physical pixel size of the display. The pixel size we send to the ui compositor is the size we receive from the platform window(the display in Chrome OS). However, this may not be what we want if the platform has some fractional scale applied. UI elements have their sizes set in DIP. If some UI element (ui::Layer) has its size set to the DIP size of the display, their scaled size (the pixel size after applying device scale factor) after rounding may not match the physical pixel size of the display. This difference may lead to 1px lines left unclipped. This happens in the case of the shelf whose width is set to the width of the display. For a device like eve where the internal display has a physical resolution width of 2400px, if a device scale of 1.8 is applied, the DIP width of the display becomes 1333. We set the bounds of the shelf to this. Now when we do the actual paint, we scale the shelf to its physical pixel size which is ROUND(1333*1.8) = 2399. At the same time the compositor will clip things at width 2400. This difference is what gives the shelf a 1px gap. A proper way to fix this is to scale ui::Layer bounds such that it snaps to the parent's or displays edge similar to what pixel canvas does in views::View. However, that is a large change. In the meantime this patch sets the correct physical pixel size for the compositor so that correct clipping happens. Bug: 843354 Change-Id: Ic9e055c0ba39d85a7297809baf946398bf09f40a Component: UI compositor, pixel canvas, scaling, HiDPI Reviewed-on: https://chromium-review.googlesource.com/1130495Reviewed-by:Mitsuru Oshima <oshima@chromium.org> Reviewed-by:
Nico Weber <thakis@chromium.org> Commit-Queue: Malay Keshav <malaykeshav@chromium.org> Cr-Commit-Position: refs/heads/master@{#575402}
Showing
Please register or sign in to comment