• Christopher Cameron's avatar
    macOS HDR: Add HDRCopierLayer · 03e1d09c
    Christopher Cameron authored
    It used to be that setting the contents of a CALayer to an IOSurface
    that has an HDR color space, and setting that the CALayer wants
    extended range content was sufficient to display HDR content. This was
    an undocumented behavior, and macOS has recently fixed it (made it not
    work).
    
    The documented way to get HDR is to use a CAMetalLayer. Unfortunately,
    one cannot call setContents (or provide a pre-existing IOSurface) to
    this API. As a consequence, we need to perform a copy from the
    IOSurface to the CAMetalLayer. Add HDRCopierLayer subclass of
    CAMetalLayer, which overrides setContents to blit the specified
    contents to the CAMetalLayer.
    
    Add tests for this. It appears that the test suite is not running,
    because most of the tests are broken. Fix all the tests (next step
    there is to add them to bots, but that will get a separate patch).
    
    This was previously landed as crrev.com/737885 and reverted because
    of failures on 10.10. This re-land links using -weak_framework.
    
    Bug: 976426
    Change-Id: Ie3bf8438770dc58e19b1401a54356693fc22274a
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2038172Reviewed-by: default avatarElly Fong-Jones <ellyjones@chromium.org>
    Commit-Queue: ccameron <ccameron@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#738593}
    03e1d09c
ca_renderer_layer_tree.mm 34.4 KB