• kylechar's avatar
    Add support for DC overlays in SkiaRenderer. · bfa9f4dd
    kylechar authored
    This CL enables SkiaRenderer to use Windows DC layer overlays. The
    operation is essentially the same as GLRenderer with some minor
    differences.
    
    The list of DCLayerOverlay candidates is plumbed to the GPU thread via
    ScheduleGpuTask() instead of over command buffer. Also instead of
    providing a GL texture ID a gpu::Mailbox is provided.
    
    DCLayerOverlayProcessor::ProcessForUnderlay() is modified to set to
    SharedQuadState::are_contents_opaque true for the replacement
    SolidColorDrawQuad. SkiaRenderer needs to draw the replacement quad with
    SkBlendMode::kSrc but setting the blend mode to kSrc isn't supported by
    GLRenderer. SkiaRenderer uses the |are_contents_opaque| to change the
    blend mode at draw time while GLRenderer ignores it.
    
    SkiaOutputSurface::SkiaSwapBuffers() is also modified to optionally
    return a SyncToken. This SyncToken can be used to return overlay
    resources after swap buffers completes on the GPU thread. This should
    work for all overlay paths except macOS.
    
    Bug: 1003040
    Change-Id: I9ff3ff55cde1aabfae8200fc2dfcc416c15d0005
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1796626Reviewed-by: default avatarweiliangc <weiliangc@chromium.org>
    Reviewed-by: default avatarVasiliy Telezhnikov <vasilyt@chromium.org>
    Reviewed-by: default avatarSunny Sachanandani <sunnyps@chromium.org>
    Commit-Queue: kylechar <kylechar@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#697751}
    bfa9f4dd
dc_layer_overlay.h 6.01 KB