mirror of
https://github.com/brl/mutter.git
synced 2024-11-22 08:00:42 -05:00
cogl/gl-framebuffer: Make it a GObject
This way we can have separate types per modes of operation (e.g. if it's backed by an EGLSurface or single texture), instead of being dependent on a certain type (onscreen vs offscreen). Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1514>
This commit is contained in:
parent
0e376f4dda
commit
f56b0abaef
@ -34,6 +34,11 @@
|
||||
#ifndef __COGL_FRAMEBUFFER_GL_PRIVATE_H__
|
||||
#define __COGL_FRAMEBUFFER_GL_PRIVATE_H__
|
||||
|
||||
#define COGL_TYPE_GL_FRAMEBUFFER (cogl_gl_framebuffer_get_type ())
|
||||
G_DECLARE_FINAL_TYPE (CoglGlFramebuffer, cogl_gl_framebuffer,
|
||||
COGL, GL_FRAMEBUFFER,
|
||||
GObject)
|
||||
|
||||
gboolean
|
||||
_cogl_offscreen_gl_allocate (CoglOffscreen *offscreen,
|
||||
GError **error);
|
||||
|
@ -127,11 +127,16 @@
|
||||
#define GL_STENCIL 0x1802
|
||||
#endif
|
||||
|
||||
typedef struct _CoglGlFramebuffer
|
||||
struct _CoglGlFramebuffer
|
||||
{
|
||||
GObject parent;
|
||||
|
||||
gboolean dirty_bitmasks;
|
||||
CoglFramebufferBits bits;
|
||||
} CoglGlFramebuffer;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE (CoglGlFramebuffer, cogl_gl_framebuffer,
|
||||
G_TYPE_OBJECT)
|
||||
|
||||
static void
|
||||
_cogl_framebuffer_gl_flush_viewport_state (CoglFramebuffer *framebuffer)
|
||||
@ -957,10 +962,10 @@ ensure_gl_framebuffer (CoglFramebuffer *framebuffer)
|
||||
gl_framebuffer = cogl_framebuffer_get_driver_private (framebuffer);
|
||||
if (!gl_framebuffer)
|
||||
{
|
||||
gl_framebuffer = g_new0 (CoglGlFramebuffer, 1);
|
||||
gl_framebuffer = g_object_new (COGL_TYPE_GL_FRAMEBUFFER, NULL);
|
||||
cogl_framebuffer_set_driver_private (framebuffer,
|
||||
gl_framebuffer,
|
||||
g_free);
|
||||
g_object_unref);
|
||||
gl_framebuffer->dirty_bitmasks = TRUE;
|
||||
}
|
||||
|
||||
@ -1465,3 +1470,13 @@ EXIT:
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
static void
|
||||
cogl_gl_framebuffer_init (CoglGlFramebuffer *gl_framebuffer)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
cogl_gl_framebuffer_class_init (CoglGlFramebufferClass *klass)
|
||||
{
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user