Skip to content
This repository was archived by the owner on Nov 1, 2021. It is now read-only.

Commit 4a4c8ca

Browse files
committed
render/gles2: add getter for wlr_egl_context instead of wlr_egl
1 parent f12fa92 commit 4a4c8ca

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

include/wlr/render/gles2.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,17 @@
1313
#include <wlr/backend.h>
1414
#include <wlr/render/wlr_renderer.h>
1515

16-
struct wlr_egl;
16+
struct wlr_egl_context;
1717

1818
struct wlr_renderer *wlr_gles2_renderer_create_with_drm_fd(int drm_fd);
1919

20-
struct wlr_egl *wlr_gles2_renderer_get_egl(struct wlr_renderer *renderer);
20+
/**
21+
* Returns the current EGL context
22+
* The pointer returned is not owned by the caller
23+
*/
24+
struct wlr_egl_context *wlr_gles2_renderer_get_egl_context(
25+
struct wlr_renderer *wlr_renderer);
26+
2127
bool wlr_gles2_renderer_check_ext(struct wlr_renderer *renderer,
2228
const char *ext);
2329
/**

render/gles2/renderer.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -494,10 +494,10 @@ static uint32_t gles2_get_render_buffer_caps(struct wlr_renderer *wlr_renderer)
494494
return WLR_BUFFER_CAP_DMABUF;
495495
}
496496

497-
struct wlr_egl *wlr_gles2_renderer_get_egl(struct wlr_renderer *wlr_renderer) {
498-
struct wlr_gles2_renderer *renderer =
499-
gles2_get_renderer(wlr_renderer);
500-
return renderer->egl;
497+
struct wlr_egl_context *wlr_gles2_renderer_get_egl_context(
498+
struct wlr_renderer *wlr_renderer) {
499+
struct wlr_gles2_renderer *renderer = gles2_get_renderer(wlr_renderer);
500+
return &renderer->egl->ctx;
501501
}
502502

503503
static void gles2_destroy(struct wlr_renderer *wlr_renderer) {

0 commit comments

Comments
 (0)