backends: Move HW cursor inhibitors to MetaBackend

We are aiming for a split of HW and SW cursor rendering management.
Given the HW plane is a limited resource and the amount of cursor
renderers may be >1 (due to tablets, even though we currently use an
always-software cursor renderer there), it would ideally be able to
switch between renderers.

Being MetaCursorRenderer not really a singleton, having cursor
inhibitor accounting here doesn't pan out. Make it MetaBackend API
so all cursor renderers get the same picture.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1403>
This commit is contained in:
Carlos Garnacho
2020-07-13 17:45:41 +02:00
committed by Marge Bot
parent e218b00747
commit d6f720497a
7 changed files with 67 additions and 88 deletions

View File

@ -872,6 +872,10 @@ should_have_hw_cursor (MetaCursorRenderer *renderer,
MetaCursorSprite *cursor_sprite,
GList *gpus)
{
MetaCursorRendererNative *cursor_renderer_native =
META_CURSOR_RENDERER_NATIVE (renderer);
MetaCursorRendererNativePrivate *priv =
meta_cursor_renderer_native_get_instance_private (cursor_renderer_native);
CoglTexture *texture;
MetaMonitorTransform transform;
float scale;
@ -880,7 +884,7 @@ should_have_hw_cursor (MetaCursorRenderer *renderer,
if (!cursor_sprite)
return FALSE;
if (meta_cursor_renderer_is_hw_cursors_inhibited (renderer))
if (meta_backend_is_hw_cursors_inhibited (priv->backend))
return FALSE;
for (l = gpus; l; l = l->next)