michael@0: /* -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40; -*- */ 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: #ifndef SURFACE_TYPES_H_ michael@0: #define SURFACE_TYPES_H_ michael@0: michael@0: #include "mozilla/TypedEnum.h" michael@0: #include "mozilla/RefPtr.h" michael@0: #include "mozilla/Attributes.h" michael@0: #include michael@0: michael@0: namespace mozilla { michael@0: namespace layers { michael@0: class ISurfaceAllocator; michael@0: } michael@0: michael@0: namespace gfx { michael@0: michael@0: typedef uintptr_t SurfaceStreamHandle; michael@0: michael@0: struct SurfaceCaps MOZ_FINAL michael@0: { michael@0: bool any; michael@0: bool color, alpha; michael@0: bool bpp16; michael@0: bool depth, stencil; michael@0: bool antialias; michael@0: bool preserve; michael@0: michael@0: // The surface allocator that we want to create this michael@0: // for. May be null. michael@0: RefPtr surfaceAllocator; michael@0: michael@0: SurfaceCaps(); michael@0: SurfaceCaps(const SurfaceCaps& other); michael@0: ~SurfaceCaps(); michael@0: michael@0: void Clear(); michael@0: michael@0: SurfaceCaps& operator=(const SurfaceCaps& other); michael@0: michael@0: // We can't use just 'RGB' here, since it's an ancient Windows macro. michael@0: static SurfaceCaps ForRGB() { michael@0: SurfaceCaps caps; michael@0: michael@0: caps.color = true; michael@0: michael@0: return caps; michael@0: } michael@0: michael@0: static SurfaceCaps ForRGBA() { michael@0: SurfaceCaps caps; michael@0: michael@0: caps.color = true; michael@0: caps.alpha = true; michael@0: michael@0: return caps; michael@0: } michael@0: michael@0: static SurfaceCaps Any() { michael@0: SurfaceCaps caps; michael@0: michael@0: caps.any = true; michael@0: michael@0: return caps; michael@0: } michael@0: }; michael@0: michael@0: MOZ_BEGIN_ENUM_CLASS(SharedSurfaceType, uint8_t) michael@0: Unknown = 0, michael@0: michael@0: Basic, michael@0: GLTextureShare, michael@0: EGLImageShare, michael@0: EGLSurfaceANGLE, michael@0: DXGLInterop, michael@0: DXGLInterop2, michael@0: Gralloc, michael@0: IOSurface, michael@0: michael@0: Max michael@0: MOZ_END_ENUM_CLASS(SharedSurfaceType) michael@0: michael@0: michael@0: MOZ_BEGIN_ENUM_CLASS(SurfaceStreamType, uint8_t) michael@0: SingleBuffer, michael@0: TripleBuffer_Copy, michael@0: TripleBuffer_Async, michael@0: TripleBuffer, michael@0: Max michael@0: MOZ_END_ENUM_CLASS(SurfaceStreamType) michael@0: michael@0: michael@0: MOZ_BEGIN_ENUM_CLASS(APITypeT, uint8_t) michael@0: Generic = 0, michael@0: michael@0: OpenGL, michael@0: michael@0: Max michael@0: MOZ_END_ENUM_CLASS(APITypeT) michael@0: michael@0: michael@0: MOZ_BEGIN_ENUM_CLASS(AttachmentType, uint8_t) michael@0: Screen = 0, michael@0: michael@0: GLTexture, michael@0: GLRenderbuffer, michael@0: michael@0: Max michael@0: MOZ_END_ENUM_CLASS(AttachmentType) michael@0: michael@0: } /* namespace gfx */ michael@0: } /* namespace mozilla */ michael@0: michael@0: #endif /* SURFACE_TYPES_H_ */