#ifndef GLContextEGL_h
#define GLContextEGL_h
#if USE(EGL)
#include "GLContext.h"
#include <EGL/egl.h>
namespace WebCore {
class GLContextEGL : public GLContext {
WTF_MAKE_NONCOPYABLE(GLContextEGL);
public:
enum EGLSurfaceType { PbufferSurface, WindowSurface, PixmapSurface };
static PassOwnPtr<GLContextEGL> createContext(EGLNativeWindowType, GLContext* sharingContext = 0);
static PassOwnPtr<GLContextEGL> createWindowContext(EGLNativeWindowType, GLContext* sharingContext);
virtual ~GLContextEGL();
virtual bool makeContextCurrent();
virtual void swapBuffers();
virtual void waitNative();
virtual bool canRenderToDefaultFramebuffer();
virtual IntSize defaultFrameBufferSize();
virtual cairo_device_t* cairoDevice();
#if ENABLE(WEBGL)
virtual PlatformGraphicsContext3D platformContext();
#endif
private:
static PassOwnPtr<GLContextEGL> createPbufferContext(EGLContext sharingContext);
static PassOwnPtr<GLContextEGL> createPixmapContext(EGLContext sharingContext);
static void addActiveContext(GLContextEGL*);
static void cleanupSharedEGLDisplay(void);
GLContextEGL(EGLContext, EGLSurface, EGLSurfaceType);
EGLContext m_context;
EGLSurface m_surface;
EGLSurfaceType m_type;
cairo_device_t* m_cairoDevice;
};
}
#endif // USE(EGL)
#endif // GLContextEGL_h