mutter/src/compositor
Jonas Ådahl 49c8d42317 clutter: Introduce paint contexts
When painting, actors rely on semi global state tracked by the state to
get various things needed for painting, such as the current draw
framebuffer. Having state hidden in such ways can be very deceiving as
it's hard to follow changes spread out, and adding more and more state
that should be tracked during a paint gets annoying as they will not
change in isolation but one by one in their own places. To do this
better, introduce a paint context that is passed along in paint calls
that contains the necessary state needed during painting.

The paint context implements a framebuffer stack just as Cogl works,
which is currently needed for offscreen rendering used by clutter.

The same context is passed around for paint nodes, contents and effects
as well.

In this commit, the context is only introduced, but not used. It aims to
replace the Cogl framebuffer stack, and will allow actors to know what
view it is currently painted on.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/935
2019-12-03 19:02:14 +00:00
..
plugins plugins/default: Handle skipped animations 2019-11-08 22:49:31 +01:00
clutter-utils.c Replace ClutterVertex by graphene_point3d_t 2019-10-16 11:38:13 +00:00
clutter-utils.h Replace ClutterVertex by graphene_point3d_t 2019-10-16 11:38:13 +00:00
cogl-utils.c cogl: Remove CoglError wrapper 2019-06-20 18:25:04 +02:00
cogl-utils.h Use a consistent style for enum braces 2019-02-28 09:31:01 +01:00
compositor-private.h compositor: Move out X11 compositing code into sub type 2019-08-19 08:44:58 +00:00
compositor.c compositor: Guard against untimely calls 2019-11-11 13:09:20 +00:00
meta-background-actor-private.h Clean up include macros mess 2018-11-06 17:17:36 +01:00
meta-background-actor.c clutter: Introduce paint contexts 2019-12-03 19:02:14 +00:00
meta-background-group.c meta: Make MetaBackgroundGroup derivable 2019-06-24 13:49:31 +00:00
meta-background-image.c cogl: Remove CoglError wrapper 2019-06-20 18:25:04 +02:00
meta-background-private.h Clean up include macros mess 2018-11-06 17:17:36 +01:00
meta-background.c background: set_file accepts NULL files 2019-11-22 22:13:35 +00:00
meta-compositor-server.c compositor: Let MetaDisplay choose the correct compositor type 2019-08-19 08:44:58 +00:00
meta-compositor-server.h compositor: Let MetaDisplay choose the correct compositor type 2019-08-19 08:44:58 +00:00
meta-compositor-x11.c window-actor: Move shapes, shadows and unredirection to X11 sub types 2019-10-16 13:16:55 +02:00
meta-compositor-x11.h compositor: Let MetaDisplay choose the correct compositor type 2019-08-19 08:44:58 +00:00
meta-cullable.c Clean up include macros mess 2018-11-06 17:17:36 +01:00
meta-cullable.h Use G_DECLARE_DERIVABLE/FINAL_TYPE on some types 2018-12-21 19:48:50 +00:00
meta-dnd-actor-private.h Use G_DECLARE_DERIVABLE/FINAL_TYPE on some types 2018-12-21 19:48:50 +00:00
meta-dnd-actor.c Replace ClutterPoint by graphene_point_t 2019-10-16 11:38:14 +00:00
meta-dnd.c cleanup: Use g_clear_signal_handler() where possible 2019-11-21 15:02:27 +00:00
meta-feedback-actor-private.h wayland/feedback-actor: Use float for position and anchor 2019-08-26 11:57:49 +00:00
meta-feedback-actor.c Replace ClutterPoint by graphene_point_t 2019-10-16 11:38:14 +00:00
meta-module.c cleanup: Don't use G_TYPE_INSTANCE_GET_PRIVATE() 2019-07-18 11:01:09 +02:00
meta-module.h Changed obsolete FSF postal address into generic URL. 2014-01-12 08:42:06 +07:00
meta-plugin-manager.c plugin-manager: Kill window effects on destroy 2019-11-08 22:18:09 +00:00
meta-plugin-manager.h compositor: Add "locate_pointer" vmethod 2019-06-05 09:34:39 +00:00
meta-plugin.c compositor: Make type derivable 2019-08-19 08:44:58 +00:00
meta-shadow-factory.c shadow-factory: Optimize shadows entirely if clip region is empty 2019-07-30 23:08:30 +02:00
meta-shaped-texture-private.h Replace ClutterRect by graphene_rect_t 2019-10-16 11:38:14 +00:00
meta-shaped-texture.c clutter: Introduce paint contexts 2019-12-03 19:02:14 +00:00
meta-surface-actor-wayland.c clutter: Introduce paint contexts 2019-12-03 19:02:14 +00:00
meta-surface-actor-wayland.h Use G_DECLARE_DERIVABLE/FINAL_TYPE on some types 2018-12-21 19:48:50 +00:00
meta-surface-actor-x11.c window-actor: Move shapes, shadows and unredirection to X11 sub types 2019-10-16 13:16:55 +02:00
meta-surface-actor-x11.h window-actor: Move shapes, shadows and unredirection to X11 sub types 2019-10-16 13:16:55 +02:00
meta-surface-actor.c clutter: Introduce paint contexts 2019-12-03 19:02:14 +00:00
meta-surface-actor.h Replace ClutterRect by graphene_rect_t 2019-10-16 11:38:14 +00:00
meta-sync-ring.c Clean up include macros mess 2018-11-06 17:17:36 +01:00
meta-sync-ring.h Clean up include macros mess 2018-11-06 17:17:36 +01:00
meta-texture-tower.c cogl: Remove CoglError wrapper 2019-06-20 18:25:04 +02:00
meta-texture-tower.h Clean up include macros mess 2018-11-06 17:17:36 +01:00
meta-window-actor-private.h window-actor: Move shapes, shadows and unredirection to X11 sub types 2019-10-16 13:16:55 +02:00
meta-window-actor-wayland.c window-actor: Move shapes, shadows and unredirection to X11 sub types 2019-10-16 13:16:55 +02:00
meta-window-actor-wayland.h wayland: Implement subsurface.place_below() for parents 2019-08-27 11:31:00 +03:00
meta-window-actor-x11.c clutter: Introduce paint contexts 2019-12-03 19:02:14 +00:00
meta-window-actor-x11.h window-actor: Move shapes, shadows and unredirection to X11 sub types 2019-10-16 13:16:55 +02:00
meta-window-actor.c clutter: Introduce paint contexts 2019-12-03 19:02:14 +00:00
meta-window-group-private.h Clean up include macros mess 2018-11-06 17:17:36 +01:00
meta-window-group.c clutter: Introduce paint contexts 2019-12-03 19:02:14 +00:00
meta-window-shape.c Clean up include macros mess 2018-11-06 17:17:36 +01:00
README Document window and surface actors 2019-01-04 09:32:58 -02:00
region-utils.c Replace ClutterRect by graphene_rect_t 2019-10-16 11:38:14 +00:00
region-utils.h Replace ClutterRect by graphene_rect_t 2019-10-16 11:38:14 +00:00

