[gtk/wip/chergert/macos-iosurface] macos: reduce transaction to swap period
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/chergert/macos-iosurface] macos: reduce transaction to swap period
- Date: Sat, 12 Feb 2022 12:10:44 +0000 (UTC)
commit 8ab50f6ce2f00a86dd46e1e8a751f2b63843a78a
Author: Christian Hergert <christian hergert me>
Date: Sat Feb 12 04:10:33 2022 -0800
macos: reduce transaction to swap period
We only need the transaction while we're swapping contents.
gdk/macos/gdkmacosglcontext.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
---
diff --git a/gdk/macos/gdkmacosglcontext.c b/gdk/macos/gdkmacosglcontext.c
index 4d455aee05..6e0c794460 100644
--- a/gdk/macos/gdkmacosglcontext.c
+++ b/gdk/macos/gdkmacosglcontext.c
@@ -456,12 +456,6 @@ gdk_macos_gl_context_begin_frame (GdkDrawContext *context,
_gdk_macos_buffer_set_flipped (buffer, TRUE);
- /* Begin a Core Animation transaction so that all changes we
- * make within the window are seen atomically.
- */
- [CATransaction begin];
- [CATransaction setDisableActions:YES];
-
/* Create our render target and bind it */
gdk_gl_context_make_current (GDK_GL_CONTEXT (self));
gdk_macos_gl_context_allocate (self);
@@ -505,8 +499,12 @@ gdk_macos_gl_context_end_frame (GdkDrawContext *context,
glFlush ();
+ /* Begin a Core Animation transaction so that all changes we
+ * make within the window are seen atomically.
+ */
+ [CATransaction begin];
+ [CATransaction setDisableActions:YES];
_gdk_macos_surface_swap_buffers (GDK_MACOS_SURFACE (surface), painted);
-
[CATransaction commit];
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]