c/client: Move NOOP begin/end to EGL client

This commit is contained in:
Jakob Bornecrantz 2022-04-08 11:32:40 +01:00
parent 46debec4fd
commit 0d152381a8
2 changed files with 26 additions and 16 deletions

View file

@ -213,6 +213,19 @@ insert_fence_android_native(struct xrt_compositor *xc, xrt_graphics_sync_handle_
return XRT_SUCCESS;
}
static xrt_result_t
client_egl_context_begin(struct xrt_compositor *xc)
{
//! @todo Implement
return XRT_SUCCESS;
}
static void
client_egl_context_end(struct xrt_compositor *xc)
{
//! @todo Implement
}
static void
client_egl_compositor_destroy(struct xrt_compositor *xc)
{
@ -350,8 +363,14 @@ xrt_gfx_provider_create_gl_egl(struct xrt_compositor_native *xcn,
insert_fence_func = insert_fence_android_native;
}
//! @todo implement client_gl_context_begin_func and client_gl_context_end_func
if (!client_gl_compositor_init(&ceglc->base, xcn, NULL, NULL, sc_create, insert_fence_func)) {
bool bret = client_gl_compositor_init( //
&ceglc->base, // c
xcn, // xcn
client_egl_context_begin, // context_begin
client_egl_context_end, // context_end
sc_create, // create_swapchain
insert_fence_func); // insert_fence
if (!bret) {
free(ceglc);
EGL_ERROR("Failed to initialize compositor");
old_restore(&old, display);

View file

@ -490,18 +490,6 @@ client_gl_compositor_destroy(struct xrt_compositor *xc)
assert(!"Destroy should be implemented by the winsys code that uses the GL code.");
}
static xrt_result_t
client_gl_context_begin_nop(struct xrt_compositor *xc)
{
return XRT_SUCCESS;
}
static void
client_gl_context_end_nop(struct xrt_compositor *xc)
{
// No return
}
/*
*
@ -523,6 +511,9 @@ client_gl_compositor_init(struct client_gl_compositor *c,
client_gl_swapchain_create_func create_swapchain,
client_gl_insert_fence_func insert_fence)
{
assert(context_begin != NULL);
assert(context_end != NULL);
c->base.base.create_swapchain = client_gl_swapchain_create;
c->base.base.begin_session = client_gl_compositor_begin_session;
c->base.base.end_session = client_gl_compositor_end_session;
@ -540,8 +531,8 @@ client_gl_compositor_init(struct client_gl_compositor *c,
c->base.base.layer_commit = client_gl_compositor_layer_commit;
c->base.base.destroy = client_gl_compositor_destroy;
c->base.base.poll_events = client_gl_compositor_poll_events;
c->context_begin = context_begin ? context_begin : client_gl_context_begin_nop;
c->context_end = context_end ? context_end : client_gl_context_end_nop;
c->context_begin = context_begin;
c->context_end = context_end;
c->create_swapchain = create_swapchain;
c->insert_fence = insert_fence;
c->xcn = xcn;