summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2023-04-01 22:54:19 -0400
committerMatthias Clasen <mclasen@redhat.com>2023-04-01 22:54:19 -0400
commit8bbed27a5fe46ca74eab78f55ae6cae1fc0078a0 (patch)
tree477239fb00062c389027a1ae020f02f4bbb2541b
parent05bd5c041aa6ee447b0dd90930786591a9e69eed (diff)
downloadgtk+-8bbed27a5fe46ca74eab78f55ae6cae1fc0078a0.tar.gz
gsk: Cosmetics
Rename scale_factor to scale in various places, now that it is no longer an int but a float.
-rw-r--r--gsk/gl/gskglrenderer.c10
-rw-r--r--gsk/gl/gskglrenderjob.c10
-rw-r--r--gsk/gl/gskglrenderjobprivate.h2
3 files changed, 11 insertions, 11 deletions
diff --git a/gsk/gl/gskglrenderer.c b/gsk/gl/gskglrenderer.c
index 93d4ad7dd8..eb3c77c72f 100644
--- a/gsk/gl/gskglrenderer.c
+++ b/gsk/gl/gskglrenderer.c
@@ -282,18 +282,18 @@ gsk_gl_renderer_render (GskRenderer *renderer,
GskGLRenderJob *job;
GdkSurface *surface;
gboolean clear_framebuffer;
- float scale_factor;
+ float scale;
g_assert (GSK_IS_GL_RENDERER (renderer));
g_assert (root != NULL);
surface = gdk_draw_context_get_surface (GDK_DRAW_CONTEXT (self->context));
- scale_factor = gdk_surface_get_scale (surface);
+ scale = gdk_surface_get_scale (surface);
viewport.origin.x = 0;
viewport.origin.y = 0;
- viewport.size.width = gdk_surface_get_width (surface) * scale_factor;
- viewport.size.height = gdk_surface_get_height (surface) * scale_factor;
+ viewport.size.width = gdk_surface_get_width (surface) * scale;
+ viewport.size.height = gdk_surface_get_height (surface) * scale;
gdk_draw_context_begin_frame_full (GDK_DRAW_CONTEXT (self->context),
gsk_render_node_prefers_high_depth (root),
@@ -306,7 +306,7 @@ gsk_gl_renderer_render (GskRenderer *renderer,
clear_framebuffer = update_area_requires_clear (surface, render_region);
gsk_gl_driver_begin_frame (self->driver, self->command_queue);
- job = gsk_gl_render_job_new (self->driver, &viewport, scale_factor, render_region, 0, clear_framebuffer);
+ job = gsk_gl_render_job_new (self->driver, &viewport, scale, render_region, 0, clear_framebuffer);
#ifdef G_ENABLE_DEBUG
if (GSK_RENDERER_DEBUG_CHECK (GSK_RENDERER (self), FALLBACK))
gsk_gl_render_job_set_debug_fallback (job, TRUE);
diff --git a/gsk/gl/gskglrenderjob.c b/gsk/gl/gskglrenderjob.c
index 48a30f8143..ecc78e6a4a 100644
--- a/gsk/gl/gskglrenderjob.c
+++ b/gsk/gl/gskglrenderjob.c
@@ -4401,7 +4401,7 @@ get_framebuffer_format (GdkGLContext *context,
GskGLRenderJob *
gsk_gl_render_job_new (GskGLDriver *driver,
const graphene_rect_t *viewport,
- float scale_factor,
+ float scale,
const cairo_region_t *region,
guint framebuffer,
gboolean clear_framebuffer)
@@ -4414,7 +4414,7 @@ gsk_gl_render_job_new (GskGLDriver *driver,
g_return_val_if_fail (GSK_IS_GL_DRIVER (driver), NULL);
g_return_val_if_fail (viewport != NULL, NULL);
- g_return_val_if_fail (scale_factor > 0, NULL);
+ g_return_val_if_fail (scale > 0, NULL);
/* Check for non-standard framebuffer binding as we might not be using
* the default framebuffer on systems like macOS where we've bound an
@@ -4436,14 +4436,14 @@ gsk_gl_render_job_new (GskGLDriver *driver,
job->default_framebuffer = default_framebuffer;
job->offset_x = 0;
job->offset_y = 0;
- job->scale_x = scale_factor;
- job->scale_y = scale_factor;
+ job->scale_x = scale;
+ job->scale_y = scale;
job->viewport = *viewport;
job->target_format = get_framebuffer_format (job->command_queue->context, framebuffer);
gsk_gl_render_job_set_alpha (job, 1.0f);
gsk_gl_render_job_set_projection_from_rect (job, viewport, NULL);
- gsk_gl_render_job_set_modelview (job, gsk_transform_scale (NULL, scale_factor, scale_factor));
+ gsk_gl_render_job_set_modelview (job, gsk_transform_scale (NULL, scale, scale));
/* Setup our initial clip. If region is NULL then we are drawing the
* whole viewport. Otherwise, we need to convert the region to a
diff --git a/gsk/gl/gskglrenderjobprivate.h b/gsk/gl/gskglrenderjobprivate.h
index c340bf1490..32edae12a3 100644
--- a/gsk/gl/gskglrenderjobprivate.h
+++ b/gsk/gl/gskglrenderjobprivate.h
@@ -24,7 +24,7 @@
GskGLRenderJob *gsk_gl_render_job_new (GskGLDriver *driver,
const graphene_rect_t *viewport,
- float scale_factor,
+ float scale,
const cairo_region_t *region,
guint framebuffer,
gboolean clear_framebuffer);