Intro
=====

In general, the compositor splits the window from the contents of
the window from the shape of the window. In other words, a window
has contents, and the contents of the window have a shape. This is
represented by the actor hierarchy:

 +--------------------------------------+
 | MetaWindowActor                      |
 | +----------------------------------+ |
 | | MetaSurfaceActor                 | |
 | | +------------------------------+ | |
 | | | MetaShapedTexture            | | |
 | | |                              | | |
 | | |                              | | |
 | | |                              | | |
 | | |                              | | |
 | | +------------------------------+ | |
 | +----------------------------------+ |
 +--------------------------------------+

Surfaces may also contain subsurfaces. The MetaWindowActor and
MetaSurfaceActor subclasses that will be created depend on the client
type, and the display server type.

## Subsurfaces

Additionally, there is also the case of subsurfaces: surfaces that
are child of other surfaces. That is also represented in the actor
hierarchy by having one or many MetaSurfaceActors (the subsurfaces)
added as children of a parent MetaSurfaceActor. There are no limits
to how many subsurfaces a surface may have. With subsurfaces, the
actor hierarchy looks like this:

 MetaWindowActor
  ↳ MetaSurfaceActor (surface)
     ↳ MetaShapedTexture
     ↳ MetaSurfaceActor (subsurface)
        ↳ MetaShapedTexture
        ↳ MetaSurfaceActor (sub-subsurface)
           ↳ MetaShapedTexture
     ↳ MetaSurfaceActor (subsurface)
        ↳ MetaShapedTexture

In this example, the main surface has 2 subsurfaces. One of these
subsurfaces contains a subsurface as well.

All MetaWindowActors contain at least one MetaSurfaceActor, and all
MetaSurfaceActors contain a MetaShapedTexture.

## Client and compositor

MetaWindowActor and its subclasses represent the client window's
type. A X11 client will have a MetaWindowActorX11 representing it,
and a Wayland client will have a MetaWindowActorWayland.

On the compositor side, the surface where the contents of the window
are drawn into are represented by MetaSurfaceActor subclasses. On a
Wayland session, windows are backed by a MetaSurfaceActorWayland
surface, whereas on X11 sessions, by MetaSurfaceActorX11.

XWayland windows are X11 client windows (MetaWindowActorX11) backed
by Wayland surfaces (MetaWindowActorWayland).


Env Vars
========

MUTTER_DISABLE_MIPMAPS - set to disable use of mipmaped windows.