mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-26 13:41:07 +00:00
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:
parent
cfeaa0ac72
commit
4a868736f9
@ -228,6 +228,7 @@ gsk_vulkan_renderer_render_texture (GskRenderer *renderer,
|
|||||||
GskVulkanRender *render;
|
GskVulkanRender *render;
|
||||||
GskVulkanImage *image;
|
GskVulkanImage *image;
|
||||||
GdkTexture *texture;
|
GdkTexture *texture;
|
||||||
|
graphene_rect_t rounded_viewport;
|
||||||
#ifdef G_ENABLE_DEBUG
|
#ifdef G_ENABLE_DEBUG
|
||||||
GskProfiler *profiler;
|
GskProfiler *profiler;
|
||||||
gint64 cpu_time;
|
gint64 cpu_time;
|
||||||
@ -244,11 +245,15 @@ gsk_vulkan_renderer_render_texture (GskRenderer *renderer,
|
|||||||
|
|
||||||
render = gsk_vulkan_render_new (renderer, self->vulkan);
|
render = gsk_vulkan_render_new (renderer, 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,
|
image = gsk_vulkan_image_new_for_framebuffer (self->vulkan,
|
||||||
ceil (viewport->size.width),
|
rounded_viewport.size.width,
|
||||||
ceil (viewport->size.height));
|
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_add_node (render, root);
|
||||||
gsk_vulkan_render_upload (render);
|
gsk_vulkan_render_upload (render);
|
||||||
gsk_vulkan_render_draw (render);
|
gsk_vulkan_render_draw (render);
|
||||||
|
Loading…
Reference in New Issue
Block a user