Bug 1891710: part 2) Enable <Element-outerHTML.html> WPT for Trusted Types. r=smaug
[gecko.git] / gfx / gl / GLContextEAGL.h
blob2b062d1a0f660a27d7fc530d6faf8d00d2b390ad
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef GLCONTEXTEAGL_H_
8 #define GLCONTEXTEAGL_H_
10 #include "GLContext.h"
12 #include <CoreGraphics/CoreGraphics.h>
13 #ifdef __OBJC__
14 # include <OpenGLES/EAGL.h>
15 #else
16 typedef void EAGLContext;
17 #endif
19 namespace mozilla {
20 namespace gl {
22 class GLContextEAGL : public GLContext {
23 friend class GLContextProviderEAGL;
25 EAGLContext* const mContext;
27 public:
28 MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(GLContextEAGL, override)
29 GLContextEAGL(const GLContextDesc&, EAGLContext* context,
30 GLContext* sharedContext);
32 ~GLContextEAGL();
34 virtual GLContextType GetContextType() const override {
35 return GLContextType::EAGL;
38 static GLContextEAGL* Cast(GLContext* gl) {
39 MOZ_ASSERT(gl->GetContextType() == GLContextType::EAGL);
40 return static_cast<GLContextEAGL*>(gl);
43 EAGLContext* GetEAGLContext() const { return mContext; }
45 virtual bool MakeCurrentImpl() const override;
47 virtual bool IsCurrentImpl() const override;
49 Maybe<SymbolLoader> GetSymbolLoader() const override;
51 virtual bool IsDoubleBuffered() const override;
53 virtual bool SwapBuffers() override;
55 virtual void GetWSIInfo(nsCString* const out) const override;
57 virtual GLuint GetDefaultFramebuffer() override { return mBackbufferFB; }
59 private:
60 GLuint mBackbufferRB = 0;
61 GLuint mBackbufferFB = 0;
64 } // namespace gl
65 } // namespace mozilla
67 #endif // GLCONTEXTEAGL_H_