Bug 1032573 part 4 - Add AnimationTimeline::ToTimelineTime helper method; r=dbaron
[gecko.git] / gfx / gl / SurfaceTypes.h
blobc1f342eb98bead43e3686ceb67f4a5c202674913
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/. */
6 #ifndef SURFACE_TYPES_H_
7 #define SURFACE_TYPES_H_
9 #include "mozilla/TypedEnum.h"
10 #include "mozilla/RefPtr.h"
11 #include "mozilla/Attributes.h"
12 #include <stdint.h>
14 namespace mozilla {
15 namespace layers {
16 class ISurfaceAllocator;
19 namespace gl {
21 struct SurfaceCaps MOZ_FINAL
23 bool any;
24 bool color, alpha;
25 bool bpp16;
26 bool depth, stencil;
27 bool antialias;
28 bool preserve;
30 // The surface allocator that we want to create this
31 // for. May be null.
32 RefPtr<layers::ISurfaceAllocator> surfaceAllocator;
34 SurfaceCaps();
35 SurfaceCaps(const SurfaceCaps& other);
36 ~SurfaceCaps();
38 void Clear();
40 SurfaceCaps& operator=(const SurfaceCaps& other);
42 // We can't use just 'RGB' here, since it's an ancient Windows macro.
43 static SurfaceCaps ForRGB() {
44 SurfaceCaps caps;
46 caps.color = true;
48 return caps;
51 static SurfaceCaps ForRGBA() {
52 SurfaceCaps caps;
54 caps.color = true;
55 caps.alpha = true;
57 return caps;
60 static SurfaceCaps Any() {
61 SurfaceCaps caps;
63 caps.any = true;
65 return caps;
69 MOZ_BEGIN_ENUM_CLASS(SharedSurfaceType, uint8_t)
70 Unknown = 0,
72 Basic,
73 GLTextureShare,
74 EGLImageShare,
75 EGLSurfaceANGLE,
76 DXGLInterop,
77 DXGLInterop2,
78 Gralloc,
79 IOSurface,
81 Max
82 MOZ_END_ENUM_CLASS(SharedSurfaceType)
85 MOZ_BEGIN_ENUM_CLASS(SurfaceStreamType, uint8_t)
86 SingleBuffer,
87 TripleBuffer_Copy,
88 TripleBuffer_Async,
89 TripleBuffer,
90 Max
91 MOZ_END_ENUM_CLASS(SurfaceStreamType)
94 MOZ_BEGIN_ENUM_CLASS(AttachmentType, uint8_t)
95 Screen = 0,
97 GLTexture,
98 GLRenderbuffer,
101 MOZ_END_ENUM_CLASS(AttachmentType)
103 } /* namespace gfx */
104 } /* namespace mozilla */
106 #endif /* SURFACE_TYPES_H_ */