mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-08 17:50:10 +00:00
gdk: Enable fractional scaling for GL by default
The ngl renderer has good support for fractional scaling, so we can enable this by default now. If you are using the gl renderer, you can disable fractional scaling with the GDK_DEBUG=gl-no-fractional environment variable.
This commit is contained in:
parent
98e3fca284
commit
f90e77d173
@ -220,8 +220,8 @@ A number of options affect behavior instead of logging:
|
||||
`gl-disable`
|
||||
: Disable OpenGL support
|
||||
|
||||
`gl-fractional`
|
||||
: Enable fractional scaling for OpenGL. This is experimental
|
||||
`gl-no-fractional`
|
||||
: Disable fractional scaling for OpenGL.
|
||||
|
||||
`gl-debug`
|
||||
: Insert debugging information in OpenGL
|
||||
|
@ -123,7 +123,7 @@ static const GdkDebugKey gdk_debug_keys[] = {
|
||||
{ "portals", GDK_DEBUG_PORTALS, "Force use of portals" },
|
||||
{ "no-portals", GDK_DEBUG_NO_PORTALS, "Disable use of portals" },
|
||||
{ "gl-disable", GDK_DEBUG_GL_DISABLE, "Disable OpenGL support" },
|
||||
{ "gl-fractional", GDK_DEBUG_GL_FRACTIONAL, "Enable fractional scaling for OpenGL (experimental)" },
|
||||
{ "gl-no-fractional", GDK_DEBUG_GL_NO_FRACTIONAL, "Disable fractional scaling for OpenGL" },
|
||||
{ "gl-debug", GDK_DEBUG_GL_DEBUG, "Insert debugging information in OpenGL" },
|
||||
{ "gl-disable-gl", GDK_DEBUG_GL_DISABLE_GL, "Only allow OpenGL GLES API" },
|
||||
{ "gl-disable-gles", GDK_DEBUG_GL_DISABLE_GLES, "Don't allow OpenGL GLES API" },
|
||||
|
@ -43,7 +43,7 @@ typedef enum {
|
||||
GDK_DEBUG_PORTALS = 1 << 14,
|
||||
GDK_DEBUG_NO_PORTALS = 1 << 15,
|
||||
GDK_DEBUG_GL_DISABLE = 1 << 16,
|
||||
GDK_DEBUG_GL_FRACTIONAL = 1 << 17,
|
||||
GDK_DEBUG_GL_NO_FRACTIONAL= 1 << 17,
|
||||
|
||||
GDK_DEBUG_GL_DISABLE_GL = 1 << 19,
|
||||
GDK_DEBUG_GL_DISABLE_GLES = 1 << 20,
|
||||
|
@ -593,7 +593,7 @@ gdk_gl_context_get_scale (GdkGLContext *self)
|
||||
scale = gdk_surface_get_scale (surface);
|
||||
|
||||
display = gdk_gl_context_get_display (self);
|
||||
if (!(gdk_display_get_debug_flags (display) & GDK_DEBUG_GL_FRACTIONAL))
|
||||
if (gdk_display_get_debug_flags (display) & GDK_DEBUG_GL_NO_FRACTIONAL)
|
||||
scale = ceil (scale);
|
||||
|
||||
return scale;
|
||||
|
@ -199,20 +199,20 @@ get_egl_window_size (GdkSurface *surface,
|
||||
GdkDisplay *display = gdk_surface_get_display (surface);
|
||||
GdkWaylandSurface *impl = GDK_WAYLAND_SURFACE (surface);
|
||||
|
||||
if (GDK_DISPLAY_DEBUG_CHECK (display, GL_FRACTIONAL))
|
||||
{
|
||||
GDK_DISPLAY_DEBUG (display, OPENGL, "Using fractional scale %g for EGL window", gdk_fractional_scale_to_double (&impl->scale));
|
||||
|
||||
*width = gdk_fractional_scale_scale (&impl->scale, surface->width),
|
||||
*height = gdk_fractional_scale_scale (&impl->scale, surface->height);
|
||||
}
|
||||
else
|
||||
if (GDK_DISPLAY_DEBUG_CHECK (display, GL_NO_FRACTIONAL))
|
||||
{
|
||||
GDK_DISPLAY_DEBUG (display, OPENGL, "Using integer scale %d for EGL window", gdk_fractional_scale_to_int (&impl->scale));
|
||||
|
||||
*width = surface->width * gdk_fractional_scale_to_int (&impl->scale);
|
||||
*height = surface->height * gdk_fractional_scale_to_int (&impl->scale);
|
||||
}
|
||||
else
|
||||
{
|
||||
GDK_DISPLAY_DEBUG (display, OPENGL, "Using fractional scale %g for EGL window", gdk_fractional_scale_to_double (&impl->scale));
|
||||
|
||||
*width = gdk_fractional_scale_scale (&impl->scale, surface->width),
|
||||
*height = gdk_fractional_scale_scale (&impl->scale, surface->height);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
Loading…
Reference in New Issue
Block a user