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>
14 # include <OpenGLES/EAGL.h>
16 typedef void EAGLContext
;
22 class GLContextEAGL
: public GLContext
{
23 friend class GLContextProviderEAGL
;
25 EAGLContext
* const mContext
;
28 MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(GLContextEAGL
, override
)
29 GLContextEAGL(const GLContextDesc
&, EAGLContext
* context
,
30 GLContext
* sharedContext
);
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
; }
60 GLuint mBackbufferRB
= 0;
61 GLuint mBackbufferFB
= 0;
65 } // namespace mozilla
67 #endif // GLCONTEXTEAGL_H_