tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

GLContextTypes.h (1694B)


      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/. */
      5 
      6 #ifndef GLCONTEXT_TYPES_H_
      7 #define GLCONTEXT_TYPES_H_
      8 
      9 #include "GLTypes.h"
     10 #include "mozilla/DefineEnum.h"
     11 #include "mozilla/TypedEnumBits.h"
     12 
     13 namespace mozilla {
     14 namespace gl {
     15 
     16 class GLContext;
     17 
     18 enum class GLContextType { Unknown, WGL, CGL, GLX, EGL, EAGL };
     19 
     20 enum class OriginPos : uint8_t { TopLeft, BottomLeft };
     21 
     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,
     31 
     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,
     38 
     39  FORBID_HARDWARE = 1 << 10,
     40 };
     41 MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS(CreateContextFlags)
     42 
     43 struct GLContextCreateDesc {
     44  CreateContextFlags flags = CreateContextFlags::NONE;
     45 };
     46 
     47 struct GLContextDesc final : public GLContextCreateDesc {
     48  bool isOffscreen = false;
     49 };
     50 
     51 // -
     52 
     53 MOZ_DEFINE_ENUM_CLASS_WITH_BASE(GLVendor, uint8_t,
     54                                (Intel, NVIDIA, ATI, Qualcomm, Imagination,
     55                                 Nouveau, Vivante, VMware, ARM, Other));
     56 
     57 } /* namespace gl */
     58 } /* namespace mozilla */
     59 
     60 #endif /* GLCONTEXT_TYPES_H_ */