Turn MetaShapedTexture into a ClutterContent implementation

Georges Basile Stavracas Neto requested to merge gbsneto/content into master

MetaShapedTexture is the class responsible for drawing the contents of a client window, applying transformations and masks and etcetera. Right now, it is implemented as a ClutterActor subclass that also happens to semi-implement MetaCullable.

This MR turns MetaShapedTexture into a GObject subclass that implements ClutterContent, and is attached to MetaSurfaceActor.

Depends on: !405 (merged)


Turns out, there is a theoretical performance gain from this MR. Before, each window would have 1 + 2 * number of surfaces actors, which would generally mean 3: a MetaWindowActor, a MetaSurfaceActor, and a MetaShapedTexture. With ClutterContent, each window has 1 + number of surfaces, which generally means 2: a MetaWindowActor, a MetaSurfaceActor. So at the very least, it reduces the number of window actors by 33%.

If you consider subsurfaces, e.g. a window with an open popover, well, the picture starts to change: before that would mean 5 actors, now that's 3. I guess you can see where this is going.

"That is not a lot", one might say. But it turns out to be significant due to an easily ignored detail: all these windows are children of MetaWindowGroup. And MetaWindowGroup traverses the actor tree 3 times on each repaint.

To Do:

  • Figure out broken input coordinates
  • Measure impact on painting times
Edited by Georges Basile Stavracas Neto

Merge request reports