2009-06-29 14:30:26 -04:00
|
|
|
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
|
|
|
|
2010-10-18 13:27:14 -04:00
|
|
|
#ifndef META_WINDOW_GROUP_H
|
|
|
|
#define META_WINDOW_GROUP_H
|
2009-06-29 14:30:26 -04:00
|
|
|
|
|
|
|
#include <clutter/clutter.h>
|
|
|
|
|
2011-03-05 19:29:12 -05:00
|
|
|
#include <meta/screen.h>
|
2009-06-29 14:30:26 -04:00
|
|
|
|
|
|
|
/**
|
2010-10-18 13:27:14 -04:00
|
|
|
* MetaWindowGroup:
|
2009-06-29 14:30:26 -04:00
|
|
|
*
|
|
|
|
* This class is a subclass of ClutterGroup with special handling for
|
2010-10-18 13:27:14 -04:00
|
|
|
* MetaWindowActor when painting the group. When we are painting a stack
|
2009-06-29 14:30:26 -04:00
|
|
|
* of 5-10 maximized windows, the standard bottom-to-top method of
|
|
|
|
* drawing every actor results in a tremendous amount of overdraw
|
|
|
|
* and can easily max out the available memory bandwidth on a low-end
|
|
|
|
* graphics chipset. It's even worse if window textures are being accessed
|
|
|
|
* over the AGP bus.
|
|
|
|
*
|
|
|
|
* The basic technique applied here is to do a pre-pass before painting
|
|
|
|
* where we walk window from top to bottom and compute the visible area
|
|
|
|
* at each step by subtracting out the windows above it. The visible
|
2010-10-18 13:27:14 -04:00
|
|
|
* area is passed to MetaWindowActor which uses it to clip the portion of
|
2009-06-29 14:30:26 -04:00
|
|
|
* the window which drawn and avoid redrawing the shadow if it is completely
|
|
|
|
* obscured.
|
|
|
|
*
|
|
|
|
* A caveat is that this is ineffective if applications are using ARGB
|
|
|
|
* visuals, since we have no way of knowing whether a window obscures
|
|
|
|
* the windows behind it or not. Alternate approaches using the depth
|
|
|
|
* or stencil buffer rather than client side regions might be able to
|
|
|
|
* handle alpha windows, but the combination of glAlphaFunc and stenciling
|
|
|
|
* tends not to be efficient except on newer cards. (And on newer cards
|
|
|
|
* we have lots of memory and bandwidth.)
|
|
|
|
*/
|
|
|
|
|
2010-10-18 13:27:14 -04:00
|
|
|
#define META_TYPE_WINDOW_GROUP (meta_window_group_get_type ())
|
|
|
|
#define META_WINDOW_GROUP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), META_TYPE_WINDOW_GROUP, MetaWindowGroup))
|
|
|
|
#define META_WINDOW_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), META_TYPE_WINDOW_GROUP, MetaWindowGroupClass))
|
|
|
|
#define META_IS_WINDOW_GROUP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), META_TYPE_WINDOW_GROUP))
|
2010-10-24 05:59:23 -04:00
|
|
|
#define META_IS_WINDOW_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), META_TYPE_WINDOW_GROUP))
|
2010-10-18 13:27:14 -04:00
|
|
|
#define META_WINDOW_GROUP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), META_TYPE_WINDOW_GROUP, MetaWindowGroupClass))
|
2009-06-29 14:30:26 -04:00
|
|
|
|
2010-10-18 13:27:14 -04:00
|
|
|
typedef struct _MetaWindowGroup MetaWindowGroup;
|
|
|
|
typedef struct _MetaWindowGroupClass MetaWindowGroupClass;
|
|
|
|
typedef struct _MetaWindowGroupPrivate MetaWindowGroupPrivate;
|
2009-06-29 14:30:26 -04:00
|
|
|
|
2010-10-18 13:27:14 -04:00
|
|
|
GType meta_window_group_get_type (void);
|
2009-06-29 14:30:26 -04:00
|
|
|
|
2010-10-18 13:27:14 -04:00
|
|
|
ClutterActor *meta_window_group_new (MetaScreen *screen);
|
2009-06-29 14:30:26 -04:00
|
|
|
|
2010-10-18 13:27:14 -04:00
|
|
|
#endif /* META_WINDOW_GROUP_H */
|