[gtk/master.win32] GdkGLContext: Drop gdk_gl_context_has_[framebuffer_blit|frame_terminator]()
- From: Chun-wei Fan <fanchunwei src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/master.win32] GdkGLContext: Drop gdk_gl_context_has_[framebuffer_blit|frame_terminator]()
- Date: Wed, 5 Aug 2020 10:59:33 +0000 (UTC)
commit edc1c2823616c0cb21e64820fb009b2c028b811d
Author: Chun-wei Fan <fanchunwei src gnome org>
Date: Wed Aug 5 18:56:57 2020 +0800
GdkGLContext: Drop gdk_gl_context_has_[framebuffer_blit|frame_terminator]()
gdk_gl_context_has_framebuffer_blit() and gdk_gl_context_has_frame_terminator()
were only used by by GDK/Win32, and they do not provide performance advantages
in GTK master, so clean up the code a bit by dropping them.
gdk/gdkglcontext.c | 36 -------------------------
gdk/gdkglcontextprivate.h | 2 --
gdk/win32/gdkglcontext-win32.c | 60 ++----------------------------------------
3 files changed, 2 insertions(+), 96 deletions(-)
---
diff --git a/gdk/gdkglcontext.c b/gdk/gdkglcontext.c
index a7284b27c6..4dc06cc24c 100644
--- a/gdk/gdkglcontext.c
+++ b/gdk/gdkglcontext.c
@@ -107,8 +107,6 @@ typedef struct {
guint realized : 1;
guint use_texture_rectangle : 1;
- guint has_gl_framebuffer_blit : 1;
- guint has_frame_terminator : 1;
guint has_khr_debug : 1;
guint use_khr_debug : 1;
guint has_unpack_subimage : 1;
@@ -427,22 +425,6 @@ gdk_gl_context_use_texture_rectangle (GdkGLContext *context)
return priv->use_texture_rectangle;
}
-gboolean
-gdk_gl_context_has_framebuffer_blit (GdkGLContext *context)
-{
- GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
-
- return priv->has_gl_framebuffer_blit;
-}
-
-gboolean
-gdk_gl_context_has_frame_terminator (GdkGLContext *context)
-{
- GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
-
- return priv->has_frame_terminator;
-}
-
void
gdk_gl_context_push_debug_group (GdkGLContext *context,
const char *message)
@@ -997,18 +979,6 @@ gdk_gl_context_check_extensions (GdkGLContext *context)
has_npot = priv->gl_version >= 20;
has_texture_rectangle = FALSE;
- /* This should check for GL_NV_framebuffer_blit as well - see extension at:
- *
- * https://www.khronos.org/registry/gles/extensions/NV/NV_framebuffer_blit.txt
- *
- * for ANGLE, we can enable bit blitting if we have the
- * GL_ANGLE_framebuffer_blit extension
- */
- priv->has_gl_framebuffer_blit = epoxy_has_gl_extension ("GL_ANGLE_framebuffer_blit");
-
- /* No OES version */
- priv->has_frame_terminator = FALSE;
-
priv->has_unpack_subimage = epoxy_has_gl_extension ("GL_EXT_unpack_subimage");
priv->has_khr_debug = epoxy_has_gl_extension ("GL_KHR_debug");
}
@@ -1017,8 +987,6 @@ gdk_gl_context_check_extensions (GdkGLContext *context)
has_npot = priv->gl_version >= 20 || epoxy_has_gl_extension ("GL_ARB_texture_non_power_of_two");
has_texture_rectangle = priv->gl_version >= 31 || epoxy_has_gl_extension ("GL_ARB_texture_rectangle");
- priv->has_gl_framebuffer_blit = priv->gl_version >= 30 || epoxy_has_gl_extension
("GL_EXT_framebuffer_blit");
- priv->has_frame_terminator = epoxy_has_gl_extension ("GL_GREMEDY_frame_terminator");
priv->has_unpack_subimage = TRUE;
priv->has_khr_debug = epoxy_has_gl_extension ("GL_KHR_debug");
@@ -1052,8 +1020,6 @@ gdk_gl_context_check_extensions (GdkGLContext *context)
"* Extensions checked:\n"
" - GL_ARB_texture_non_power_of_two: %s\n"
" - GL_ARB_texture_rectangle: %s\n"
- " - GL_EXT_framebuffer_blit: %s\n"
- " - GL_GREMEDY_frame_terminator: %s\n"
" - GL_KHR_debug: %s\n"
"* Using texture rectangle: %s",
priv->use_es ? "OpenGL ES" : "OpenGL",
@@ -1062,8 +1028,6 @@ gdk_gl_context_check_extensions (GdkGLContext *context)
glGetString (GL_SHADING_LANGUAGE_VERSION),
has_npot ? "yes" : "no",
has_texture_rectangle ? "yes" : "no",
- priv->has_gl_framebuffer_blit ? "yes" : "no",
- priv->has_frame_terminator ? "yes" : "no",
priv->has_khr_debug ? "yes" : "no",
priv->use_texture_rectangle ? "yes" : "no"));
diff --git a/gdk/gdkglcontextprivate.h b/gdk/gdkglcontextprivate.h
index bf2dbfa5ff..67fe1a825d 100644
--- a/gdk/gdkglcontextprivate.h
+++ b/gdk/gdkglcontextprivate.h
@@ -87,8 +87,6 @@ void gdk_gl_context_upload_texture (GdkGLContext
guint texture_target);
GdkGLContextPaintData * gdk_gl_context_get_paint_data (GdkGLContext *context);
gboolean gdk_gl_context_use_texture_rectangle (GdkGLContext *context);
-gboolean gdk_gl_context_has_framebuffer_blit (GdkGLContext *context);
-gboolean gdk_gl_context_has_frame_terminator (GdkGLContext *context);
gboolean gdk_gl_context_has_unpack_subimage (GdkGLContext *context);
void gdk_gl_context_push_debug_group (GdkGLContext *context,
const char *message);
diff --git a/gdk/win32/gdkglcontext-win32.c b/gdk/win32/gdkglcontext-win32.c
index ed2165d3e2..625b13ff74 100644
--- a/gdk/win32/gdkglcontext-win32.c
+++ b/gdk/win32/gdkglcontext-win32.c
@@ -104,25 +104,6 @@ _gdk_win32_gl_context_dispose (GObject *gobject)
G_OBJECT_CLASS (gdk_win32_gl_context_parent_class)->dispose (gobject);
}
-static void
-gdk_gl_blit_region (GdkSurface *surface, cairo_region_t *region)
-{
- int n_rects, i;
- int scale = gdk_surface_get_scale_factor (surface);
- int wh = gdk_surface_get_height (surface);
- cairo_rectangle_int_t rect;
-
- n_rects = cairo_region_num_rectangles (region);
- for (i = 0; i < n_rects; i++)
- {
- cairo_region_get_rectangle (region, i, &rect);
- glScissor (rect.x * scale, (wh - rect.y - rect.height) * scale, rect.width * scale, rect.height *
scale);
- glBlitFramebuffer (rect.x * scale, (wh - rect.y - rect.height) * scale, (rect.x + rect.width) * scale,
(wh - rect.y) * scale,
- rect.x * scale, (wh - rect.y - rect.height) * scale, (rect.x + rect.width) * scale,
(wh - rect.y) * scale,
- GL_COLOR_BUFFER_BIT, GL_NEAREST);
- }
-}
-
#ifdef GDK_WIN32_ENABLE_EGL
static gboolean
_get_is_egl_force_redraw (GdkSurface *surface)
@@ -188,24 +169,7 @@ gdk_win32_gl_context_end_frame (GdkDrawContext *draw_context,
}
}
- if (cairo_region_contains_rectangle (painted, &whole_window) == CAIRO_REGION_OVERLAP_IN)
- SwapBuffers (context_win32->gl_hdc);
- else if (gdk_gl_context_has_framebuffer_blit (context))
- {
- glDrawBuffer(GL_FRONT);
- glReadBuffer(GL_BACK);
- gdk_gl_blit_region (surface, painted);
- glDrawBuffer(GL_BACK);
- glFlush();
-
- if (gdk_gl_context_has_frame_terminator (context))
- glFrameTerminatorGREMEDY ();
- }
- else
- {
- g_warning ("Need to swap whole buffer even thouigh not everything was redrawn. Expect artifacts.");
- SwapBuffers (context_win32->gl_hdc);
- }
+ SwapBuffers (context_win32->gl_hdc);
}
#ifdef GDK_WIN32_ENABLE_EGL
else
@@ -224,15 +188,7 @@ gdk_win32_gl_context_end_frame (GdkDrawContext *draw_context,
_reset_egl_force_redraw (surface);
}
- if (cairo_region_contains_rectangle (painted, &whole_window) == CAIRO_REGION_OVERLAP_IN ||
force_egl_redraw_all)
- eglSwapBuffers (display->egl_disp, egl_surface);
- else if (gdk_gl_context_has_framebuffer_blit (context))
- gdk_gl_blit_region (surface, painted);
- else
- {
- g_warning ("Need to swap whole buffer even thouigh not everything was redrawn. Expect artifacts.");
- eglSwapBuffers (display->egl_disp, egl_surface);
- }
+ eglSwapBuffers (display->egl_disp, egl_surface);
}
#endif
}
@@ -249,18 +205,6 @@ gdk_win32_gl_context_begin_frame (GdkDrawContext *draw_context,
gdk_win32_surface_handle_queued_move_resize (draw_context);
GDK_DRAW_CONTEXT_CLASS (gdk_win32_gl_context_parent_class)->begin_frame (draw_context, update_area);
- if (gdk_gl_context_get_shared_context (context))
- return;
-
- if (gdk_gl_context_has_framebuffer_blit (context))
- return;
-
- /* If nothing else is known, repaint everything so that the back
- buffer is fully up-to-date for the swapbuffer */
- cairo_region_union_rectangle (update_area, &(GdkRectangle) {
- 0, 0,
- gdk_surface_get_width (surface),
- gdk_surface_get_height (surface) });
}
typedef struct
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]