mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-12 20:00:09 +00:00
gpu: Fix scale fluctuation
We want to use a viewport that gives us the right scale back. This fixes problems where glyph lookups were inefficient because the scale part of the key would fluctuate ever so slightly.
This commit is contained in:
parent
7c38945abf
commit
1ac82528d9
@ -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,
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user