Line data Source code
1 : /* -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40; -*- */
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 SURFACE_TYPES_H_
7 : #define SURFACE_TYPES_H_
8 :
9 : #include "mozilla/RefPtr.h"
10 : #include "mozilla/Attributes.h"
11 : #include <stdint.h>
12 :
13 : namespace mozilla {
14 : namespace layers {
15 : class LayersIPCChannel;
16 : } // namespace layers
17 :
18 : namespace gl {
19 :
20 0 : struct SurfaceCaps final
21 : {
22 : bool any;
23 : bool color, alpha;
24 : bool bpp16;
25 : bool depth, stencil;
26 : bool antialias;
27 : bool premultAlpha;
28 : bool preserve;
29 :
30 : // The surface allocator that we want to create this
31 : // for. May be null.
32 : RefPtr<layers::LayersIPCChannel> surfaceAllocator;
33 :
34 : SurfaceCaps();
35 : SurfaceCaps(const SurfaceCaps& other);
36 : ~SurfaceCaps();
37 :
38 : void Clear();
39 :
40 : SurfaceCaps& operator=(const SurfaceCaps& other);
41 :
42 : // We can't use just 'RGB' here, since it's an ancient Windows macro.
43 0 : static SurfaceCaps ForRGB() {
44 0 : SurfaceCaps caps;
45 :
46 0 : caps.color = true;
47 :
48 0 : return caps;
49 : }
50 :
51 0 : static SurfaceCaps ForRGBA() {
52 0 : SurfaceCaps caps;
53 :
54 0 : caps.color = true;
55 0 : caps.alpha = true;
56 :
57 0 : return caps;
58 : }
59 :
60 0 : static SurfaceCaps Any() {
61 0 : SurfaceCaps caps;
62 :
63 0 : caps.any = true;
64 :
65 0 : return caps;
66 : }
67 : };
68 :
69 : enum class SharedSurfaceType : uint8_t {
70 : Unknown = 0,
71 :
72 : Basic,
73 : EGLImageShare,
74 : EGLSurfaceANGLE,
75 : DXGLInterop,
76 : DXGLInterop2,
77 : IOSurface,
78 : GLXDrawable,
79 : SharedGLTexture,
80 : AndroidSurfaceTexture,
81 :
82 : Max
83 : };
84 :
85 : enum class AttachmentType : uint8_t {
86 : Screen = 0,
87 :
88 : GLTexture,
89 : GLRenderbuffer,
90 :
91 : Max
92 : };
93 :
94 : } // namespace gl
95 :
96 : } /* namespace mozilla */
97 :
98 : #endif /* SURFACE_TYPES_H_ */
|