Merge branch 'fix-scale-fluctuation' into 'main'

gpu: Fix scale fluctuation

See merge request GNOME/gtk!6871
This commit is contained in:
Matthias Clasen 2024-02-10 12:08:52 +00:00
commit ac65495434
3 changed files with 16 additions and 7 deletions

View File

@ -353,7 +353,10 @@ gsk_gpu_node_processor_init_draw (GskGpuNodeProcessor *self,
NULL,
image,
&area,
viewport);
&GRAPHENE_RECT_INIT (viewport->origin.x,
viewport->origin.y,
area.width / graphene_vec2_get_x (scale),
area.height / graphene_vec2_get_y (scale)));
gsk_gpu_render_pass_begin_op (frame,
image,
@ -1007,7 +1010,10 @@ gsk_gpu_node_processor_blur_op (GskGpuNodeProcessor *self,
source_desc,
intermediate,
&(cairo_rectangle_int_t) { 0, 0, width, height },
&intermediate_rect);
&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)));
gsk_gpu_render_pass_begin_op (other.frame,
intermediate,

View File

@ -391,7 +391,7 @@ gsk_gpu_renderer_render (GskRenderer *renderer,
GskGpuFrame *frame;
GskGpuImage *backbuffer;
cairo_region_t *render_region;
GdkSurface *surface;
double scale;
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);
surface = gdk_draw_context_get_surface (priv->context);
scale = gsk_gpu_renderer_get_scale (self);
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,
gdk_surface_get_width (surface),
gdk_surface_get_height (surface)
gsk_gpu_image_get_width (backbuffer) / scale,
gsk_gpu_image_get_height (backbuffer) / scale
),
NULL);

View File

@ -360,7 +360,10 @@ gsk_gpu_render_pass_op_offscreen (GskGpuFrame *frame,
image,
&(cairo_rectangle_int_t) { 0, 0, width, height },
node,
viewport);
&GRAPHENE_RECT_INIT (viewport->origin.x,
viewport->origin.y,
width / graphene_vec2_get_x (scale),
height / graphene_vec2_get_y (scale)));
gsk_gpu_render_pass_end_op (frame,
image,