[mutter] renderer/native: Queue mode reset from new rebuild_views vfunc
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] renderer/native: Queue mode reset from new rebuild_views vfunc
- Date: Thu, 27 Jun 2019 17:37:44 +0000 (UTC)
commit 0756fd4636f06add7e4056e7a86aad4b3acbf2f9
Author: Jonas Ã…dahl <jadahl gmail com>
Date: Wed Jun 19 20:57:14 2019 +0200
renderer/native: Queue mode reset from new rebuild_views vfunc
Simplify the call site a bit and make the native renderer know it should
queue mode reset itself when views have been rebuilt. This is done
partly due to more things needing to be dealt with after views have been
rebuilt.
https://gitlab.gnome.org/GNOME/mutter/merge_requests/630
src/backends/meta-renderer.c | 8 ++++++++
src/backends/meta-renderer.h | 1 +
src/backends/native/meta-renderer-native.c | 17 ++++++++++++++++-
src/backends/native/meta-renderer-native.h | 2 --
src/backends/native/meta-stage-native.c | 1 -
5 files changed, 25 insertions(+), 4 deletions(-)
---
diff --git a/src/backends/meta-renderer.c b/src/backends/meta-renderer.c
index 28637437b..87ba9f9f0 100644
--- a/src/backends/meta-renderer.c
+++ b/src/backends/meta-renderer.c
@@ -90,6 +90,12 @@ meta_renderer_create_view (MetaRenderer *renderer,
*/
void
meta_renderer_rebuild_views (MetaRenderer *renderer)
+{
+ return META_RENDERER_GET_CLASS (renderer)->rebuild_views (renderer);
+}
+
+static void
+meta_renderer_real_rebuild_views (MetaRenderer *renderer)
{
MetaRendererPrivate *priv = meta_renderer_get_instance_private (renderer);
MetaBackend *backend = meta_get_backend ();
@@ -181,4 +187,6 @@ meta_renderer_class_init (MetaRendererClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = meta_renderer_finalize;
+
+ klass->rebuild_views = meta_renderer_real_rebuild_views;
}
diff --git a/src/backends/meta-renderer.h b/src/backends/meta-renderer.h
index dae52cb9a..478baee91 100644
--- a/src/backends/meta-renderer.h
+++ b/src/backends/meta-renderer.h
@@ -43,6 +43,7 @@ struct _MetaRendererClass
CoglRenderer * (* create_cogl_renderer) (MetaRenderer *renderer);
MetaRendererView * (* create_view) (MetaRenderer *renderer,
MetaLogicalMonitor *logical_monitor);
+ void (* rebuild_views) (MetaRenderer *renderer);
};
CoglRenderer * meta_renderer_create_cogl_renderer (MetaRenderer *renderer);
diff --git a/src/backends/native/meta-renderer-native.c b/src/backends/native/meta-renderer-native.c
index 51c716cfa..c455a1310 100644
--- a/src/backends/native/meta-renderer-native.c
+++ b/src/backends/native/meta-renderer-native.c
@@ -256,6 +256,9 @@ cogl_pixel_format_from_drm_format (uint32_t drm_format,
CoglPixelFormat *out_format,
CoglTextureComponents *out_components);
+static void
+meta_renderer_native_queue_modes_reset (MetaRendererNative *renderer_native);
+
static void
meta_renderer_native_gpu_data_free (MetaRendererNativeGpuData *renderer_gpu_data)
{
@@ -2743,7 +2746,7 @@ meta_renderer_native_supports_mirroring (MetaRendererNative *renderer_native)
return TRUE;
}
-void
+static void
meta_renderer_native_queue_modes_reset (MetaRendererNative *renderer_native)
{
MetaRenderer *renderer = META_RENDERER (renderer_native);
@@ -3110,6 +3113,17 @@ meta_renderer_native_create_view (MetaRenderer *renderer,
return view;
}
+static void
+meta_renderer_native_rebuild_views (MetaRenderer *renderer)
+{
+ MetaRendererClass *parent_renderer_class =
+ META_RENDERER_CLASS (meta_renderer_native_parent_class);
+
+ parent_renderer_class->rebuild_views (renderer);
+
+ meta_renderer_native_queue_modes_reset (META_RENDERER_NATIVE (renderer));
+}
+
void
meta_renderer_native_finish_frame (MetaRendererNative *renderer_native)
{
@@ -3934,6 +3948,7 @@ meta_renderer_native_class_init (MetaRendererNativeClass *klass)
renderer_class->create_cogl_renderer = meta_renderer_native_create_cogl_renderer;
renderer_class->create_view = meta_renderer_native_create_view;
+ renderer_class->rebuild_views = meta_renderer_native_rebuild_views;
obj_props[PROP_BACKEND] =
g_param_spec_object ("backend",
diff --git a/src/backends/native/meta-renderer-native.h b/src/backends/native/meta-renderer-native.h
index 5498ae7b3..650968c57 100644
--- a/src/backends/native/meta-renderer-native.h
+++ b/src/backends/native/meta-renderer-native.h
@@ -53,8 +53,6 @@ struct gbm_device * meta_gbm_device_from_gpu (MetaGpuKms *gpu_kms);
gboolean meta_renderer_native_supports_mirroring (MetaRendererNative *renderer_native);
-void meta_renderer_native_queue_modes_reset (MetaRendererNative *renderer_native);
-
void meta_renderer_native_finish_frame (MetaRendererNative *renderer_native);
int64_t meta_renderer_native_get_frame_counter (MetaRendererNative *renderer_native);
diff --git a/src/backends/native/meta-stage-native.c b/src/backends/native/meta-stage-native.c
index add3e81fd..9b9c45ef3 100644
--- a/src/backends/native/meta-stage-native.c
+++ b/src/backends/native/meta-stage-native.c
@@ -140,7 +140,6 @@ meta_stage_native_rebuild_views (MetaStageNative *stage_native)
ClutterActor *stage = meta_backend_get_stage (backend);
meta_renderer_rebuild_views (renderer);
- meta_renderer_native_queue_modes_reset (META_RENDERER_NATIVE (renderer));
clutter_stage_update_resource_scales (CLUTTER_STAGE (stage));
ensure_frame_callbacks (stage_native);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]