• jamesr@chromium.org's avatar
    Invert DSF to map from delegated frame to layer space · 04d5d437
    jamesr@chromium.org authored
    The size of the frame data from a delegated source will not in general match up
    exactly with the delegated layer's bounds. Frame sizes and layer bounds are both
    expressed as integers, but frame sizes are in physical pixels and layer bounds
    are in device-independent pixels. If the device scale is not an integer, there
    may not be an exact mapping between the two spaces. For instance, if the layer
    size is 105 x 211 and the device scale is 1.5, the delegated content is
    responsible for filling 157.5 x 316.5 physical pixels in the final output. This
    isn't really possible so what actually happens is the delegated renderer
    produces a frame with a physical size of 158 x 317 pixels and sends that up to
    the DRLI. To map this frame into physical space, the DRLI should apply the
    inverse of the device scale factor to reflect that the frame covers 105.333 x
    211.3333 logical pixels.
    
    Before this patch, DRLI would attempt to scale the frame by (105/158, 211/317)
    resulting in the frame being scaled down non-uniformly to try to make 158 x 317
    pixels fit into a 157.5 x 316.6 space. This scaling looks bad and ends up
    mapping pixels partially outside of the layer's logical bounds into the layer's
    logical bounds.
    
    BUG=370074
    
    Review URL: https://codereview.chromium.org/311253004
    
    git-svn-id: svn://svn.chromium.org/chrome/trunk/src@275544 0039d316-1c4b-4281-b951-d872f2087c98
    04d5d437
delegating_renderer.cc 6.24 KB