1 /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
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 GLCONTEXT_TYPES_H_
7 #define GLCONTEXT_TYPES_H_
10 #include "mozilla/DefineEnum.h"
11 #include "mozilla/TypedEnumBits.h"
18 enum class GLContextType
{ Unknown
, WGL
, CGL
, GLX
, EGL
, EAGL
};
20 enum class OriginPos
: uint8_t { TopLeft
, BottomLeft
};
22 enum class CreateContextFlags
: uint16_t {
24 REQUIRE_COMPAT_PROFILE
= 1 << 0,
25 // Force the use of hardware backed GL, don't allow software implementations.
26 FORBID_SOFTWARE
= 1 << 1,
27 /* Don't force discrete GPU to be used (if applicable) */
28 ALLOW_OFFLINE_RENDERER
= 1 << 2,
29 // Ask for ES3 if possible
32 NO_VALIDATION
= 1 << 4,
33 PREFER_ROBUSTNESS
= 1 << 5,
35 PROVOKING_VERTEX_DONT_CARE
= 1 << 7,
36 PREFER_EXACT_VERSION
= 1 << 8,
37 PREFER_MULTITHREADED
= 1 << 9,
39 FORBID_HARDWARE
= 1 << 10,
41 MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS(CreateContextFlags
)
43 struct GLContextCreateDesc
{
44 CreateContextFlags flags
= CreateContextFlags::NONE
;
47 struct GLContextDesc final
: public GLContextCreateDesc
{
48 bool isOffscreen
= false;
53 MOZ_DEFINE_ENUM_CLASS_WITH_BASE(GLVendor
, uint8_t,
54 (Intel
, NVIDIA
, ATI
, Qualcomm
, Imagination
,
55 Nouveau
, Vivante
, VMware
, ARM
, Other
));
58 } /* namespace mozilla */
60 #endif /* GLCONTEXT_TYPES_H_ */