[gtk/wip/baedert/for-master: 51/53] gl renderer: simplify ->render() implementation a bit
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/baedert/for-master: 51/53] gl renderer: simplify ->render() implementation a bit
- Date: Sat, 3 Oct 2020 09:58:17 +0000 (UTC)
commit cff4e7b932366893859be2cbbff22a224d8118cb
Author: Timm Bäder <mail baedert org>
Date: Thu Oct 1 09:38:39 2020 +0200
gl renderer: simplify ->render() implementation a bit
We already use self->scale_factor when initialized whole_surface,
so set self->scale_factor first.
gsk/gl/gskglrenderer.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/gsk/gl/gskglrenderer.c b/gsk/gl/gskglrenderer.c
index d4ce1b4994..b8863b0d3f 100644
--- a/gsk/gl/gskglrenderer.c
+++ b/gsk/gl/gskglrenderer.c
@@ -4368,11 +4368,13 @@ gsk_gl_renderer_render (GskRenderer *renderer,
if (self->gl_context == NULL)
return;
+ surface = gsk_renderer_get_surface (renderer);
+ self->scale_factor = gdk_surface_get_scale_factor (surface);
+
gdk_gl_context_make_current (self->gl_context);
gdk_gl_context_push_debug_group_printf (self->gl_context,
"Render root node %p", root);
- surface = gsk_renderer_get_surface (renderer);
whole_surface = (GdkRectangle) {
0, 0,
gdk_surface_get_width (surface) * self->scale_factor,
@@ -4400,13 +4402,12 @@ gsk_gl_renderer_render (GskRenderer *renderer,
self->render_region = cairo_region_create_rectangle (&extents);
}
- self->scale_factor = gdk_surface_get_scale_factor (surface);
gdk_gl_context_make_current (self->gl_context);
viewport.origin.x = 0;
viewport.origin.y = 0;
- viewport.size.width = gdk_surface_get_width (surface) * self->scale_factor;
- viewport.size.height = gdk_surface_get_height (surface) * self->scale_factor;
+ viewport.size.width = whole_surface.width;
+ viewport.size.height = whole_surface.height;
gsk_gl_driver_begin_frame (self->gl_driver);
gsk_gl_renderer_do_render (renderer, root, &viewport, 0, self->scale_factor);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]