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 5using struct gfxPoint from "gfxPoint.h"; 6using nsIntRegion from "nsRegion.h"; 7using struct mozilla::layers::SurfaceDescriptorX11 from "gfxipc/ShadowLayerUtils.h"; 8using mozilla::StereoMode from "ImageTypes.h"; 9using mozilla::YUVColorSpace from "ImageTypes.h"; 10using struct mozilla::null_t from "ipc/IPCMessageUtils.h"; 11using mozilla::WindowsHandle from "ipc/IPCMessageUtils.h"; 12using mozilla::gfx::SurfaceFormat from "mozilla/gfx/Types.h"; 13using mozilla::gfx::IntRect from "mozilla/gfx/Rect.h"; 14using mozilla::gfx::IntSize from "mozilla/gfx/Point.h"; 15using gfxImageFormat from "gfxTypes.h"; 16using struct mozilla::layers::GonkNativeHandle from "mozilla/layers/GonkNativeHandleUtils.h"; 17 18namespace mozilla { 19namespace layers { 20 21union OverlayHandle { 22 int32_t; 23 GonkNativeHandle; 24 null_t; 25}; 26 27struct OverlaySource { 28 OverlayHandle handle; 29 IntSize size; 30}; 31 32struct SurfaceDescriptorD3D9 { 33 // IDirect3DTexture9* 34 uintptr_t texture; 35}; 36 37struct SurfaceDescriptorFileMapping { 38 WindowsHandle handle; 39 SurfaceFormat format; 40 IntSize size; 41}; 42 43struct SurfaceDescriptorDIB { 44 // gfxWindowsSurface* 45 uintptr_t surface; 46}; 47 48struct SurfaceDescriptorD3D10 { 49 WindowsHandle handle; 50 SurfaceFormat format; 51 IntSize size; 52}; 53 54struct SurfaceDescriptorDXGIYCbCr { 55 WindowsHandle handleY; 56 WindowsHandle handleCb; 57 WindowsHandle handleCr; 58 IntSize size; 59 IntSize sizeY; 60 IntSize sizeCbCr; 61}; 62 63struct SurfaceDescriptorMacIOSurface { 64 uint32_t surfaceId; 65 double scaleFactor; 66 bool isOpaque; 67}; 68 69struct SurfaceTextureDescriptor { 70 uintptr_t surfTex; 71 IntSize size; 72}; 73 74struct EGLImageDescriptor { 75 uintptr_t image; // `EGLImage` is a `void*`. 76 uintptr_t fence; 77 IntSize size; 78 bool hasAlpha; 79}; 80 81struct SurfaceDescriptorSharedGLTexture { 82 uint32_t texture; 83 uint32_t target; 84 uintptr_t fence; 85 IntSize size; 86 bool hasAlpha; 87}; 88 89struct SurfaceDescriptorGPUVideo { 90 uint64_t handle; 91}; 92 93struct RGBDescriptor { 94 IntSize size; 95 SurfaceFormat format; 96 bool hasIntermediateBuffer; 97}; 98 99struct YCbCrDescriptor { 100 IntSize ySize; 101 IntSize cbCrSize; 102 uint32_t yOffset; 103 uint32_t cbOffset; 104 uint32_t crOffset; 105 StereoMode stereoMode; 106 YUVColorSpace yUVColorSpace; 107 bool hasIntermediateBuffer; 108}; 109 110union BufferDescriptor { 111 RGBDescriptor; 112 YCbCrDescriptor; 113}; 114 115union MemoryOrShmem { 116 uintptr_t; 117 Shmem; 118}; 119 120struct SurfaceDescriptorBuffer { 121 BufferDescriptor desc; 122 MemoryOrShmem data; 123}; 124 125union SurfaceDescriptor { 126 SurfaceDescriptorBuffer; 127 SurfaceDescriptorD3D9; 128 SurfaceDescriptorDIB; 129 SurfaceDescriptorD3D10; 130 SurfaceDescriptorFileMapping; 131 SurfaceDescriptorDXGIYCbCr; 132 SurfaceDescriptorX11; 133 SurfaceTextureDescriptor; 134 EGLImageDescriptor; 135 SurfaceDescriptorMacIOSurface; 136 SurfaceDescriptorSharedGLTexture; 137 SurfaceDescriptorGPUVideo; 138 null_t; 139}; 140 141} // namespace 142} // namespace 143