2
* Copyright © 2013 Canonical Ltd.
4
* This program is free software: you can redistribute it and/or modify it
5
* under the terms of the GNU General Public License version 3,
6
* as published by the Free Software Foundation.
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
13
* You should have received a copy of the GNU General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16
* Authored by: Alexandros Frantzis <alexandros.frantzis@canonical.com>
19
#ifndef MIR_GRAPHICS_SURFACELESS_EGL_CONTEXT_H_
20
#define MIR_GRAPHICS_SURFACELESS_EGL_CONTEXT_H_
22
#include "mir/graphics/egl_resources.h"
23
#include "mir/graphics/gl_context.h"
32
class SurfacelessEGLContext : public GLContext
35
SurfacelessEGLContext(EGLDisplay egl_display, EGLContext shared_context);
36
SurfacelessEGLContext(EGLDisplay egl_display, EGLint const* attribs, EGLContext shared_context);
37
/* We have to explicitly define this, as GLContext has a deleted copy constructor */
38
SurfacelessEGLContext(SurfacelessEGLContext&& move);
39
virtual ~SurfacelessEGLContext() noexcept;
41
void make_current() const override;
42
void release_current() const override;
44
operator EGLContext() const;
47
SurfacelessEGLContext(SurfacelessEGLContext const&) = delete;
48
SurfacelessEGLContext& operator=(SurfacelessEGLContext const&) = delete;
50
EGLDisplay egl_display;
53
graphics::EGLSurfaceStore egl_surface;
54
graphics::EGLContextStore egl_context;
60
#endif /* MIR_GRAPHICS_SURFACELESS_EGL_SURFACE_H_ */