gtk2/gsk
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
..
broadway gsk: Add GskConicGradientNode 2020-12-03 00:47:54 +01:00
gl gsk/gl: Always align offscreen rendering with the pixel grid 2022-04-21 19:23:06 -04:00
vulkan gsk: Allow gsk_renderer_realize (renderer, NULL, NULL) 2021-10-20 21:49:32 +02:00
gen-gsk-gresources-xml.py gsk: Move shader resources 2021-04-03 08:24:58 -04:00
gsk-autocleanup.h gsk: Add GskTransform autocleanup definition 2020-05-08 09:14:55 +02:00
gsk.h Add GskGLShaderNode and GskGLShader 2020-09-29 09:51:16 +02:00
gskcairoblur.c Replace "gdouble" with "double" 2020-07-25 00:47:36 +02:00
gskcairoblurprivate.h Annotate gsk_cairo_blur_compute_pixels as const 2021-09-14 16:38:08 -04:00
gskcairorenderer.c renderers: Handle large viewports 2022-03-15 22:00:39 -04:00
gskcairorenderer.h docs: Improve gsk docs 2021-03-11 16:37:31 +00:00
gskdebug.c types: fix various use of volatile in type registration 2020-11-18 20:21:33 -08:00
gskdebugprivate.h gsk: Remove an unused debug flag 2020-07-20 07:03:08 -04:00
gskdiff.c gsk: Allow diffing code to abort 2021-12-20 17:08:15 +01:00
gskdiffprivate.h gsk: Allow diffing code to abort 2021-12-20 17:08:15 +01:00
gskenums.h docs: use markdown syntax for hyperlinks 2021-05-25 13:14:01 +00:00
gskenumtypes.c.template types: fix various use of volatile in type registration 2020-11-18 20:21:33 -08:00
gskenumtypes.h.template Use @basename@ in enumeration type templates 2019-02-04 14:02:45 +01:00
gskglshader.c docs: Cosmetics 2021-10-18 08:35:54 -04:00
gskglshader.h gsk: Clean up docs syntax 2021-05-22 17:25:26 -04:00
gskglshaderprivate.h Add GskGLShaderNode and GskGLShader 2020-09-29 09:51:16 +02:00
gskprivate.c More work on text nodes 2017-09-10 14:36:26 -04:00
gskprivate.h Annotate pango_glyph_string_num_glyphs as pure 2021-09-14 16:38:08 -04:00
gskprofiler.c Convert all profiler times from nsec to usec 2020-02-12 10:44:17 +01:00
gskprofilerprivate.h gsk: Add some more profiler apis 2019-05-07 09:37:59 -07:00
gskrenderer.c gskrenderer.c: Use GL renderer on Windows by default 2022-01-19 11:56:32 +08:00
gskrenderer.h gskrenderer: Add property annotations 2021-03-11 16:37:32 +00:00
gskrendererprivate.h renderer: Make gsk_renderer_is_realized() public 2019-03-19 08:47:54 +01:00
gskrendernode.c docs: Improve docs for gskrendernode.c 2022-01-05 14:06:42 +01:00
gskrendernode.h g-i: add missing since annotations 2021-11-13 17:50:53 +01:00
gskrendernodeimpl.c Fix up preconditions of gsk_gl_shader_node_new 2022-03-15 22:05:14 -04:00
gskrendernodeparser.c cssparser: Remove unused argument 2021-10-28 03:19:08 +02:00
gskrendernodeparserprivate.h rendernodeparser: Skip root node when it's a container 2019-05-21 06:43:59 +02:00
gskrendernodeprivate.h gsk: Add high depth rendernode api 2021-10-06 21:35:25 -04:00
gskroundedrect.c Add a doc comment for gsk_rounded_rect_is_circular 2021-06-04 09:49:05 -04:00
gskroundedrect.h gsk: Clean up docs syntax 2021-05-22 17:25:26 -04:00
gskroundedrectprivate.h Annotate gsk_rounded_rect_is_circular as pure 2021-09-14 16:38:08 -04:00
gsktransform.c Mark various GskTransform functions as nullable in their return value 2022-01-14 11:57:23 +02:00
gsktransform.h Add gsk_transform_to_2d_components 2021-09-18 02:06:51 -04:00
gsktransformprivate.h gsk: move transform structure to private.h 2021-02-10 16:14:59 -08:00
gsktypes.h Use a single compilation symbol 2019-11-27 13:33:43 +00:00
meson.build Rename ngl to gl 2021-10-07 13:05:53 -04:00