mutter/src/compositor/mutter-window-private.h
Owen W. Taylor 83f8bfd2ca Reduce overpaint in the window group
When we are painting a stack 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.

When we have opaque windows, we can go ahead and compute visibility
ourselves (in classic X-server fashion) and use that information to
restrict drawing obscured actors.

* Add MutterWindowGroup - a ClutterGroup subclass with logic
  for figuring out obscured regions.

* Add mutter_window_get_obscured_region() to get the region
  obscured by that window.

* Add mutter_shaped_texture_set_clip_region() to hint
  a clip region to the painting code; this is set based on
  the computed visible region of MutterWindowGroup.

* Add tidy_texture_frame_set_needs_paint() to hint that the
  paint can be skipped entirely; this is used when we detect
  that the window shadow is entirely obscured.

http://bugzilla.gnome.org/show_bug.cgi?id=587344
2009-07-09 16:56:01 +01:00

52 lines
2.3 KiB
C

/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
#ifndef MUTTER_WINDOW_PRIVATE_H
#define MUTTER_WINDOW_PRIVATE_H
#include <X11/extensions/Xdamage.h>
#include <gdk/gdk.h>
#include "compositor-mutter.h"
MutterWindow *mutter_window_new (MetaWindow *window);
void mutter_window_destroy (MutterWindow *cw);
void mutter_window_show (MutterWindow *cw,
MetaCompEffect effect);
void mutter_window_hide (MutterWindow *cw,
MetaCompEffect effect);
void mutter_window_maximize (MutterWindow *cw,
MetaRectangle *old_rect,
MetaRectangle *new_rect);
void mutter_window_unmaximize (MutterWindow *cw,
MetaRectangle *old_rect,
MetaRectangle *new_rect);
void mutter_window_process_damage (MutterWindow *cw,
XDamageNotifyEvent *event);
void mutter_window_pre_paint (MutterWindow *self);
gboolean mutter_window_effect_in_progress (MutterWindow *cw);
void mutter_window_sync_actor_position (MutterWindow *cw);
void mutter_window_sync_visibility (MutterWindow *cw);
void mutter_window_update_window_type (MutterWindow *cw);
void mutter_window_update_shape (MutterWindow *cw,
gboolean shaped);
void mutter_window_update_opacity (MutterWindow *cw);
void mutter_window_mapped (MutterWindow *cw);
void mutter_window_unmapped (MutterWindow *cw);
GdkRegion *mutter_window_get_obscured_region (MutterWindow *cw);
void mutter_window_set_visible_region (MutterWindow *cw,
GdkRegion *visible_region);
void mutter_window_set_visible_region_beneath (MutterWindow *cw,
GdkRegion *beneath_region);
void mutter_window_reset_visible_regions (MutterWindow *cw);
void mutter_window_effect_completed (MutterWindow *actor,
gulong event);
#endif /* MUTTER_WINDOW_PRIVATE_H */