~raof/mir/check-for-surfaceless

« back to all changes in this revision

Viewing changes to src/server/graphics/surfaceless_egl_context.h

  • Committer: Christopher James Halse Rogers
  • Date: 2013-12-12 07:48:14 UTC
  • Revision ID: christopher.halse.rogers@canonical.com-20131212074814-9klu8i03xu2zjn6c
Move EGLSurfacelessContext and GLExtensionsBase into server/graphics in preparation for sharing them between Nested and Offscreen

Also make EGLSurfacelessContext a mg::GLContext

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 * Authored by: Alexandros Frantzis <alexandros.frantzis@canonical.com>
17
17
 */
18
18
 
19
 
#ifndef MIR_GRAPHICS_OFFSCREEN_SURFACELESS_EGL_CONTEXT_H_
20
 
#define MIR_GRAPHICS_OFFSCREEN_SURFACELESS_EGL_CONTEXT_H_
 
19
#ifndef MIR_GRAPHICS_SURFACELESS_EGL_CONTEXT_H_
 
20
#define MIR_GRAPHICS_SURFACELESS_EGL_CONTEXT_H_
21
21
 
22
22
#include "mir/graphics/egl_resources.h"
 
23
#include "mir/graphics/gl_context.h"
23
24
 
24
25
#include <EGL/egl.h>
25
26
 
27
28
{
28
29
namespace graphics
29
30
{
30
 
namespace offscreen
31
 
{
32
31
 
33
 
class SurfacelessEGLContext
 
32
class SurfacelessEGLContext : public GLContext
34
33
{
35
34
public:
36
35
    SurfacelessEGLContext(EGLDisplay egl_display, EGLContext shared_context);
37
 
    SurfacelessEGLContext(SurfacelessEGLContext&&) = default;
 
36
    /* We have to explicitly define this, as GLContext has a deleted copy construtor */
 
37
    SurfacelessEGLContext(SurfacelessEGLContext&& move);
 
38
    virtual ~SurfacelessEGLContext() noexcept;
38
39
 
39
 
    void make_current() const;
40
 
    void release_current() const;
 
40
    void make_current() const override;
 
41
    void release_current() const override;
41
42
 
42
43
    operator EGLContext() const;
43
44
 
54
55
 
55
56
}
56
57
}
57
 
}
58
58
 
59
 
#endif /* MIR_GRAPHICS_OFFSCREEN_SURFACELESS_EGL_SURFACE_H_ */
 
59
#endif /* MIR_GRAPHICS_SURFACELESS_EGL_SURFACE_H_ */