[gtk] gl renderer: Fix fallback node scaling
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk] gl renderer: Fix fallback node scaling
- Date: Sat, 21 Apr 2018 09:23:49 +0000 (UTC)
commit 29f38056a9a2b121dbdd20de79fbdff82b5fbd3a
Author: Timm Bäder <mail baedert org>
Date: Sun Apr 15 18:20:52 2018 +0200
gl renderer: Fix fallback node scaling
gsk/gl/gskglrenderer.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/gsk/gl/gskglrenderer.c b/gsk/gl/gskglrenderer.c
index a52d1811c5..1c0c1186db 100644
--- a/gsk/gl/gskglrenderer.c
+++ b/gsk/gl/gskglrenderer.c
@@ -263,14 +263,15 @@ render_fallback_node (GskGLRenderer *self,
RenderOpBuilder *builder,
const GskQuadVertex *vertex_data)
{
+ const float scale = ops_get_scale (builder);
cairo_surface_t *surface;
cairo_t *cr;
int texture_id;
surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
- ceilf (node->bounds.size.width) * self->scale_factor,
- ceilf (node->bounds.size.height) * self->scale_factor);
- cairo_surface_set_device_scale (surface, self->scale_factor, self->scale_factor);
+ ceilf (node->bounds.size.width) * scale,
+ ceilf (node->bounds.size.height) * scale);
+ cairo_surface_set_device_scale (surface, scale, scale);
cr = cairo_create (surface);
cairo_save (cr);
@@ -291,8 +292,8 @@ render_fallback_node (GskGLRenderer *self,
/* Upload the Cairo surface to a GL texture */
texture_id = gsk_gl_driver_create_texture (self->gl_driver,
- node->bounds.size.width * self->scale_factor,
- node->bounds.size.height * self->scale_factor);
+ cairo_image_surface_get_width (surface),
+ cairo_image_surface_get_height (surface));
gsk_gl_driver_bind_source_texture (self->gl_driver, texture_id);
gsk_gl_driver_init_texture_with_surface (self->gl_driver,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]