vulkan: Render whole texture

When the node bounds were a non-integer size, the texture would get
ceil()ed pixels, but various viewport or scissor computations might
floor() instead, leaving the right/bottom row of pixels untouched.
Make sure those functions ceil(), too.
This commit is contained in:
Benjamin Otte 2023-05-05 09:29:47 +02:00
parent cfeaa0ac72
commit 4a868736f9

View File

@ -228,6 +228,7 @@ gsk_vulkan_renderer_render_texture (GskRenderer *renderer,
GskVulkanRender *render;
GskVulkanImage *image;
GdkTexture *texture;
graphene_rect_t rounded_viewport;
#ifdef G_ENABLE_DEBUG
GskProfiler *profiler;
gint64 cpu_time;
@ -244,11 +245,15 @@ gsk_vulkan_renderer_render_texture (GskRenderer *renderer,
render = gsk_vulkan_render_new (renderer, self->vulkan);
image = gsk_vulkan_image_new_for_framebuffer (self->vulkan,
rounded_viewport = GRAPHENE_RECT_INIT (viewport->origin.x,
viewport->origin.y,
ceil (viewport->size.width),
ceil (viewport->size.height));
image = gsk_vulkan_image_new_for_framebuffer (self->vulkan,
rounded_viewport.size.width,
rounded_viewport.size.height);
gsk_vulkan_render_reset (render, image, viewport, NULL);
gsk_vulkan_render_reset (render, image, &rounded_viewport, NULL);
gsk_vulkan_render_add_node (render, root);
gsk_vulkan_render_upload (render);
gsk_vulkan_render_draw (render);