1
0
Fork 0
Commit graph

15 commits

Author SHA1 Message Date
Jonas Ådahl
dcd0f4322a shaped-texture: Add API to check opaqueness
It is opaque if the texture has no alpha channel, or if the opaque
region covers the whole content.

Internally uses a function that checks whether there is an alpha
channel. This API will be exposed at a later time as well.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/734
2019-10-16 13:05:40 +02:00
Georges Basile Stavracas Neto
6b35a4901e shaped-texture: Move private function to private header
meta_shaped_texture_update_area() is a private function that
is exposed in the public headers. It is not used anywhere
outside Mutter, and should really be in the private header.

Move it to the private header.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/409
2019-08-23 13:23:07 +00:00
Georges Basile Stavracas Neto
4c1fde9deb shaped-texture: Move MetaCullable helpers to MetaSurfaceActor
Now that MetaShapedTexture is not a ClutterActor anymore, it does
not make sense to make it a MetaCullable semi-implementation. This
is, naturally, a responsibility of MetaSurfaceActor, since now
MetaShapedTexture is a ClutterContent and as such, it only cares
about what to draw.

Move the MetaCullable implementation of MetaShapedTexture to
MetaSurfaceActor.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/409
2019-08-23 13:23:07 +00:00
Georges Basile Stavracas Neto
75cffd0ec4 shaped-texture: Implement ClutterContent
MetaWindowActor is the compositor-side representative of a
MetaWindow. Specifically it represents the geometry of the
window under Clutter scene graph. MetaWindowActors are backed
by MetaSurfaceActors, that represent the windowing system's
surfaces themselves. Naturally, these surfaces have textures
with the pixel content of the clients associated with them.
These textures are represented by MetaShapedTexture.

MetaShapedTextures are currently implemented as ClutterActor
subclasses that override the paint function to paint the
textures it holds.

Conceptually, however, Clutter has an abstraction layer for
contents of actors: ClutterContent. Which MetaShapedTexture
fits nicely, in fact.

Make MetaShapedTexture a ClutterContent implementation. This
forces a few changes in the stack:

 * MetaShapedTexture now handles buffer scale.

 * We now paint into ClutterPaintNode instead of the direct
   framebuffer.

 * Various pieces of Wayland code now use MetaSurfaceActor
   instead of MetaShapedTexture.

 * MetaSurfaceActorWayland doesn't override size negotiation
   vfuncs anymore

https://gitlab.gnome.org/GNOME/mutter/merge_requests/409
2019-08-23 13:23:07 +00:00
Robert Mader
edfe5cc3b7 shaped-texture: Add support for viewports
This implements the viewporter protocol which offers a cropping and scaling
capabilities to wayland clients.

There are several use cases for this, for example video players and games,
both as a convenience function and as potential performance optimization when
paired with hardware overlays etc.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/323
2019-02-06 12:24:02 +00:00
Robert Mader
1467b6b02a shaped-texture: Add support for texture transform
This adds the necessary bits to support Wayland buffer transforms.
The main part here is to properly setup the Cogl pipeline
and to recalculate the size of the painted area accordingly,
so culling etc. still works.

The choosen approach additionally lays groundwork for Wayland
wp_viewporter support.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/322
2018-12-03 18:57:59 +01:00
Jonas Ådahl
2f4a68c8c3 Clean up include macros mess
The order and way include macros were structured was chaotic, with no
real common thread between files. Try to tidy up the mess with some
common scheme, to make things look less messy.
2018-11-06 17:17:36 +01:00
Jonas Ådahl
b5a0068091 shaped-texture: Use ints for sizes
They were int before entering MetaShapedTexture, used as ints in the
cairo regions and rectangles, so there is no reason they should be
stored as unsigned.

Related: https://gitlab.gnome.org/GNOME/mutter/issues/300
2018-10-04 15:06:10 +02:00
Jonas Ådahl
7c31fb2450 MetaShapedTexture: Add support for setting a custom CoglSnippet
To support special types of buffer types, add support for setting a
CoglSnippet on the shaped texture which will then be added to the
pipeline.

https://bugzilla.gnome.org/show_bug.cgi?id=773629
2016-11-18 00:00:10 +08:00
Jonas Ådahl
41c96921d6 wayland: Add support for EGL_WAYLAND_Y_INVERTED_WL
Add support for inverted Y Wayland buffers. OpenGL textures are by
default inverted, so adding support for EGL_WAYLAND_Y_INVERTED_WL
effectively means adding support for non-inverted, which makes the
MetaShapedTexture apply a transformation when drawing only when querying
EGL_WAYLAND_Y_INVERTED_WL resulted in the response "EGL_FALSE".

https://bugzilla.gnome.org/show_bug.cgi?id=773629
2016-11-18 00:00:10 +08:00
Jasper St. Pierre
190357c561 surface-actor-x11: Unredirect ARGB32 windows with full opaque regions
We can detect that these windows are already fully opaque, so allow them
to unredirect. Allows unredirecting Totem during video playback, giving
a significant speed boost.
2016-03-21 13:44:44 -07:00
Jasper St. Pierre
4c6866741d surface-actor-x11: Make sure to set a size when unredirected
When we're unredirected, we don't have a pixmap, and thus our allocation
becomes 0x0. So when events come in, they pass right through our actor,
going to the one underneath in the stack.

Fix this by having a fallback size on the shaped texture actor when
we're unredirected, causing it to always have a valid allocation.

This fixes clicking on stuff in sloppy / mouse mode focus.
2015-06-23 16:30:29 -07:00
Jasper St. Pierre
505eabb78c surface-actor: Remove unused APIs 2014-07-31 17:49:13 +02:00
Jasper St. Pierre
8daefd92df shaped-texture: Move unobscured_region processing here
We want to remove a bunch of auxilliary duties from the MetaWindowActor
and MetaSurfaceActor, including some details of how culling is done.
Move the unobscured region culling code to the MetaShapedTexture, which
helps the actor become "more independent".

https://bugzilla.gnome.org/show_bug.cgi?id=720631
2014-02-05 15:18:12 -05:00
Jasper St. Pierre
d3c2607e53 window-actor: Move all buffer management and damage correction here
We want ShapedTexture to be a dumb actor that knows how to
pick/paint fairly easily, without any "platform knowledge", so to say...
2014-02-05 15:16:38 -05:00