wayland/single-pixel: Add API to check if buffer is opaque black
Which is the typical background color we also use for fullscreen padding. This will allow us to apply optimizations. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3177>
This commit is contained in:
parent
adc776d0d7
commit
50f8f1e8b3
@ -169,6 +169,15 @@ meta_wayland_single_pixel_buffer_free (MetaWaylandSinglePixelBuffer *single_pixe
|
|||||||
g_free (single_pixel_buffer);
|
g_free (single_pixel_buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
meta_wayland_single_pixel_buffer_is_opaque_black (MetaWaylandSinglePixelBuffer *single_pixel_buffer)
|
||||||
|
{
|
||||||
|
return (single_pixel_buffer->a == UINT32_MAX &&
|
||||||
|
single_pixel_buffer->r == 0x0 &&
|
||||||
|
single_pixel_buffer->g == 0x0 &&
|
||||||
|
single_pixel_buffer->b == 0x0);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
meta_wayland_init_single_pixel_buffer_manager (MetaWaylandCompositor *compositor)
|
meta_wayland_init_single_pixel_buffer_manager (MetaWaylandCompositor *compositor)
|
||||||
{
|
{
|
||||||
|
@ -35,3 +35,5 @@ MetaWaylandSinglePixelBuffer * meta_wayland_single_pixel_buffer_from_buffer (Met
|
|||||||
void meta_wayland_init_single_pixel_buffer_manager (MetaWaylandCompositor *compositor);
|
void meta_wayland_init_single_pixel_buffer_manager (MetaWaylandCompositor *compositor);
|
||||||
|
|
||||||
void meta_wayland_single_pixel_buffer_free (MetaWaylandSinglePixelBuffer *single_pixel_buffer);
|
void meta_wayland_single_pixel_buffer_free (MetaWaylandSinglePixelBuffer *single_pixel_buffer);
|
||||||
|
|
||||||
|
gboolean meta_wayland_single_pixel_buffer_is_opaque_black (MetaWaylandSinglePixelBuffer *single_pixel_buffer);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user