• kylechar's avatar
    Fix Windows resize jitter with SkiaRenderer. · 41fa4c10
    kylechar authored
    Display::Resize() was using ShallowFinishCHROMIUM() to ensure that all
    pending swap buffer calls at the current size were issued before
    returning. This is because D3D will scale swapped output if it doesn't
    match the window size. Unfortunately there isn't an equivalent to
    ShallowFinishCHROMIUM() for SkiaRenderer.
    
    RootCompositorFrameSinkImpl::DisableSwapUntilResize() would run a
    callback after calling Display::Resize() with size (0, 0). Resize()
    would only return after all swap buffers calls were issued since
    ShallowFinishCHROMIUM() would block until then.
    
    Add Display::DisableSwapUntilResize() that take a callback and runs it
    after all pending swaps have completed. This works with both GLRenderer
    and SkiaRenderer plus it doesn't block the display compositor thread
    while waiting for swaps to complete.
    
    Finally remove RendererSettings::finish_rendering_on_resize. This
    setting was only true on Windows and only did anything when Resize() was
    called with size (0, 0) for DisableSwapUntilResize(). Since
    DisableSwapUntilResize() is also only used on Windows, just assume we
    want to finish rendering if DisableSwapUntilResize() is
    called.
    
    Bug: 809722
    Change-Id: Ia6117dd03d8da9dbfcb1dc97d197d85c8634d647
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1652685Reviewed-by: default avatarWill Harris <wfh@chromium.org>
    Reviewed-by: default avatarAntoine Labour <piman@chromium.org>
    Reviewed-by: default avatarSunny Sachanandani <sunnyps@chromium.org>
    Commit-Queue: kylechar <kylechar@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#669004}
    41fa4c10
renderer_settings_creation.cc 3.75 KB