[gtk/wip/chergert/macos-iosurface] macos: add comment about purging IOSurface
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/chergert/macos-iosurface] macos: add comment about purging IOSurface
- Date: Sat, 12 Feb 2022 10:32:39 +0000 (UTC)
commit 0fbce5260e6f10e724ae01920a568dd950a63b7b
Author: Christian Hergert <christian hergert me>
Date: Sat Feb 12 02:32:20 2022 -0800
macos: add comment about purging IOSurface
gdk/macos/gdkmacosbuffer.c | 7 +++++++
1 file changed, 7 insertions(+)
---
diff --git a/gdk/macos/gdkmacosbuffer.c b/gdk/macos/gdkmacosbuffer.c
index 2982d39594..804572d313 100644
--- a/gdk/macos/gdkmacosbuffer.c
+++ b/gdk/macos/gdkmacosbuffer.c
@@ -52,6 +52,13 @@ gdk_macos_buffer_dispose (GObject *object)
g_critical ("Attempt to dispose %s while lock is held",
G_OBJECT_TYPE_NAME (self));
+ /* We could potentially force the unload of our surface here with
+ * IOSurfaceSetPurgeable (self->surface, kIOSurfacePurgeableEmpty, NULL)
+ * but that would cause it to empty when the layers may still be attached
+ * to it. Better to just let it get GC'd by the system after they have
+ * moved on to a new buffer.
+ */
+
g_clear_pointer (&self->surface, CFRelease);
g_clear_pointer (&self->damage, cairo_region_destroy);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]