Merge branch 'wip/otte/for-matthiasc' into 'main'

vulkan: Round damage rectangles properly

See merge request GNOME/gtk!7602
This commit is contained in:
Benjamin Otte 2024-08-13 00:24:47 +00:00
commit 03c99ebc99
2 changed files with 4 additions and 4 deletions

View File

@ -718,8 +718,8 @@ gdk_gl_context_real_end_frame (GdkDrawContext *draw_context,
cairo_region_get_rectangle (painted, i, &rect);
rects[j++] = (int) floor (rect.x * scale);
rects[j++] = (int) floor ((surface_height - rect.height - rect.y) * scale);
rects[j++] = (int) ceil (rect.width * scale);
rects[j++] = (int) ceil (rect.height * scale);
rects[j++] = (int) ceil ((rect.x + rect.width) * scale) - floor (rect.x * scale);
rects[j++] = (int) ceil ((surface_height - rect.y) * scale) - floor ((surface_height - rect.height - rect.y) * scale);
}
priv->eglSwapBuffersWithDamage (gdk_display_get_egl_display (display), egl_surface, rects, n_rects);
g_free (heap_rects);

View File

@ -714,8 +714,8 @@ gdk_vulkan_context_end_frame (GdkDrawContext *draw_context,
.layer = 0,
.offset.x = (int) floor (r.x * scale),
.offset.y = (int) floor (r.y * scale),
.extent.width = (int) ceil (r.width * scale),
.extent.height = (int) ceil (r.height * scale),
.extent.width = (int) ceil ((r.x + r.width) * scale) - floor (r.x * scale),
.extent.height = (int) ceil ((r.y + r.height) * scale) - floor (r.y * scale),
};
}
}