[gtk/wip/chergert/gdk-macos-gl-renderer] macos: setup clip for flushBuffer
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/chergert/gdk-macos-gl-renderer] macos: setup clip for flushBuffer
- Date: Tue, 27 Oct 2020 23:07:28 +0000 (UTC)
commit de0239c04818960dab31d418d023cea691ab9289
Author: Christian Hergert <chergert redhat com>
Date: Tue Oct 27 15:55:43 2020 -0700
macos: setup clip for flushBuffer
We want to try to reduce how much of the screen is damaged when
swapping buffers, and this wraps (through NSOpenGLContext) to the
kCGLCPSwapRectangle.
gdk/macos/gdkmacosglcontext.c | 6 ++++++
1 file changed, 6 insertions(+)
---
diff --git a/gdk/macos/gdkmacosglcontext.c b/gdk/macos/gdkmacosglcontext.c
index 15c36b6c26..73dca20fe1 100644
--- a/gdk/macos/gdkmacosglcontext.c
+++ b/gdk/macos/gdkmacosglcontext.c
@@ -196,6 +196,7 @@ gdk_macos_gl_context_end_frame (GdkDrawContext *context,
GdkMacosGLContext *self = GDK_MACOS_GL_CONTEXT (context);
GdkMacosSurface *surface;
NSView *nsview;
+ cairo_rectangle_int_t extents;
g_assert (GDK_IS_MACOS_GL_CONTEXT (self));
g_assert (self->gl_context != nil);
@@ -207,8 +208,13 @@ gdk_macos_gl_context_end_frame (GdkDrawContext *context,
GDK_DRAW_CONTEXT_CLASS (gdk_macos_gl_context_parent_class)->end_frame (context, painted);
+ G_STATIC_ASSERT (sizeof (GLint) == sizeof (int));
+ cairo_region_get_extents (painted, &extents);
+ [self->gl_context
+ setValues:(GLint *)&extents
+ forParameter:NSOpenGLCPSwapRectangle];
[self->gl_context flushBuffer];
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]