It would be clearer to implement the SurfaceEGLContext(egl_display, shared_context) constructor in terms of the new SurfaceEGLContext(egl_display, attribs, shared_context) constructor, by passing our default config attribs:
Also, with this code, since the egl_context parameter is an rvalue reference, not a universal reference, using std::forward doesn't offer any benefits over using std::move.
613 + move.egl_display = EGL_NO_DISPLAY;
618 + release_current();
A invalidated (i.e. moved) SurfacelessEGLContext object may try to release the EGL context when being destroyed. Although this will have no effect since egl_display == EGL_NO_DISPLAY, I think it would be better to not try at all to avoid error/debug messages from EGL.
578 +mg::Surfaceles sEGLContext: :SurfacelessEGL Context(
587 +mg::Surfaceles sEGLContext: :SurfacelessEGL Context(
588 + EGLDisplay egl_display,
589 + EGLint const* attribs,
590 + EGLContext shared_context)
It would be clearer to implement the SurfaceEGLConte xt(egl_ display, shared_context) constructor in terms of the new SurfaceEGLConte xt(egl_ display, attribs, shared_context) constructor, by passing our default config attribs:
SurfacelessEGLC ontext( EGLDisplay egl_display, EGLContext shared_context) ontext( egl_display, default_attribs, shared_context)
: SurfacelessEGLC
429 +mgo::DisplayBu ffer::DisplayBu ffer(Surfaceles sEGLContext &&egl_context, std::move( egl_context) }, std::forward< SurfacelessEGLC ontext> (egl_context) },
430 geom::Rectangle const& area)
431 - : egl_context{
432 + : egl_context{
It's better to accept a move only type (such as SurfacelessEGLC ontext or std::unique_ptr<>) by value vs rvalue reference: see https:/ /code.launchpad .net/~rocket- scientists/ mir/buffer- swapper- multi/+ merge/139127/ comments/ 301713 .
Also, with this code, since the egl_context parameter is an rvalue reference, not a universal reference, using std::forward doesn't offer any benefits over using std::move.
613 + move.egl_display = EGL_NO_DISPLAY;
618 + release_current();
A invalidated (i.e. moved) SurfacelessEGLC ontext object may try to release the EGL context when being destroyed. Although this will have no effect since egl_display == EGL_NO_DISPLAY, I think it would be better to not try at all to avoid error/debug messages from EGL.