Bug 1632310 [wpt PR 23186] - Add test for computed versus resolved style., a=testonly
[gecko.git] / gfx / layers / ImageTypes.h
blob6131a53232877c1cafd322ad70f8edd6d4dcf793
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef GFX_IMAGETYPES_H
8 #define GFX_IMAGETYPES_H
10 #include <stdint.h> // for uint32_t
12 namespace mozilla {
14 enum class ImageFormat {
15 /**
16 * The PLANAR_YCBCR format creates a PlanarYCbCrImage. All backends should
17 * support this format, because the Ogg video decoder depends on it.
18 * The maximum image width and height is 16384.
20 PLANAR_YCBCR,
22 /**
23 * The NV_IMAGE format creates a NVImage. The PLANAR_YCBCR together with this
24 * complete the YUV format family.
26 NV_IMAGE,
28 /**
29 * The SHARED_RGB format creates a SharedRGBImage, which stores RGB data in
30 * shared memory. Some Android hardware video decoders require this format.
31 * Currently only used on Android.
33 SHARED_RGB,
35 /**
36 * The CAIRO_SURFACE format creates a SourceSurfaceImage. All backends should
37 * support this format, because video rendering sometimes requires it.
39 * This format is useful even though a PaintedLayer could be used.
40 * It makes it easy to render a cairo surface when another Image format
41 * could be used. It can also avoid copying the surface data in some
42 * cases.
44 * Images in CAIRO_SURFACE format should only be created and
45 * manipulated on the main thread, since the underlying cairo surface
46 * is main-thread-only.
48 CAIRO_SURFACE,
50 /**
51 * A MacIOSurface object.
53 MAC_IOSURFACE,
55 /**
56 * An Android SurfaceTexture ID that can be shared across threads and
57 * processes.
59 SURFACE_TEXTURE,
61 /**
62 * The D3D9_RGB32_TEXTURE format creates a D3D9SurfaceImage, and wraps a
63 * IDirect3DTexture9 in RGB32 layout.
65 D3D9_RGB32_TEXTURE,
67 /**
68 * An Image type carries an opaque handle once for each stream.
69 * The opaque handle would be a platform specific identifier.
71 OVERLAY_IMAGE,
73 /**
74 * A share handle to a ID3D11Texture2D.
76 D3D11_SHARE_HANDLE_TEXTURE,
78 /**
79 * A wrapper around a drawable TextureClient.
81 TEXTURE_WRAPPER,
83 /**
84 * A D3D11 backed YUV image.
86 D3D11_YCBCR_IMAGE,
88 /**
89 * An opaque handle that refers to an Image stored in the GPU
90 * process.
92 GPU_VIDEO,
94 /**
95 * The WAYLAND_DMABUF format creates a SharedDMABUFImage, which stores YUV
96 * data in DMABUF memory. Used on Wayland by VAAPI decoder.
98 WAYLAND_DMABUF,
101 enum class StereoMode {
102 MONO,
103 LEFT_RIGHT,
104 RIGHT_LEFT,
105 BOTTOM_TOP,
106 TOP_BOTTOM,
107 MAX,
110 namespace layers {
112 typedef uint32_t ContainerFrameID;
113 constexpr ContainerFrameID kContainerFrameID_Invalid = 0;
115 typedef uint32_t ContainerProducerID;
116 constexpr ContainerProducerID kContainerProducerID_Invalid = 0;
118 } // namespace layers
120 } // namespace mozilla
122 #endif