mirror of
https://github.com/brl/mutter.git
synced 2024-11-21 23:50:41 -05:00
cogl/onscreen: Move binding to onscreen class
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1514>
This commit is contained in:
parent
fe72876b20
commit
f663567405
@ -81,6 +81,9 @@ _cogl_onscreen_queue_dirty (CoglOnscreen *onscreen,
|
|||||||
void
|
void
|
||||||
_cogl_onscreen_queue_full_dirty (CoglOnscreen *onscreen);
|
_cogl_onscreen_queue_full_dirty (CoglOnscreen *onscreen);
|
||||||
|
|
||||||
|
void
|
||||||
|
cogl_onscreen_bind (CoglOnscreen *onscreen);
|
||||||
|
|
||||||
COGL_EXPORT void
|
COGL_EXPORT void
|
||||||
cogl_onscreen_set_winsys (CoglOnscreen *onscreen,
|
cogl_onscreen_set_winsys (CoglOnscreen *onscreen,
|
||||||
gpointer winsys);
|
gpointer winsys);
|
||||||
|
@ -301,6 +301,12 @@ _cogl_onscreen_queue_event (CoglOnscreen *onscreen,
|
|||||||
_cogl_onscreen_queue_dispatch_idle (onscreen);
|
_cogl_onscreen_queue_dispatch_idle (onscreen);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
cogl_onscreen_bind (CoglOnscreen *onscreen)
|
||||||
|
{
|
||||||
|
COGL_ONSCREEN_GET_CLASS (onscreen)->bind (onscreen);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
cogl_onscreen_swap_buffers_with_damage (CoglOnscreen *onscreen,
|
cogl_onscreen_swap_buffers_with_damage (CoglOnscreen *onscreen,
|
||||||
const int *rectangles,
|
const int *rectangles,
|
||||||
|
@ -58,6 +58,8 @@ struct _CoglOnscreenClass
|
|||||||
/*< private >*/
|
/*< private >*/
|
||||||
CoglFramebufferClass parent_class;
|
CoglFramebufferClass parent_class;
|
||||||
|
|
||||||
|
void (* bind) (CoglOnscreen *onscreen);
|
||||||
|
|
||||||
void (* swap_buffers_with_damage) (CoglOnscreen *onscreen,
|
void (* swap_buffers_with_damage) (CoglOnscreen *onscreen,
|
||||||
const int *rectangles,
|
const int *rectangles,
|
||||||
int n_rectangles,
|
int n_rectangles,
|
||||||
|
@ -165,10 +165,8 @@ cogl_gl_framebuffer_back_bind (CoglGlFramebuffer *gl_framebuffer,
|
|||||||
CoglFramebuffer *framebuffer =
|
CoglFramebuffer *framebuffer =
|
||||||
cogl_framebuffer_driver_get_framebuffer (driver);
|
cogl_framebuffer_driver_get_framebuffer (driver);
|
||||||
CoglContext *ctx = cogl_framebuffer_get_context (framebuffer);
|
CoglContext *ctx = cogl_framebuffer_get_context (framebuffer);
|
||||||
const CoglWinsysVtable *winsys =
|
|
||||||
_cogl_framebuffer_get_winsys (framebuffer);
|
|
||||||
|
|
||||||
winsys->onscreen_bind (COGL_ONSCREEN (framebuffer));
|
cogl_onscreen_bind (COGL_ONSCREEN (framebuffer));
|
||||||
|
|
||||||
GE (ctx, glBindFramebuffer (target, 0));
|
GE (ctx, glBindFramebuffer (target, 0));
|
||||||
|
|
||||||
|
@ -126,7 +126,7 @@ cogl_onscreen_egl_dispose (GObject *object)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static void
|
||||||
bind_onscreen_with_context (CoglOnscreen *onscreen,
|
bind_onscreen_with_context (CoglOnscreen *onscreen,
|
||||||
EGLContext egl_context)
|
EGLContext egl_context)
|
||||||
{
|
{
|
||||||
@ -147,24 +147,16 @@ bind_onscreen_with_context (CoglOnscreen *onscreen,
|
|||||||
|
|
||||||
eglSwapInterval (egl_renderer->edpy, 1);
|
eglSwapInterval (egl_renderer->edpy, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
return status;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static void
|
||||||
bind_onscreen (CoglOnscreen *onscreen)
|
cogl_onscreen_egl_bind (CoglOnscreen *onscreen)
|
||||||
{
|
{
|
||||||
CoglFramebuffer *framebuffer = COGL_FRAMEBUFFER (onscreen);
|
CoglFramebuffer *framebuffer = COGL_FRAMEBUFFER (onscreen);
|
||||||
CoglContext *context = cogl_framebuffer_get_context (framebuffer);
|
CoglContext *context = cogl_framebuffer_get_context (framebuffer);
|
||||||
CoglDisplayEGL *egl_display = context->display->winsys;
|
CoglDisplayEGL *egl_display = context->display->winsys;
|
||||||
|
|
||||||
return bind_onscreen_with_context (onscreen, egl_display->egl_context);
|
bind_onscreen_with_context (onscreen, egl_display->egl_context);
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
_cogl_winsys_onscreen_egl_bind (CoglOnscreen *onscreen)
|
|
||||||
{
|
|
||||||
bind_onscreen (onscreen);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef EGL_BUFFER_AGE_EXT
|
#ifndef EGL_BUFFER_AGE_EXT
|
||||||
@ -358,6 +350,7 @@ cogl_onscreen_egl_class_init (CoglOnscreenEglClass *klass)
|
|||||||
|
|
||||||
object_class->dispose = cogl_onscreen_egl_dispose;
|
object_class->dispose = cogl_onscreen_egl_dispose;
|
||||||
|
|
||||||
|
onscreen_class->bind = cogl_onscreen_egl_bind;
|
||||||
onscreen_class->swap_buffers_with_damage =
|
onscreen_class->swap_buffers_with_damage =
|
||||||
cogl_onscreen_egl_swap_buffers_with_damage;
|
cogl_onscreen_egl_swap_buffers_with_damage;
|
||||||
onscreen_class->swap_region = cogl_onscreen_egl_swap_region;
|
onscreen_class->swap_region = cogl_onscreen_egl_swap_region;
|
||||||
|
@ -41,9 +41,6 @@ struct _CoglOnscreenEglClass
|
|||||||
CoglOnscreenClass parent_class;
|
CoglOnscreenClass parent_class;
|
||||||
};
|
};
|
||||||
|
|
||||||
void
|
|
||||||
_cogl_winsys_onscreen_egl_bind (CoglOnscreen *onscreen);
|
|
||||||
|
|
||||||
int
|
int
|
||||||
_cogl_winsys_onscreen_egl_get_buffer_age (CoglOnscreen *onscreen);
|
_cogl_winsys_onscreen_egl_get_buffer_age (CoglOnscreen *onscreen);
|
||||||
|
|
||||||
|
@ -272,8 +272,8 @@ cogl_onscreen_glx_dispose (GObject *object)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
_cogl_winsys_onscreen_glx_bind (CoglOnscreen *onscreen)
|
cogl_onscreen_glx_bind (CoglOnscreen *onscreen)
|
||||||
{
|
{
|
||||||
CoglOnscreenGlx *onscreen_glx = COGL_ONSCREEN_GLX (onscreen);
|
CoglOnscreenGlx *onscreen_glx = COGL_ONSCREEN_GLX (onscreen);
|
||||||
CoglFramebuffer *framebuffer = COGL_FRAMEBUFFER (onscreen);
|
CoglFramebuffer *framebuffer = COGL_FRAMEBUFFER (onscreen);
|
||||||
@ -1160,6 +1160,7 @@ cogl_onscreen_glx_class_init (CoglOnscreenGlxClass *klass)
|
|||||||
|
|
||||||
framebuffer_class->allocate = cogl_onscreen_glx_allocate;
|
framebuffer_class->allocate = cogl_onscreen_glx_allocate;
|
||||||
|
|
||||||
|
onscreen_class->bind = cogl_onscreen_glx_bind;
|
||||||
onscreen_class->swap_buffers_with_damage =
|
onscreen_class->swap_buffers_with_damage =
|
||||||
cogl_onscreen_glx_swap_buffers_with_damage;
|
cogl_onscreen_glx_swap_buffers_with_damage;
|
||||||
onscreen_class->swap_region = cogl_onscreen_glx_swap_region;
|
onscreen_class->swap_region = cogl_onscreen_glx_swap_region;
|
||||||
|
@ -41,9 +41,6 @@ cogl_onscreen_glx_new (CoglContext *context,
|
|||||||
int width,
|
int width,
|
||||||
int height);
|
int height);
|
||||||
|
|
||||||
void
|
|
||||||
_cogl_winsys_onscreen_glx_bind (CoglOnscreen *onscreen);
|
|
||||||
|
|
||||||
int
|
int
|
||||||
_cogl_winsys_onscreen_glx_get_buffer_age (CoglOnscreen *onscreen);
|
_cogl_winsys_onscreen_glx_get_buffer_age (CoglOnscreen *onscreen);
|
||||||
|
|
||||||
|
@ -636,7 +636,6 @@ static CoglWinsysVtable _cogl_winsys_vtable =
|
|||||||
.display_destroy = _cogl_winsys_display_destroy,
|
.display_destroy = _cogl_winsys_display_destroy,
|
||||||
.context_init = _cogl_winsys_context_init,
|
.context_init = _cogl_winsys_context_init,
|
||||||
.context_deinit = _cogl_winsys_context_deinit,
|
.context_deinit = _cogl_winsys_context_deinit,
|
||||||
.onscreen_bind = _cogl_winsys_onscreen_egl_bind,
|
|
||||||
.onscreen_get_buffer_age = _cogl_winsys_onscreen_egl_get_buffer_age,
|
.onscreen_get_buffer_age = _cogl_winsys_onscreen_egl_get_buffer_age,
|
||||||
|
|
||||||
#if defined(EGL_KHR_fence_sync) || defined(EGL_KHR_reusable_sync)
|
#if defined(EGL_KHR_fence_sync) || defined(EGL_KHR_reusable_sync)
|
||||||
|
@ -1469,7 +1469,6 @@ static CoglWinsysVtable _cogl_winsys_vtable =
|
|||||||
.context_init = _cogl_winsys_context_init,
|
.context_init = _cogl_winsys_context_init,
|
||||||
.context_deinit = _cogl_winsys_context_deinit,
|
.context_deinit = _cogl_winsys_context_deinit,
|
||||||
.context_get_clock_time = _cogl_winsys_get_clock_time,
|
.context_get_clock_time = _cogl_winsys_get_clock_time,
|
||||||
.onscreen_bind = _cogl_winsys_onscreen_glx_bind,
|
|
||||||
.onscreen_get_buffer_age = _cogl_winsys_onscreen_glx_get_buffer_age,
|
.onscreen_get_buffer_age = _cogl_winsys_onscreen_glx_get_buffer_age,
|
||||||
.onscreen_x11_get_window_xid =
|
.onscreen_x11_get_window_xid =
|
||||||
_cogl_winsys_onscreen_glx_get_window_xid,
|
_cogl_winsys_onscreen_glx_get_window_xid,
|
||||||
|
@ -104,9 +104,6 @@ typedef struct _CoglWinsysVtable
|
|||||||
void
|
void
|
||||||
(*context_deinit) (CoglContext *context);
|
(*context_deinit) (CoglContext *context);
|
||||||
|
|
||||||
void
|
|
||||||
(*onscreen_bind) (CoglOnscreen *onscreen);
|
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
(*onscreen_direct_scanout) (CoglOnscreen *onscreen,
|
(*onscreen_direct_scanout) (CoglOnscreen *onscreen,
|
||||||
CoglScanout *scanout,
|
CoglScanout *scanout,
|
||||||
|
Loading…
Reference in New Issue
Block a user