summaryrefslogtreecommitdiff
path: root/src/backends
diff options
context:
space:
mode:
authorJonas Ã…dahl <jadahl@gmail.com>2020-10-13 11:35:47 +0200
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>2020-10-16 16:17:38 +0000
commiteb14da3874fd7044c6ef6bf28bf33b1bfcc7a3a0 (patch)
tree55e6771be7a1ac59f9c6fb7ddf6e236df2bb3a61 /src/backends
parentde4e59a39b43bd6470b446bc42038f520cdbc492 (diff)
downloadmutter-eb14da3874fd7044c6ef6bf28bf33b1bfcc7a3a0.tar.gz
cogl: Turn CoglFramebuffer, CoglOffscreen and CoglOnscreen into GObjects
A first step towards abandoning the CoglObject type system: convert CoglFramebuffer, CoglOffscreen and CoglOnscreen into GObjects. CoglFramebuffer is turned into an abstract GObject, while the two others are currently final. The "winsys" and "platform" are still sprinkled 'void *' in the the non-abstract type instances however. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1496
Diffstat (limited to 'src/backends')
-rw-r--r--src/backends/meta-screen-cast-stream-src.c4
-rw-r--r--src/backends/native/meta-renderer-native.c24
-rw-r--r--src/backends/x11/meta-stage-x11.c4
3 files changed, 16 insertions, 16 deletions
diff --git a/src/backends/meta-screen-cast-stream-src.c b/src/backends/meta-screen-cast-stream-src.c
index e0aec9115..cc08bccdb 100644
--- a/src/backends/meta-screen-cast-stream-src.c
+++ b/src/backends/meta-screen-cast-stream-src.c
@@ -214,7 +214,7 @@ draw_cursor_sprite_via_offscreen (MetaScreenCastStreamSrc *src,
cogl_object_unref (bitmap_texture);
if (!cogl_framebuffer_allocate (fb, error))
{
- cogl_object_unref (fb);
+ g_object_unref (fb);
return FALSE;
}
@@ -234,7 +234,7 @@ draw_cursor_sprite_via_offscreen (MetaScreenCastStreamSrc *src,
bitmap_width, bitmap_height,
COGL_PIXEL_FORMAT_RGBA_8888_PRE,
bitmap_data);
- cogl_object_unref (fb);
+ g_object_unref (fb);
return TRUE;
}
diff --git a/src/backends/native/meta-renderer-native.c b/src/backends/native/meta-renderer-native.c
index 68656e977..d28a81f6d 100644
--- a/src/backends/native/meta-renderer-native.c
+++ b/src/backends/native/meta-renderer-native.c
@@ -1278,7 +1278,7 @@ queue_dummy_power_save_page_flip (CoglOnscreen *onscreen)
renderer_native->power_save_page_flip_onscreens =
g_list_prepend (renderer_native->power_save_page_flip_onscreens,
- cogl_object_ref (onscreen));
+ g_object_ref (onscreen));
}
static void
@@ -1635,7 +1635,7 @@ create_dma_buf_framebuffer (MetaRendererNative *renderer_native,
if (!cogl_framebuffer_allocate (COGL_FRAMEBUFFER (cogl_fbo), error))
{
- cogl_object_unref (cogl_fbo);
+ g_object_unref (cogl_fbo);
return NULL;
}
@@ -1706,11 +1706,11 @@ copy_shared_framebuffer_primary_gpu (CoglOnscreen *onscre
dumb_fb->height,
&error))
{
- cogl_object_unref (dmabuf_fb);
+ g_object_unref (dmabuf_fb);
return FALSE;
}
- cogl_object_unref (dmabuf_fb);
+ g_object_unref (dmabuf_fb);
g_clear_object (&secondary_gpu_state->gbm.next_fb);
buffer_dumb = meta_drm_buffer_dumb_new (dumb_fb->fb_id);
@@ -2051,7 +2051,7 @@ meta_renderer_native_create_dma_buf (CoglRenderer *cogl_renderer,
width, height, stride, offset, bpp,
new_bo,
(GDestroyNotify) gbm_bo_destroy);
- cogl_object_unref (dmabuf_fb);
+ g_object_unref (dmabuf_fb);
return dmabuf_handle;
}
break;
@@ -2790,7 +2790,7 @@ meta_renderer_native_create_onscreen (MetaRendererNative *renderer_native,
if (!cogl_framebuffer_allocate (COGL_FRAMEBUFFER (onscreen), error))
{
- cogl_object_unref (onscreen);
+ g_object_unref (onscreen);
return NULL;
}
@@ -2805,7 +2805,7 @@ meta_renderer_native_create_onscreen (MetaRendererNative *renderer_native,
{
if (!init_secondary_gpu_state (renderer_native, onscreen, error))
{
- cogl_object_unref (onscreen);
+ g_object_unref (onscreen);
return NULL;
}
}
@@ -2836,7 +2836,7 @@ meta_renderer_native_create_offscreen (MetaRendererNative *renderer,
cogl_object_unref (tex);
if (!cogl_framebuffer_allocate (COGL_FRAMEBUFFER (fb), error))
{
- cogl_object_unref (fb);
+ g_object_unref (fb);
return FALSE;
}
@@ -3075,20 +3075,20 @@ meta_renderer_native_create_view (MetaRenderer *renderer,
"transform", view_transform,
"refresh-rate", crtc_mode_info->refresh_rate,
NULL);
- g_clear_pointer (&offscreen, cogl_object_unref);
+ g_clear_object (&offscreen);
meta_onscreen_native_set_view (onscreen, view);
if (!meta_onscreen_native_allocate (onscreen, &error))
{
g_warning ("Could not create onscreen: %s", error->message);
- cogl_object_unref (onscreen);
+ g_object_unref (onscreen);
g_object_unref (view);
g_error_free (error);
return NULL;
}
- cogl_object_unref (onscreen);
+ g_object_unref (onscreen);
/* Ensure we don't point to stale surfaces when creating the offscreen */
onscreen_egl = onscreen->winsys;
@@ -3857,7 +3857,7 @@ meta_renderer_native_finalize (GObject *object)
if (renderer_native->power_save_page_flip_onscreens)
{
g_list_free_full (renderer_native->power_save_page_flip_onscreens,
- (GDestroyNotify) cogl_object_unref);
+ g_object_unref);
g_clear_handle_id (&renderer_native->power_save_page_flip_source_id,
g_source_remove);
}
diff --git a/src/backends/x11/meta-stage-x11.c b/src/backends/x11/meta-stage-x11.c
index 684b711b7..18c64b6ca 100644
--- a/src/backends/x11/meta-stage-x11.c
+++ b/src/backends/x11/meta-stage-x11.c
@@ -251,7 +251,7 @@ meta_stage_x11_unrealize (ClutterStageWindow *stage_window)
clutter_stage_window_parent_iface->unrealize (stage_window);
- g_clear_pointer (&stage_x11->onscreen, cogl_object_unref);
+ g_clear_object (&stage_x11->onscreen);
}
static gboolean
@@ -289,7 +289,7 @@ meta_stage_x11_realize (ClutterStageWindow *stage_window)
{
g_warning ("Failed to allocate stage: %s", error->message);
g_error_free (error);
- cogl_object_unref (stage_x11->onscreen);
+ g_object_unref (stage_x11->onscreen);
abort();
}