mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-08 09:40:10 +00:00
subsurface: Fully covered backgrounds don't need to be drawn
If the texture covers all of the black background (like when watching a 1080p stream fullscreen on a 1080p monitor) we don't need a compositor with single pixel support. Fixes offloading in Kwin.
This commit is contained in:
parent
a7b69ad9b5
commit
8c6e5ca131
@ -167,6 +167,12 @@ gdk_subsurface_attach (GdkSubsurface *subsurface,
|
||||
g_return_val_if_fail (sibling == NULL || GDK_IS_SUBSURFACE (sibling), FALSE);
|
||||
g_return_val_if_fail (sibling == NULL || sibling->parent == subsurface->parent, FALSE);
|
||||
|
||||
/* if the texture fully covers the background, ignore it */
|
||||
if (background &&
|
||||
gsk_rect_contains_rect (dest, background) &&
|
||||
gdk_memory_format_alpha (gdk_texture_get_format (texture)) == GDK_MEMORY_ALPHA_OPAQUE)
|
||||
background = NULL;
|
||||
|
||||
result = GDK_SUBSURFACE_GET_CLASS (subsurface)->attach (subsurface,
|
||||
texture,
|
||||
source,
|
||||
|
Loading…
Reference in New Issue
Block a user