Bug 1781122 Part 2: Make TextureHost aware of DRM Images, and set this on macOS....
commit62b54b07744e43df4452b7e0bf2bd9d9e6918036
authorBrad Werth <bwerth@mozilla.com>
Wed, 7 Sep 2022 18:51:12 +0000 (7 18:51 +0000)
committerBrad Werth <bwerth@mozilla.com>
Wed, 7 Sep 2022 18:51:12 +0000 (7 18:51 +0000)
tree66a0dfcc60ee53b8047dff16ed0775f8d5877d97
parent27253706348e1d036093ede0def0bb1472b8df2d
Bug 1781122 Part 2: Make TextureHost aware of DRM Images, and set this on macOS. r=gfx-reviewers,sotaro

At point of display, we need the TextureHost to know whether or not its
texture was created from a DRM Image. The throughline of data is:

Image -> TextureClient -> TextureHost

The TextureClient is generated by the Image, so it has access to the DRM
state of the Image, but the TextureHost is built from the raw texture data
and from TextureFlags. This patch updates TextureFlags to include a
DRM_SOURCE bit for use by the TextureHost.

The TextureClient and TextureHost are platform-specific classes. The
creation of the TextureClient by the Image is done in a platform-specific
subclass of Image. This patch only implements this pipeline for macOS.
There doesn't seem to be a way to do this in cross-platform classes, but
other platforms can follow the pattern used here.

Depends on D155295

Differential Revision: https://phabricator.services.mozilla.com/D155296
gfx/layers/CompositorTypes.h
gfx/layers/MacIOSurfaceImage.cpp
gfx/layers/opengl/MacIOSurfaceTextureHostOGL.cpp
gfx/webrender_bindings/RenderTextureHost.cpp
gfx/webrender_bindings/RenderTextureHost.h