From df1d0240590934e89fec7188c567eab44b0e83d1 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Sun, 11 Feb 2024 03:23:14 +0100 Subject: [PATCH] Revert "gpu: Fix scale fluctuation" This commit is wrong. It does achieve what it sets out to do, but the method doesn't work. It confused multiple things in one commit, the commit message only describes the symptoms it tries to fix and not why the fix is correct, it includes no tests and it wsn't properly reviewed. Related: !6871 --- gsk/gpu/gskgpunodeprocessor.c | 10 ++-------- gsk/gpu/gskgpurenderer.c | 8 ++++---- gsk/gpu/gskgpurenderpassop.c | 5 +---- 3 files changed, 7 insertions(+), 16 deletions(-) diff --git a/gsk/gpu/gskgpunodeprocessor.c b/gsk/gpu/gskgpunodeprocessor.c index 98dd27b1b8..49c1280d88 100644 --- a/gsk/gpu/gskgpunodeprocessor.c +++ b/gsk/gpu/gskgpunodeprocessor.c @@ -353,10 +353,7 @@ gsk_gpu_node_processor_init_draw (GskGpuNodeProcessor *self, NULL, image, &area, - &GRAPHENE_RECT_INIT (viewport->origin.x, - viewport->origin.y, - area.width / graphene_vec2_get_x (scale), - area.height / graphene_vec2_get_y (scale))); + viewport); gsk_gpu_render_pass_begin_op (frame, image, @@ -1010,10 +1007,7 @@ gsk_gpu_node_processor_blur_op (GskGpuNodeProcessor *self, source_desc, intermediate, &(cairo_rectangle_int_t) { 0, 0, width, height }, - &GRAPHENE_RECT_INIT (intermediate_rect.origin.x, - intermediate_rect.origin.y, - width / graphene_vec2_get_x (&self->scale), - height / graphene_vec2_get_y (&self->scale))); + &intermediate_rect); gsk_gpu_render_pass_begin_op (other.frame, intermediate, diff --git a/gsk/gpu/gskgpurenderer.c b/gsk/gpu/gskgpurenderer.c index a74216eb9a..a27408bdda 100644 --- a/gsk/gpu/gskgpurenderer.c +++ b/gsk/gpu/gskgpurenderer.c @@ -391,7 +391,7 @@ gsk_gpu_renderer_render (GskRenderer *renderer, GskGpuFrame *frame; GskGpuImage *backbuffer; cairo_region_t *render_region; - double scale; + GdkSurface *surface; if (cairo_region_is_empty (region)) { @@ -411,7 +411,7 @@ gsk_gpu_renderer_render (GskRenderer *renderer, frame = gsk_gpu_renderer_get_frame (self); render_region = get_render_region (self); - scale = gsk_gpu_renderer_get_scale (self); + surface = gdk_draw_context_get_surface (priv->context); gsk_gpu_frame_render (frame, g_get_monotonic_time (), @@ -420,8 +420,8 @@ gsk_gpu_renderer_render (GskRenderer *renderer, root, &GRAPHENE_RECT_INIT ( 0, 0, - gsk_gpu_image_get_width (backbuffer) / scale, - gsk_gpu_image_get_height (backbuffer) / scale + gdk_surface_get_width (surface), + gdk_surface_get_height (surface) ), NULL); diff --git a/gsk/gpu/gskgpurenderpassop.c b/gsk/gpu/gskgpurenderpassop.c index 439606137e..188da496ef 100644 --- a/gsk/gpu/gskgpurenderpassop.c +++ b/gsk/gpu/gskgpurenderpassop.c @@ -360,10 +360,7 @@ gsk_gpu_render_pass_op_offscreen (GskGpuFrame *frame, image, &(cairo_rectangle_int_t) { 0, 0, width, height }, node, - &GRAPHENE_RECT_INIT (viewport->origin.x, - viewport->origin.y, - width / graphene_vec2_get_x (scale), - height / graphene_vec2_get_y (scale))); + viewport); gsk_gpu_render_pass_end_op (frame, image,