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
This commit is contained in:
Jonas Ådahl 2016-05-07 22:21:24 +08:00
parent f096cc327d
commit dd1eaeb262
5 changed files with 16 additions and 8 deletions

View File

@ -255,7 +255,7 @@ ensure_xfixes_cursor (MetaCursorTracker *tracker)
{ {
MetaCursorSprite *cursor_sprite = meta_cursor_sprite_new (); MetaCursorSprite *cursor_sprite = meta_cursor_sprite_new ();
meta_cursor_sprite_set_texture (cursor_sprite, meta_cursor_sprite_set_texture (cursor_sprite,
sprite, COGL_TEXTURE (sprite),
cursor_image->xhot, cursor_image->xhot,
cursor_image->yhot); cursor_image->yhot);
cogl_object_unref (sprite); cogl_object_unref (sprite);

View File

@ -135,7 +135,7 @@ meta_cursor_sprite_load_from_xcursor_image (MetaCursorSprite *self,
CoglPixelFormat cogl_format; CoglPixelFormat cogl_format;
ClutterBackend *clutter_backend; ClutterBackend *clutter_backend;
CoglContext *cogl_context; CoglContext *cogl_context;
CoglTexture *texture; CoglTexture2D *texture;
CoglError *error = NULL; CoglError *error = NULL;
g_assert (self->texture == NULL); g_assert (self->texture == NULL);
@ -165,7 +165,7 @@ meta_cursor_sprite_load_from_xcursor_image (MetaCursorSprite *self,
cogl_error_free (error); 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); xc_image->xhot, xc_image->yhot);
if (texture) if (texture)

View File

@ -39,7 +39,7 @@ struct _MetaBackgroundMonitor
{ {
gboolean dirty; gboolean dirty;
CoglTexture *texture; CoglTexture *texture;
CoglOffscreen *fbo; CoglFramebuffer *fbo;
}; };
struct _MetaBackgroundPrivate struct _MetaBackgroundPrivate
@ -662,6 +662,7 @@ ensure_wallpaper_texture (MetaBackground *self,
{ {
int width = cogl_texture_get_width (texture); int width = cogl_texture_get_width (texture);
int height = cogl_texture_get_height (texture); int height = cogl_texture_get_height (texture);
CoglOffscreen *offscreen;
CoglFramebuffer *fbo; CoglFramebuffer *fbo;
CoglError *catch_error = NULL; CoglError *catch_error = NULL;
CoglPipeline *pipeline; CoglPipeline *pipeline;
@ -669,7 +670,8 @@ ensure_wallpaper_texture (MetaBackground *self,
priv->wallpaper_texture = meta_create_texture (width, height, priv->wallpaper_texture = meta_create_texture (width, height,
COGL_TEXTURE_COMPONENTS_RGBA, COGL_TEXTURE_COMPONENTS_RGBA,
META_TEXTURE_FLAGS_NONE); 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)) if (!cogl_framebuffer_allocate (fbo, &catch_error))
{ {
@ -786,10 +788,13 @@ meta_background_get_texture (MetaBackground *self,
if (monitor->texture == NULL) if (monitor->texture == NULL)
{ {
CoglOffscreen *offscreen;
monitor->texture = meta_create_texture (monitor_area.width, monitor_area.height, monitor->texture = meta_create_texture (monitor_area.width, monitor_area.height,
COGL_TEXTURE_COMPONENTS_RGBA, COGL_TEXTURE_COMPONENTS_RGBA,
META_TEXTURE_FLAGS_NONE); 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)) if (!cogl_framebuffer_allocate (monitor->fbo, &catch_error))

View File

@ -213,7 +213,8 @@ meta_surface_actor_x11_process_damage (MetaSurfaceActor *actor,
if (!is_visible (self)) if (!is_visible (self))
return; 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 static void

View File

@ -361,8 +361,10 @@ texture_tower_create_texture (MetaTextureTower *tower,
{ {
ClutterBackend *backend = clutter_get_default_backend (); ClutterBackend *backend = clutter_get_default_backend ();
CoglContext *context = clutter_backend_get_cogl_context (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 else
{ {