LayersSurfaces.ipdlh (6620B)
1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 5 include "gfxipc/ShadowLayerUtils.h"; 6 include "mozilla/GfxMessageUtils.h"; 7 include "mozilla/layers/LayersMessageUtils.h"; 8 include "mozilla/layers/WebRenderMessageUtils.h"; 9 10 using gfxPoint from "gfxPoint.h"; 11 using nsIntRegion from "nsRegion.h"; 12 using mozilla::StereoMode from "ImageTypes.h"; 13 using struct mozilla::null_t from "mozilla/ipc/IPCCore.h"; 14 using mozilla::WindowsHandle from "mozilla/ipc/IPCTypes.h"; 15 using mozilla::gfx::YUVColorSpace from "mozilla/gfx/Types.h"; 16 using mozilla::gfx::ChromaSubsampling from "mozilla/gfx/Types.h"; 17 using mozilla::gfx::ColorDepth from "mozilla/gfx/Types.h"; 18 using mozilla::gfx::ColorRange from "mozilla/gfx/Types.h"; 19 using mozilla::gfx::ColorSpace2 from "mozilla/gfx/Types.h"; 20 using mozilla::gfx::TransferFunction from "mozilla/gfx/Types.h"; 21 using mozilla::gfx::SurfaceFormat from "mozilla/gfx/Types.h"; 22 using mozilla::gfx::IntRect from "mozilla/gfx/Rect.h"; 23 using mozilla::gfx::IntSize from "mozilla/gfx/Point.h"; 24 using mozilla::gfx::Matrix4x4 from "mozilla/gfx/Matrix.h"; 25 [RefCounted] using mozilla::gfx::FileHandleWrapper from "mozilla/gfx/FileHandleWrapper.h"; 26 using gfxImageFormat from "gfxTypes.h"; 27 using mozilla::layers::MaybeVideoBridgeSource from "mozilla/layers/VideoBridgeUtils.h"; 28 using mozilla::layers::RemoteTextureId from "mozilla/layers/LayersTypes.h"; 29 using mozilla::layers::RemoteTextureOwnerId from "mozilla/layers/LayersTypes.h"; 30 [RefCounted] using mozilla::layers::GpuFence from "mozilla/layers/GpuFence.h"; 31 using mozilla::layers::GpuProcessTextureId from "mozilla/layers/LayersTypes.h"; 32 using mozilla::layers::CompositeProcessFencesHolderId from "mozilla/layers/LayersTypes.h"; 33 using mozilla::wr::ExternalImageSource from "mozilla/webrender/WebRenderTypes.h"; 34 using mozilla::wr::ExternalImageId from "mozilla/webrender/WebRenderTypes.h"; 35 using mozilla::layers::SurfaceDescriptorRemoteDecoderId from "mozilla/layers/LayersTypes.h"; 36 using mozilla::ipc::ActorId from "mozilla/ipc/ProtocolUtils.h"; 37 [MoveOnly] using mozilla::ipc::ReadOnlySharedMemoryHandle from "mozilla/ipc/SharedMemoryHandle.h"; 38 39 namespace mozilla { 40 namespace layers { 41 42 [Comparable] struct SurfaceDescriptorD3D10 { 43 nullable FileHandleWrapper handle; 44 GpuProcessTextureId? gpuProcessTextureId; 45 uint32_t arrayIndex; 46 SurfaceFormat format; 47 IntSize size; 48 ColorSpace2 colorSpace; 49 ColorRange colorRange; 50 bool hasKeyedMutex; 51 CompositeProcessFencesHolderId? fencesHolderId; 52 }; 53 54 [Comparable] struct SurfaceDescriptorDXGIYCbCr { 55 nullable FileHandleWrapper handleY; 56 nullable FileHandleWrapper handleCb; 57 nullable FileHandleWrapper handleCr; 58 IntSize size; 59 IntSize sizeY; 60 IntSize sizeCbCr; 61 ColorDepth colorDepth; 62 YUVColorSpace yUVColorSpace; 63 ColorRange colorRange; 64 CompositeProcessFencesHolderId fencesHolderId; 65 }; 66 67 [Comparable] struct SurfaceDescriptorMacIOSurface { 68 uint32_t surfaceId; 69 bool isOpaque; 70 YUVColorSpace yUVColorSpace; 71 nullable GpuFence gpuFence; 72 }; 73 74 [Comparable] struct SurfaceDescriptorDMABuf { 75 uint32_t bufferType; 76 uint32_t fourccFormat; 77 uint64_t[] modifier; 78 uint32_t flags; 79 FileHandleWrapper[] fds; 80 uint32_t[] width; 81 uint32_t[] height; 82 uint32_t[] widthAligned; 83 uint32_t[] heightAligned; 84 uint32_t[] format; 85 uint32_t[] strides; 86 uint32_t[] offsets; 87 YUVColorSpace yUVColorSpace; 88 ColorRange colorRange; 89 ColorSpace2 colorPrimaries; 90 TransferFunction transferFunction; 91 uint32_t chromaLocation; 92 FileHandleWrapper[] fence; 93 uint32_t uid; 94 uint32_t pid; 95 FileDescriptor[] refCount; 96 nullable FileHandleWrapper semaphoreFd; 97 }; 98 99 [Comparable] struct SurfaceTextureDescriptor { 100 uint64_t handle; 101 IntSize size; 102 SurfaceFormat format; 103 bool continuous; 104 bool forceBT709ColorSpace; 105 Matrix4x4? transformOverride; 106 }; 107 108 [Comparable] struct SurfaceDescriptorAndroidHardwareBuffer { 109 uint64_t bufferId; 110 IntSize size; 111 SurfaceFormat format; 112 }; 113 114 [Comparable] struct EGLImageDescriptor { 115 uintptr_t image; // `EGLImage` is a `void*`. 116 uintptr_t fence; 117 IntSize size; 118 bool hasAlpha; 119 }; 120 121 [Comparable] struct SurfaceDescriptorSharedGLTexture { 122 uint32_t texture; 123 uint32_t target; 124 uintptr_t fence; 125 IntSize size; 126 bool hasAlpha; 127 }; 128 129 [Comparable] struct SurfaceDescriptorDcompSurface { 130 FileDescriptor handle; 131 IntSize size; 132 SurfaceFormat format; 133 }; 134 135 [Comparable] union RemoteDecoderVideoSubDescriptor { 136 SurfaceDescriptorD3D10; 137 SurfaceDescriptorDXGIYCbCr; 138 SurfaceDescriptorDMABuf; 139 SurfaceDescriptorMacIOSurface; 140 SurfaceDescriptorDcompSurface; 141 null_t; 142 }; 143 144 [Comparable] struct SurfaceDescriptorRemoteDecoder { 145 uint64_t handle; 146 RemoteDecoderVideoSubDescriptor subdesc; 147 MaybeVideoBridgeSource source; 148 SurfaceDescriptorRemoteDecoderId id; 149 }; 150 151 [Comparable] union SurfaceDescriptorGPUVideo { 152 SurfaceDescriptorRemoteDecoder; 153 }; 154 155 [Comparable] struct RGBDescriptor { 156 IntSize size; 157 SurfaceFormat format; 158 }; 159 160 [Comparable] struct YCbCrDescriptor { 161 IntRect display; 162 IntSize ySize; 163 uint32_t yStride; 164 IntSize cbCrSize; 165 uint32_t cbCrStride; 166 uint32_t yOffset; 167 uint32_t cbOffset; 168 uint32_t crOffset; 169 StereoMode stereoMode; 170 ColorDepth colorDepth; 171 YUVColorSpace yUVColorSpace; 172 ColorRange colorRange; 173 ChromaSubsampling chromaSubsampling; 174 }; 175 176 [Comparable] union BufferDescriptor { 177 RGBDescriptor; 178 YCbCrDescriptor; 179 }; 180 181 [Comparable] union MemoryOrShmem { 182 uintptr_t; 183 Shmem; 184 }; 185 186 [Comparable] struct SurfaceDescriptorBuffer { 187 BufferDescriptor desc; 188 MemoryOrShmem data; 189 }; 190 191 struct SurfaceDescriptorShared 192 { 193 IntSize size; 194 int32_t stride; 195 SurfaceFormat format; 196 ReadOnlySharedMemoryHandle handle; 197 }; 198 199 [Comparable] struct SurfaceDescriptorExternalImage 200 { 201 ExternalImageSource source; 202 ExternalImageId id; 203 }; 204 205 [Comparable] struct SurfaceDescriptorRemoteTexture { 206 RemoteTextureId textureId; 207 RemoteTextureOwnerId ownerId; 208 }; 209 210 [Comparable] struct SurfaceDescriptorCanvasSurface { 211 uint32_t managerId; 212 ActorId canvasId; 213 uintptr_t surfaceId; 214 }; 215 216 [Comparable] union SurfaceDescriptor { 217 SurfaceDescriptorBuffer; 218 SurfaceDescriptorD3D10; 219 SurfaceDescriptorDXGIYCbCr; 220 SurfaceDescriptorDMABuf; 221 SurfaceTextureDescriptor; 222 SurfaceDescriptorAndroidHardwareBuffer; 223 EGLImageDescriptor; 224 SurfaceDescriptorMacIOSurface; 225 SurfaceDescriptorSharedGLTexture; 226 SurfaceDescriptorGPUVideo; 227 SurfaceDescriptorRemoteTexture; 228 SurfaceDescriptorDcompSurface; 229 SurfaceDescriptorExternalImage; 230 SurfaceDescriptorCanvasSurface; 231 null_t; 232 }; 233 234 } // namespace 235 } // namespace