cogl: Introduce and use cogl_context_is_hardware_accelerated

We delegate the answer through CoglDriverVtable::is_hardware_accelerated
since this is properly a property of the renderer, and not something the
cogl core should know about. The answer given for the nop driver is
admittedly arbitrary, yes it's infinitely fast but no there's not any
"hardware" making it so.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1194
This commit is contained in:
Adam Jackson
2020-06-17 18:42:53 -04:00
parent e216d9c6ad
commit d133f94f8f
9 changed files with 57 additions and 16 deletions

View File

@ -194,23 +194,8 @@ meta_renderer_is_hardware_accelerated (MetaRenderer *renderer)
ClutterBackend *clutter_backend = meta_backend_get_clutter_backend (backend);
CoglContext *cogl_context =
clutter_backend_get_cogl_context (clutter_backend);
CoglGpuInfo *info = &cogl_context->gpu;
switch (info->architecture)
{
case COGL_GPU_INFO_ARCHITECTURE_UNKNOWN:
case COGL_GPU_INFO_ARCHITECTURE_SANDYBRIDGE:
case COGL_GPU_INFO_ARCHITECTURE_SGX:
case COGL_GPU_INFO_ARCHITECTURE_MALI:
return TRUE;
case COGL_GPU_INFO_ARCHITECTURE_LLVMPIPE:
case COGL_GPU_INFO_ARCHITECTURE_SOFTPIPE:
case COGL_GPU_INFO_ARCHITECTURE_SWRAST:
return FALSE;
}
g_assert_not_reached ();
return FALSE;
return cogl_context_is_hardware_accelerated (cogl_context);
}
static void