diff --git a/src/compositor/meta-surface-actor-wayland.c b/src/compositor/meta-surface-actor-wayland.c index 3389b614f..e0c6ff7b7 100644 --- a/src/compositor/meta-surface-actor-wayland.c +++ b/src/compositor/meta-surface-actor-wayland.c @@ -80,31 +80,6 @@ meta_surface_actor_wayland_pre_paint (MetaSurfaceActor *actor) { } -static gboolean -meta_surface_actor_wayland_is_argb32 (MetaSurfaceActor *actor) -{ - MetaShapedTexture *stex = meta_surface_actor_get_texture (actor); - CoglTexture *texture = meta_shaped_texture_get_texture (stex); - - /* If we don't have a texture, like during initialization, assume - * that we're ARGB32. */ - if (!texture) - return TRUE; - - switch (cogl_texture_get_components (texture)) - { - case COGL_TEXTURE_COMPONENTS_A: - case COGL_TEXTURE_COMPONENTS_RGBA: - return TRUE; - case COGL_TEXTURE_COMPONENTS_RG: - case COGL_TEXTURE_COMPONENTS_RGB: - case COGL_TEXTURE_COMPONENTS_DEPTH: - return FALSE; - default: - g_assert_not_reached (); - } -} - static gboolean meta_surface_actor_wayland_is_visible (MetaSurfaceActor *actor) { @@ -159,7 +134,6 @@ meta_surface_actor_wayland_class_init (MetaSurfaceActorWaylandClass *klass) surface_actor_class->process_damage = meta_surface_actor_wayland_process_damage; surface_actor_class->pre_paint = meta_surface_actor_wayland_pre_paint; - surface_actor_class->is_argb32 = meta_surface_actor_wayland_is_argb32; surface_actor_class->is_visible = meta_surface_actor_wayland_is_visible; surface_actor_class->should_unredirect = meta_surface_actor_wayland_should_unredirect; diff --git a/src/compositor/meta-surface-actor-x11.c b/src/compositor/meta-surface-actor-x11.c index 5cab15fd7..f6c9fb185 100644 --- a/src/compositor/meta-surface-actor-x11.c +++ b/src/compositor/meta-surface-actor-x11.c @@ -28,7 +28,6 @@ #include "meta-surface-actor-x11.h" #include -#include #include #include @@ -54,7 +53,6 @@ struct _MetaSurfaceActorX11Private guint does_full_damage : 1; /* Other state... */ - guint argb32 : 1; guint received_damage : 1; guint size_changed : 1; @@ -266,28 +264,6 @@ meta_surface_actor_x11_pre_paint (MetaSurfaceActor *actor) update_pixmap (self); } -static void -update_is_argb32 (MetaSurfaceActorX11 *self) -{ - MetaSurfaceActorX11Private *priv = meta_surface_actor_x11_get_instance_private (self); - MetaDisplay *display = priv->display; - Display *xdisplay = meta_display_get_xdisplay (display); - - XRenderPictFormat *format; - format = XRenderFindVisualFormat (xdisplay, priv->window->xvisual); - - priv->argb32 = (format && format->type == PictTypeDirect && format->direct.alphaMask); -} - -static gboolean -meta_surface_actor_x11_is_argb32 (MetaSurfaceActor *actor) -{ - MetaSurfaceActorX11 *self = META_SURFACE_ACTOR_X11 (actor); - MetaSurfaceActorX11Private *priv = meta_surface_actor_x11_get_instance_private (self); - - return priv->argb32; -} - static gboolean meta_surface_actor_x11_is_visible (MetaSurfaceActor *actor) { @@ -312,7 +288,7 @@ meta_surface_actor_x11_should_unredirect (MetaSurfaceActor *actor) if (window->shape_region != NULL) return FALSE; - if (priv->argb32 && !meta_window_requested_bypass_compositor (window)) + if (meta_surface_actor_is_argb32 (actor) && !meta_window_requested_bypass_compositor (window)) return FALSE; if (!meta_window_is_monitor_sized (window)) @@ -405,7 +381,6 @@ meta_surface_actor_x11_class_init (MetaSurfaceActorX11Class *klass) surface_actor_class->process_damage = meta_surface_actor_x11_process_damage; surface_actor_class->pre_paint = meta_surface_actor_x11_pre_paint; - surface_actor_class->is_argb32 = meta_surface_actor_x11_is_argb32; surface_actor_class->is_visible = meta_surface_actor_x11_is_visible; surface_actor_class->should_unredirect = meta_surface_actor_x11_should_unredirect; @@ -461,8 +436,6 @@ meta_surface_actor_x11_new (MetaWindow *window) g_signal_connect_object (priv->window, "notify::decorated", G_CALLBACK (window_decorated_notify), self, 0); - update_is_argb32 (self); - priv->unredirected = FALSE; sync_unredirected (self); diff --git a/src/compositor/meta-surface-actor.c b/src/compositor/meta-surface-actor.c index 7b4fc298d..3e7db6b20 100644 --- a/src/compositor/meta-surface-actor.c +++ b/src/compositor/meta-surface-actor.c @@ -263,7 +263,26 @@ meta_surface_actor_pre_paint (MetaSurfaceActor *self) gboolean meta_surface_actor_is_argb32 (MetaSurfaceActor *self) { - return META_SURFACE_ACTOR_GET_CLASS (self)->is_argb32 (self); + MetaShapedTexture *stex = meta_surface_actor_get_texture (self); + CoglTexture *texture = meta_shaped_texture_get_texture (stex); + + /* If we don't have a texture, like during initialization, assume + * that we're ARGB32. */ + if (!texture) + return TRUE; + + switch (cogl_texture_get_components (texture)) + { + case COGL_TEXTURE_COMPONENTS_A: + case COGL_TEXTURE_COMPONENTS_RGBA: + return TRUE; + case COGL_TEXTURE_COMPONENTS_RG: + case COGL_TEXTURE_COMPONENTS_RGB: + case COGL_TEXTURE_COMPONENTS_DEPTH: + return FALSE; + default: + g_assert_not_reached (); + } } gboolean diff --git a/src/compositor/meta-surface-actor.h b/src/compositor/meta-surface-actor.h index c06e1836b..3991d5297 100644 --- a/src/compositor/meta-surface-actor.h +++ b/src/compositor/meta-surface-actor.h @@ -29,7 +29,6 @@ struct _MetaSurfaceActorClass void (* process_damage) (MetaSurfaceActor *actor, int x, int y, int width, int height); void (* pre_paint) (MetaSurfaceActor *actor); - gboolean (* is_argb32) (MetaSurfaceActor *actor); gboolean (* is_visible) (MetaSurfaceActor *actor); gboolean (* should_unredirect) (MetaSurfaceActor *actor);