mirror of
https://github.com/brl/mutter.git
synced 2024-11-22 16:10:41 -05:00
Moved shadow source actor form screen to the compositor (only one needed).
This commit is contained in:
parent
2bcb7d73be
commit
6946d6a4a3
@ -140,6 +140,8 @@ typedef struct _MetaCompositorClutter
|
|||||||
Atom atom_x_set_root;
|
Atom atom_x_set_root;
|
||||||
Atom atom_net_wm_window_opacity;
|
Atom atom_net_wm_window_opacity;
|
||||||
|
|
||||||
|
ClutterActor *shadow_src;
|
||||||
|
|
||||||
gboolean show_redraw : 1;
|
gboolean show_redraw : 1;
|
||||||
gboolean debug : 1;
|
gboolean debug : 1;
|
||||||
} MetaCompositorClutter;
|
} MetaCompositorClutter;
|
||||||
@ -157,8 +159,6 @@ typedef struct _MetaCompScreen
|
|||||||
|
|
||||||
ClutterEffectTemplate *destroy_effect;
|
ClutterEffectTemplate *destroy_effect;
|
||||||
ClutterEffectTemplate *minimize_effect;
|
ClutterEffectTemplate *minimize_effect;
|
||||||
|
|
||||||
ClutterActor *shadow_src;
|
|
||||||
} MetaCompScreen;
|
} MetaCompScreen;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -318,7 +318,6 @@ meta_comp_window_constructed (GObject *object)
|
|||||||
MetaDisplay *display = meta_screen_get_display (screen);
|
MetaDisplay *display = meta_screen_get_display (screen);
|
||||||
Window xwindow = priv->xwindow;
|
Window xwindow = priv->xwindow;
|
||||||
Display *xdisplay = meta_display_get_xdisplay (display);
|
Display *xdisplay = meta_display_get_xdisplay (display);
|
||||||
MetaCompScreen *info = meta_screen_get_compositor_data (screen);
|
|
||||||
XRenderPictFormat *format;
|
XRenderPictFormat *format;
|
||||||
|
|
||||||
meta_comp_window_get_window_type (self);
|
meta_comp_window_get_window_type (self);
|
||||||
@ -337,8 +336,11 @@ meta_comp_window_constructed (GObject *object)
|
|||||||
|
|
||||||
if (meta_comp_window_has_shadow (self))
|
if (meta_comp_window_has_shadow (self))
|
||||||
{
|
{
|
||||||
|
MetaCompositorClutter *compositor =
|
||||||
|
(MetaCompositorClutter*)meta_display_get_compositor (display);
|
||||||
|
|
||||||
priv->shadow =
|
priv->shadow =
|
||||||
tidy_texture_frame_new (CLUTTER_TEXTURE (info->shadow_src),
|
tidy_texture_frame_new (CLUTTER_TEXTURE (compositor->shadow_src),
|
||||||
MAX_TILE_SZ,
|
MAX_TILE_SZ,
|
||||||
MAX_TILE_SZ,
|
MAX_TILE_SZ,
|
||||||
MAX_TILE_SZ,
|
MAX_TILE_SZ,
|
||||||
@ -1331,7 +1333,6 @@ clutter_cmp_manage_screen (MetaCompositor *compositor,
|
|||||||
Window xroot = meta_screen_get_xroot (screen);
|
Window xroot = meta_screen_get_xroot (screen);
|
||||||
Window xwin;
|
Window xwin;
|
||||||
gint width, height;
|
gint width, height;
|
||||||
guchar *data;
|
|
||||||
|
|
||||||
/* Check if the screen is already managed */
|
/* Check if the screen is already managed */
|
||||||
if (meta_screen_get_compositor_data (screen))
|
if (meta_screen_get_compositor_data (screen))
|
||||||
@ -1373,23 +1374,6 @@ clutter_cmp_manage_screen (MetaCompositor *compositor,
|
|||||||
|
|
||||||
XReparentWindow (xdisplay, xwin, info->output, 0, 0);
|
XReparentWindow (xdisplay, xwin, info->output, 0, 0);
|
||||||
|
|
||||||
/* Shadow setup */
|
|
||||||
|
|
||||||
data = shadow_gaussian_make_tile ();
|
|
||||||
|
|
||||||
info->shadow_src = clutter_texture_new ();
|
|
||||||
|
|
||||||
clutter_texture_set_from_rgb_data (CLUTTER_TEXTURE (info->shadow_src),
|
|
||||||
data,
|
|
||||||
TRUE,
|
|
||||||
TILE_WIDTH,
|
|
||||||
TILE_HEIGHT,
|
|
||||||
TILE_WIDTH*4,
|
|
||||||
4,
|
|
||||||
0,
|
|
||||||
NULL);
|
|
||||||
free (data);
|
|
||||||
|
|
||||||
clutter_actor_show_all (info->stage);
|
clutter_actor_show_all (info->stage);
|
||||||
|
|
||||||
/* Now we're up and running we can show the output if needed */
|
/* Now we're up and running we can show the output if needed */
|
||||||
@ -1683,11 +1667,12 @@ meta_compositor_clutter_new (MetaDisplay *display)
|
|||||||
MetaCompositorClutter *clc;
|
MetaCompositorClutter *clc;
|
||||||
MetaCompositor *compositor;
|
MetaCompositor *compositor;
|
||||||
Display *xdisplay = meta_display_get_xdisplay (display);
|
Display *xdisplay = meta_display_get_xdisplay (display);
|
||||||
|
guchar *data;
|
||||||
|
|
||||||
if (!composite_at_least_version (display, 0, 3))
|
if (!composite_at_least_version (display, 0, 3))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
clc = g_new (MetaCompositorClutter, 1);
|
clc = g_new0 (MetaCompositorClutter, 1);
|
||||||
clc->compositor = comp_info;
|
clc->compositor = comp_info;
|
||||||
|
|
||||||
compositor = (MetaCompositor *) clc;
|
compositor = (MetaCompositor *) clc;
|
||||||
@ -1702,6 +1687,23 @@ meta_compositor_clutter_new (MetaDisplay *display)
|
|||||||
clc->atom_x_set_root = atoms[1];
|
clc->atom_x_set_root = atoms[1];
|
||||||
clc->atom_net_wm_window_opacity = atoms[2];
|
clc->atom_net_wm_window_opacity = atoms[2];
|
||||||
|
|
||||||
|
/* Shadow setup */
|
||||||
|
|
||||||
|
data = shadow_gaussian_make_tile ();
|
||||||
|
|
||||||
|
clc->shadow_src = clutter_texture_new ();
|
||||||
|
|
||||||
|
clutter_texture_set_from_rgb_data (CLUTTER_TEXTURE (clc->shadow_src),
|
||||||
|
data,
|
||||||
|
TRUE,
|
||||||
|
TILE_WIDTH,
|
||||||
|
TILE_HEIGHT,
|
||||||
|
TILE_WIDTH*4,
|
||||||
|
4,
|
||||||
|
0,
|
||||||
|
NULL);
|
||||||
|
free (data);
|
||||||
|
|
||||||
return compositor;
|
return compositor;
|
||||||
#else
|
#else
|
||||||
return NULL;
|
return NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user