Backed out 3 changesets (bug 1764201) for causing multiple failures, including build...
[gecko.git] / gfx / gl / GLContextTypes.h
blob09ea3c21a7a0ba0ac8e6598ca602d77cedb6fd12
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_
9 #include "GLTypes.h"
10 #include "mozilla/DefineEnum.h"
11 #include "mozilla/TypedEnumBits.h"
13 namespace mozilla {
14 namespace gl {
16 class GLContext;
18 enum class GLContextType { Unknown, WGL, CGL, GLX, EGL, EAGL };
20 enum class OriginPos : uint8_t { TopLeft, BottomLeft };
22 enum class CreateContextFlags : uint16_t {
23 NONE = 0,
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
30 PREFER_ES3 = 1 << 3,
32 NO_VALIDATION = 1 << 4,
33 PREFER_ROBUSTNESS = 1 << 5,
34 HIGH_POWER = 1 << 6,
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;
51 // -
53 MOZ_DEFINE_ENUM_CLASS_WITH_BASE(GLVendor, uint8_t,
54 (Intel, NVIDIA, ATI, Qualcomm, Imagination,
55 Nouveau, Vivante, VMware, ARM, Other));
57 } /* namespace gl */
58 } /* namespace mozilla */
60 #endif /* GLCONTEXT_TYPES_H_ */