|
1 /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
|
2 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
3 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
5 |
|
6 #ifndef GLCONTEXT_TYPES_H_ |
|
7 #define GLCONTEXT_TYPES_H_ |
|
8 |
|
9 #include "GLTypes.h" |
|
10 #include "mozilla/TypedEnum.h" |
|
11 |
|
12 namespace mozilla { |
|
13 namespace gl { |
|
14 |
|
15 class GLContext; |
|
16 |
|
17 typedef uintptr_t SharedTextureHandle; |
|
18 |
|
19 MOZ_BEGIN_ENUM_CLASS(SharedTextureShareType) |
|
20 SameProcess = 0, |
|
21 CrossProcess |
|
22 MOZ_END_ENUM_CLASS(SharedTextureShareType) |
|
23 |
|
24 MOZ_BEGIN_ENUM_CLASS(SharedTextureBufferType) |
|
25 TextureID, |
|
26 SurfaceTexture, |
|
27 IOSurface |
|
28 MOZ_END_ENUM_CLASS(SharedTextureBufferType) |
|
29 |
|
30 MOZ_BEGIN_ENUM_CLASS(GLContextType) |
|
31 Unknown, |
|
32 WGL, |
|
33 CGL, |
|
34 GLX, |
|
35 EGL |
|
36 MOZ_END_ENUM_CLASS(GLContextType) |
|
37 |
|
38 struct GLFormats |
|
39 { |
|
40 // Constructs a zeroed object: |
|
41 GLFormats(); |
|
42 |
|
43 GLenum color_texInternalFormat; |
|
44 GLenum color_texFormat; |
|
45 GLenum color_texType; |
|
46 GLenum color_rbFormat; |
|
47 |
|
48 GLenum depthStencil; |
|
49 GLenum depth; |
|
50 GLenum stencil; |
|
51 |
|
52 GLsizei samples; |
|
53 }; |
|
54 |
|
55 |
|
56 struct PixelBufferFormat |
|
57 { |
|
58 // Constructs a zeroed object: |
|
59 PixelBufferFormat(); |
|
60 |
|
61 int red, green, blue; |
|
62 int alpha; |
|
63 int depth, stencil; |
|
64 int samples; |
|
65 |
|
66 int ColorBits() const { return red + green + blue; } |
|
67 }; |
|
68 |
|
69 |
|
70 } /* namespace gl */ |
|
71 } /* namespace mozilla */ |
|
72 |
|
73 #endif /* GLCONTEXT_TYPES_H_ */ |