michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: include protocol PGrallocBuffer; michael@0: michael@0: michael@0: using struct gfxPoint from "gfxPoint.h"; michael@0: using struct nsIntRect from "nsRect.h"; michael@0: using nsIntRegion from "nsRegion.h"; michael@0: using struct nsIntSize from "nsSize.h"; michael@0: using struct mozilla::layers::MagicGrallocBufferHandle from "gfxipc/ShadowLayerUtils.h"; michael@0: using struct mozilla::layers::SurfaceDescriptorX11 from "gfxipc/ShadowLayerUtils.h"; michael@0: using struct mozilla::null_t from "ipc/IPCMessageUtils.h"; michael@0: using mozilla::WindowsHandle from "ipc/IPCMessageUtils.h"; michael@0: using mozilla::gl::SharedTextureHandle from "GLContextTypes.h"; michael@0: using mozilla::gl::SharedTextureShareType from "GLContextTypes.h"; michael@0: using mozilla::gfx::SurfaceStreamHandle from "SurfaceTypes.h"; michael@0: using mozilla::gfx::SurfaceFormat from "mozilla/gfx/Types.h"; michael@0: using mozilla::gfx::IntSize from "mozilla/gfx/Point.h"; michael@0: using gfxImageFormat from "gfxTypes.h"; michael@0: michael@0: namespace mozilla { michael@0: namespace layers { michael@0: michael@0: union MaybeMagicGrallocBufferHandle { michael@0: MagicGrallocBufferHandle; michael@0: null_t; michael@0: }; michael@0: michael@0: struct SurfaceDescriptorD3D9 { michael@0: // IDirect3DTexture9* michael@0: uintptr_t texture; michael@0: }; michael@0: michael@0: struct SurfaceDescriptorDIB { michael@0: // gfxWindowsSurface* michael@0: uintptr_t surface; michael@0: }; michael@0: michael@0: struct SurfaceDescriptorD3D10 { michael@0: WindowsHandle handle; michael@0: SurfaceFormat format; michael@0: IntSize size; michael@0: }; michael@0: michael@0: struct SurfaceDescriptorMacIOSurface { michael@0: uint32_t surface; michael@0: double scaleFactor; michael@0: bool hasAlpha; michael@0: }; michael@0: michael@0: struct SharedTextureDescriptor { michael@0: SharedTextureShareType shareType; michael@0: SharedTextureHandle handle; michael@0: IntSize size; michael@0: bool inverted; michael@0: }; michael@0: michael@0: struct NewSurfaceDescriptorGralloc { michael@0: PGrallocBuffer buffer; michael@0: /** michael@0: * android::GraphicBuffer has a size information. But there are cases michael@0: * that GraphicBuffer's size and actual video's size are different. michael@0: * Extra size member is necessary. See Bug 850566. michael@0: */ michael@0: IntSize size; michael@0: }; michael@0: michael@0: struct SurfaceStreamDescriptor { michael@0: SurfaceStreamHandle handle; michael@0: bool yflip; michael@0: }; michael@0: michael@0: /** michael@0: * Used for shmem-backed YCbCr and (flavors of) RGBA textures michael@0: */ michael@0: struct SurfaceDescriptorShmem { michael@0: Shmem data; michael@0: SurfaceFormat format; michael@0: }; michael@0: michael@0: /** michael@0: * Used for "raw memory"-backed YCbCr and (flavors of) RGBA textures michael@0: */ michael@0: struct SurfaceDescriptorMemory { michael@0: uintptr_t data; michael@0: SurfaceFormat format; michael@0: }; michael@0: michael@0: union SurfaceDescriptor { michael@0: SurfaceDescriptorShmem; michael@0: SurfaceDescriptorMemory; michael@0: SurfaceDescriptorD3D9; michael@0: SurfaceDescriptorDIB; michael@0: SurfaceDescriptorD3D10; michael@0: SurfaceDescriptorX11; michael@0: SharedTextureDescriptor; michael@0: SurfaceStreamDescriptor; michael@0: SurfaceDescriptorMacIOSurface; michael@0: NewSurfaceDescriptorGralloc; michael@0: null_t; michael@0: }; michael@0: michael@0: } // namespace michael@0: } // namespace