gtk2/gsk/gl
Sebastian Keller f1d44635bd gsk/gl: Always align offscreen rendering with the pixel grid
This fixes two issues with the offscreen rendering code for nodes with
bounds not aligned with the pixel grid:

1.) When drawing to an offscreen buffer the size of the offscreen buffer
was rounded up, but then later when used as texture the vertices
correspond to the original bounds with the unrounded size. This could
then result in the offscreen texture being drawn onscreen at a slightly
smaller size, which then lead to it being visually shifted and blurry.

This is fixed by adjusting the u/v coordinates to ignore the padding
region in the offscreen texture that got added by the size increase from
rounding.

2.) The viewport used when rendering to the offscreen buffer was not
aligned with the pixel grid for nodes at coordinates not aligned with
the pixel grid. Then because the content of the offscreen buffer is not
aligned with the pixel grid and later when used as textures sampling
from it will result in interpolated values for an onscreen pixel. This
could also result in shifting and blurriness, especially for nested
offscreen rendering at different offsets.

This is fixed by adding similar padding at the beginning of the
texture and also adjusting the u/v coordinates to ignore this region.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/3833
2022-04-21 19:23:06 -04:00
..
resources GL renderer: Remove noperspective usage 2021-11-30 14:12:10 +01:00
fp16.c Rename ngl to gl 2021-10-07 13:05:53 -04:00
fp16i.c Rename ngl to gl 2021-10-07 13:05:53 -04:00
fp16private.h Rename ngl to gl 2021-10-07 13:05:53 -04:00
gskglattachmentstate.c Rename ngl to gl 2021-10-07 13:05:53 -04:00
gskglattachmentstateprivate.h Rename ngl to gl 2021-10-07 13:05:53 -04:00
gskglbuffer.c Rename ngl to gl 2021-10-07 13:05:53 -04:00
gskglbufferprivate.h Rename ngl to gl 2021-10-07 13:05:53 -04:00
gskglcommandqueue.c gsk/gl: support non-standard default framebuffer 2022-02-22 12:01:24 -08:00
gskglcommandqueueprivate.h gsk/gl: support non-standard default framebuffer 2022-02-22 12:01:24 -08:00
gskglcompiler.c Merge branch 'wgl-legacy' into 'main' 2022-01-03 13:11:04 +00:00
gskglcompilerprivate.h Rename ngl to gl 2021-10-07 13:05:53 -04:00
gskgldriver.c gl: Refactor texture uploading 2021-10-13 14:33:44 +02:00
gskgldriverprivate.h Rename ngl to gl 2021-10-07 13:05:53 -04:00
gskglglyphlibrary.c Fix kerning of GL rendered glyphs 2022-02-01 09:31:35 +01:00
gskglglyphlibraryprivate.h Rename ngl to gl 2021-10-07 13:05:53 -04:00
gskgliconlibrary.c Rename ngl to gl 2021-10-07 13:05:53 -04:00
gskgliconlibraryprivate.h Rename ngl to gl 2021-10-07 13:05:53 -04:00
gskglprofiler.c Rename ngl to gl 2021-10-07 13:05:53 -04:00
gskglprofilerprivate.h Rename ngl to gl 2021-10-07 13:05:53 -04:00
gskglprogram.c Rename ngl to gl 2021-10-07 13:05:53 -04:00
gskglprogramprivate.h Rename ngl to gl 2021-10-07 13:05:53 -04:00
gskglprograms.defs Rename ngl to gl 2021-10-07 13:05:53 -04:00
gskglrenderer.c renderers: Handle large viewports 2022-03-15 22:00:39 -04:00
gskglrenderer.h Maintain abi 2021-10-07 13:05:53 -04:00
gskglrendererprivate.h Rename ngl to gl 2021-10-07 13:05:53 -04:00
gskglrenderjob.c gsk/gl: Always align offscreen rendering with the pixel grid 2022-04-21 19:23:06 -04:00
gskglrenderjobprivate.h gsk/gl: avoid clearing opaque regions 2022-02-21 23:43:17 -08:00
gskglshadowlibrary.c Rename ngl to gl 2021-10-07 13:05:53 -04:00
gskglshadowlibraryprivate.h Rename ngl to gl 2021-10-07 13:05:53 -04:00
gskgltexture.c Rename ngl to gl 2021-10-07 13:05:53 -04:00
gskgltexturelibrary.c Rename ngl to gl 2021-10-07 13:05:53 -04:00
gskgltexturelibraryprivate.h Rename ngl to gl 2021-10-07 13:05:53 -04:00
gskgltextureprivate.h Rename ngl to gl 2021-10-07 13:05:53 -04:00
gskgltypesprivate.h Rename ngl to gl 2021-10-07 13:05:53 -04:00
gskgluniformstate.c Rename ngl to gl 2021-10-07 13:05:53 -04:00
gskgluniformstateprivate.h Rename ngl to gl 2021-10-07 13:05:53 -04:00
inlinearray.h Rename ngl to gl 2021-10-07 13:05:53 -04:00
ninesliceprivate.h Rename ngl to gl 2021-10-07 13:05:53 -04:00
stb_rect_pack.c Rename ngl to gl 2021-10-07 13:05:53 -04:00
stb_rect_pack.h Rename ngl to gl 2021-10-07 13:05:53 -04:00