From dd1eaeb262ff7ed7ca9531c8125e3eb35a33aad1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Sat, 7 May 2016 22:21:24 +0800 Subject: [PATCH] Use correct cogl object types Use the correct pointer types for cogl objects. This avoids warnings when including the cogl headers doesn't result in all the cogl types being typedefs to void. https://bugzilla.gnome.org/show_bug.cgi?id=768976 --- src/backends/meta-cursor-tracker.c | 2 +- src/backends/meta-cursor.c | 4 ++-- src/compositor/meta-background.c | 11 ++++++++--- src/compositor/meta-surface-actor-x11.c | 3 ++- src/compositor/meta-texture-tower.c | 4 +++- 5 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/backends/meta-cursor-tracker.c b/src/backends/meta-cursor-tracker.c index 16c7df848..be57a9b88 100644 --- a/src/backends/meta-cursor-tracker.c +++ b/src/backends/meta-cursor-tracker.c @@ -255,7 +255,7 @@ ensure_xfixes_cursor (MetaCursorTracker *tracker) { MetaCursorSprite *cursor_sprite = meta_cursor_sprite_new (); meta_cursor_sprite_set_texture (cursor_sprite, - sprite, + COGL_TEXTURE (sprite), cursor_image->xhot, cursor_image->yhot); cogl_object_unref (sprite); diff --git a/src/backends/meta-cursor.c b/src/backends/meta-cursor.c index 6a8d1e83c..256b0ca56 100644 --- a/src/backends/meta-cursor.c +++ b/src/backends/meta-cursor.c @@ -135,7 +135,7 @@ meta_cursor_sprite_load_from_xcursor_image (MetaCursorSprite *self, CoglPixelFormat cogl_format; ClutterBackend *clutter_backend; CoglContext *cogl_context; - CoglTexture *texture; + CoglTexture2D *texture; CoglError *error = NULL; g_assert (self->texture == NULL); @@ -165,7 +165,7 @@ meta_cursor_sprite_load_from_xcursor_image (MetaCursorSprite *self, cogl_error_free (error); } - meta_cursor_sprite_set_texture (self, texture, + meta_cursor_sprite_set_texture (self, COGL_TEXTURE (texture), xc_image->xhot, xc_image->yhot); if (texture) diff --git a/src/compositor/meta-background.c b/src/compositor/meta-background.c index 0c8aefacb..00d18f1fd 100644 --- a/src/compositor/meta-background.c +++ b/src/compositor/meta-background.c @@ -39,7 +39,7 @@ struct _MetaBackgroundMonitor { gboolean dirty; CoglTexture *texture; - CoglOffscreen *fbo; + CoglFramebuffer *fbo; }; struct _MetaBackgroundPrivate @@ -662,6 +662,7 @@ ensure_wallpaper_texture (MetaBackground *self, { int width = cogl_texture_get_width (texture); int height = cogl_texture_get_height (texture); + CoglOffscreen *offscreen; CoglFramebuffer *fbo; CoglError *catch_error = NULL; CoglPipeline *pipeline; @@ -669,7 +670,8 @@ ensure_wallpaper_texture (MetaBackground *self, priv->wallpaper_texture = meta_create_texture (width, height, COGL_TEXTURE_COMPONENTS_RGBA, META_TEXTURE_FLAGS_NONE); - fbo = cogl_offscreen_new_with_texture (priv->wallpaper_texture); + offscreen = cogl_offscreen_new_with_texture (priv->wallpaper_texture); + fbo = COGL_FRAMEBUFFER (offscreen); if (!cogl_framebuffer_allocate (fbo, &catch_error)) { @@ -786,10 +788,13 @@ meta_background_get_texture (MetaBackground *self, if (monitor->texture == NULL) { + CoglOffscreen *offscreen; + monitor->texture = meta_create_texture (monitor_area.width, monitor_area.height, COGL_TEXTURE_COMPONENTS_RGBA, META_TEXTURE_FLAGS_NONE); - monitor->fbo = cogl_offscreen_new_with_texture (monitor->texture); + offscreen = cogl_offscreen_new_with_texture (monitor->texture); + monitor->fbo = COGL_FRAMEBUFFER (offscreen); } if (!cogl_framebuffer_allocate (monitor->fbo, &catch_error)) diff --git a/src/compositor/meta-surface-actor-x11.c b/src/compositor/meta-surface-actor-x11.c index 41506aa6b..d32aeb68a 100644 --- a/src/compositor/meta-surface-actor-x11.c +++ b/src/compositor/meta-surface-actor-x11.c @@ -213,7 +213,8 @@ meta_surface_actor_x11_process_damage (MetaSurfaceActor *actor, if (!is_visible (self)) return; - cogl_texture_pixmap_x11_update_area (priv->texture, x, y, width, height); + cogl_texture_pixmap_x11_update_area (COGL_TEXTURE_PIXMAP_X11 (priv->texture), + x, y, width, height); } static void diff --git a/src/compositor/meta-texture-tower.c b/src/compositor/meta-texture-tower.c index a6eec7a7b..7d14bf424 100644 --- a/src/compositor/meta-texture-tower.c +++ b/src/compositor/meta-texture-tower.c @@ -361,8 +361,10 @@ texture_tower_create_texture (MetaTextureTower *tower, { ClutterBackend *backend = clutter_get_default_backend (); CoglContext *context = clutter_backend_get_cogl_context (backend); + CoglTextureRectangle *texture_rectangle; - tower->textures[level] = cogl_texture_rectangle_new_with_size (context, width, height); + texture_rectangle = cogl_texture_rectangle_new_with_size (context, width, height); + tower->textures[level] = COGL_TEXTURE (texture_rectangle); } else {