[gtk/wip/chergert/glproto] do post-buffer swap cleanup
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/chergert/glproto] do post-buffer swap cleanup
- Date: Mon, 8 Feb 2021 22:52:14 +0000 (UTC)
commit d7cffdceb9d8d5729c70dedda1d9ab6e07933e43
Author: Christian Hergert <chergert redhat com>
Date: Mon Feb 8 14:29:48 2021 -0800
do post-buffer swap cleanup
gsk/next/gskgldriver.c | 6 +++---
gsk/next/gskgldriverprivate.h | 2 +-
gsk/next/gskglrenderer.c | 8 ++++----
3 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/gsk/next/gskgldriver.c b/gsk/next/gskgldriver.c
index 851e659cb9..eee2c85c30 100644
--- a/gsk/next/gskgldriver.c
+++ b/gsk/next/gskgldriver.c
@@ -567,16 +567,16 @@ gsk_next_driver_end_frame (GskNextDriver *self)
}
/**
- * gsk_next_driver_before_frame:
+ * gsk_next_driver_after_frame:
* @self: a #GskNextDriver
*
* This function does post-frame cleanup operations.
*
* To reduce the chances of blocking on the driver it is performed
- * at the beginning of the following frame.
+ * after the frame has swapped buffers.
*/
void
-gsk_next_driver_before_frame (GskNextDriver *self)
+gsk_next_driver_after_frame (GskNextDriver *self)
{
g_return_if_fail (GSK_IS_NEXT_DRIVER (self));
g_return_if_fail (self->in_frame == FALSE);
diff --git a/gsk/next/gskgldriverprivate.h b/gsk/next/gskgldriverprivate.h
index 644b9ee178..f09b42e69f 100644
--- a/gsk/next/gskgldriverprivate.h
+++ b/gsk/next/gskgldriverprivate.h
@@ -139,7 +139,7 @@ guint gsk_next_driver_release_render_target (GskNextDriver *
void gsk_next_driver_begin_frame (GskNextDriver *self,
GskGLCommandQueue *command_queue);
void gsk_next_driver_end_frame (GskNextDriver *self);
-void gsk_next_driver_before_frame (GskNextDriver *self);
+void gsk_next_driver_after_frame (GskNextDriver *self);
GdkTexture *gsk_next_driver_create_gdk_texture (GskNextDriver *self,
guint texture_id);
void gsk_next_driver_cache_texture (GskNextDriver *self,
diff --git a/gsk/next/gskglrenderer.c b/gsk/next/gskglrenderer.c
index ee1dd75af2..6d9fa3fc13 100644
--- a/gsk/next/gskglrenderer.c
+++ b/gsk/next/gskglrenderer.c
@@ -195,8 +195,6 @@ gsk_next_renderer_render (GskRenderer *renderer,
g_assert (GSK_IS_NEXT_RENDERER (renderer));
g_assert (root != NULL);
- gsk_next_driver_before_frame (self->driver);
-
surface = gdk_draw_context_get_surface (GDK_DRAW_CONTEXT (self->context));
scale_factor = gdk_surface_get_scale_factor (surface);
@@ -224,6 +222,8 @@ gsk_next_renderer_render (GskRenderer *renderer,
gdk_gl_context_make_current (self->context);
gdk_draw_context_end_frame (GDK_DRAW_CONTEXT (self->context));
+ gsk_next_driver_after_frame (self->driver);
+
cairo_region_destroy (render_region);
}
@@ -246,8 +246,6 @@ gsk_next_renderer_render_texture (GskRenderer *renderer,
width = ceilf (viewport->size.width);
height = ceilf (viewport->size.height);
- gsk_next_driver_before_frame (self->driver);
-
if (gsk_next_driver_create_render_target (self->driver,
width, height,
GL_NEAREST, GL_NEAREST,
@@ -264,6 +262,8 @@ gsk_next_renderer_render_texture (GskRenderer *renderer,
texture = gsk_next_driver_create_gdk_texture (self->driver, texture_id);
gsk_next_driver_end_frame (self->driver);
gsk_gl_render_job_free (job);
+
+ gsk_next_driver_after_frame (self->driver);
}
return g_steal_pointer (&texture);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]