gtk/gsk
Benjamin Otte aff34e8d1b gpu: Sort passes correctly
In a very particular situation, it could happen that our renderpass
reordering did not work out.
Consider this nesting of renderpasses (indentation indicates subpasses):

pass A
  subpass of A
pass B
  subpass of B

Out reordering code would reorder this as:

subpass of B
subpass of A
pass A
pass B

Which doesn't sound too bad, the subpasses happen before the passes
after all.

However, a subpass might be a pass that converts the image for a texture
stored in the texture cache and then updates the cached image.
If "subpass of A" is such a pass *and* if "subpass of B" then renders
with exactly this texture, then "subpass of B" will use the result of
"subpass of A" as a source.

The fix is to ensure that subpasses stay ordered, too.

The new order moves subpasses right before their parent pass, so the
order of the example now looks like:

subpass of A
pass A
subpass of B
pass B

The place where this would happen most common was when drawing thumbnail
images in Nautilus, the GTK filechooser or Fractal.
Those images are usually PNG files, which are straight alpha. They are then
drawn with a drop shadow, which requires an offscreen for drawing as
well as those images as premultipled sources, so lots of subpasses happen.
If there is then a redraw with a somewhat tricky subregion, then the
slicing of the region code could end up generating 2 passes that each draw
half of the thumbnail image - the first pass drawing the top half and the
second pass drawing the bottom half.
And due to the bug the bottom half would then be drawn from the
offscreen before the actual contents of the offscreen would be drawn,
leading to a corrupt bottom part of the image.

Test included.

Fixes: #6318
2024-03-16 23:44:59 +01:00
..
broadway renderer: Pass the display as part of the vfunc 2024-01-07 14:47:22 +01:00
gl Merge branch 'debug-cleanup' into 'main' 2024-03-16 14:41:16 +00:00
gpu gpu: Sort passes correctly 2024-03-16 23:44:59 +01:00
gen-gsk-gresources-xml.py gpu: Add ability to run shaders 2024-01-07 07:22:49 +01:00
gsk.h gsk: Include GL renderer in gsk.h 2024-01-07 14:47:22 +01:00
gskboundingboxprivate.h Add gsk_bounding_box_get_corner 2023-09-16 21:57:31 -04:00
gskcairoblur.c
gskcairoblurprivate.h Convert headers to #pragma once 2023-03-31 15:11:10 -04:00
gskcairorenderer.c renderer: Pass the display as part of the vfunc 2024-01-07 14:47:22 +01:00
gskcairorenderer.h gsk: Add header guard to missing header 2024-01-07 07:22:49 +01:00
gskcontour.c contour: Fix stroke bounds for rect contour 2024-01-09 23:27:55 +01:00
gskcontourprivate.h Drop tolerance from gsk_contour_foreach 2023-08-28 20:52:22 -04:00
gskcurve-ct-values.c curve: Reduce the order of our approximation 2023-08-26 10:23:02 -04:00
gskcurve.c gsk/gskcurve.c: Avoid returning value in void-retype function 2023-10-24 13:18:26 +08:00
gskcurveprivate.h Add gsk_curve_get_cusps 2023-09-17 00:23:53 -04:00
gskdebug.c gsk: Drop unused debug flags 2024-03-16 09:44:57 -04:00
gskdebugprivate.h gsk: Drop unused debug flags 2024-03-16 09:44:57 -04:00
gskdiff.c gsk: Stop using g_slice 2023-03-14 14:56:42 -04:00
gskdiffprivate.h Convert headers to #pragma once 2023-03-31 15:11:10 -04:00
gskenums.h Add Since annotations to enums 2023-12-22 08:47:47 -05:00
gskenumtypes.c.template
gskenumtypes.h.template
gskglshader.c Remove G_ENABLE_DEBUG around debug checks 2023-11-05 11:16:23 +01:00
gskglshader.h Convert headers to #pragma once 2023-03-31 15:11:10 -04:00
gskglshaderprivate.h Convert headers to #pragma once 2023-03-31 15:11:10 -04:00
gskoffload.c offload: Find and use source rectangle 2024-02-11 21:44:47 -05:00
gskoffloadprivate.h subsurface: Have a source rectangle 2024-02-11 21:44:27 -05:00
gskpath.c Fix typos throughout 2024-01-07 20:44:05 -05:00
gskpath.h Change gsk_path_get_closest_point to return distance 2023-08-28 11:22:30 -04:00
gskpathbuilder.c Fix some static analysis warnings 2023-11-24 10:35:57 -05:00
gskpathbuilder.h pathbuilder: Add rel-variants for arc-to 2023-08-25 09:45:45 -04:00
gskpathmeasure.c measure: Cosmetics 2023-08-28 21:14:28 -04:00
gskpathmeasure.h Add GskPathMeasure 2023-08-25 20:16:49 -04:00
gskpathopprivate.h path: Switch back to conics 2023-08-25 07:33:16 -04:00
gskpathparser.c path: Fix parsing rounded rects 2023-09-17 17:01:44 -04:00
gskpathpoint.c docs: Add details 2023-09-15 16:31:09 -04:00
gskpathpoint.h Add a few annotations 2023-12-26 21:57:04 -05:00
gskpathpointprivate.h Improve precondition checks for path points 2023-08-28 00:07:50 -04:00
gskpathprivate.h Make gsk_path_builder_svg_arc_to public 2023-08-23 12:43:52 -04:00
gskprivate.c gsk: Rework font reloading again 2024-03-12 00:45:14 -04:00
gskprivate.h gsk: Rework font reloading again 2024-03-12 00:45:14 -04:00
gskprofiler.c Fix various bitfield warnings 2023-04-27 13:42:03 +02:00
gskprofilerprivate.h Convert headers to #pragma once 2023-03-31 15:11:10 -04:00
gskrectprivate.h Add gsk_rect_normalize 2024-02-13 20:06:16 -05:00
gskrenderer.c Don't fall back to cairo for software rendering 2024-03-03 12:28:20 -05:00
gskrenderer.h API: Add gsk_renderer_realize_for_display() 2024-01-07 14:47:22 +01:00
gskrendererprivate.h renderer: Pass the display as part of the vfunc 2024-01-07 14:47:22 +01:00
gskrendernode.c Rework diffing one more time 2024-02-11 20:48:59 -05:00
gskrendernode.h rendernode: Don't mark impure functions as pure 2023-12-26 05:03:24 +01:00
gskrendernodeimpl.c gsk: Minor reshuffling 2024-03-09 12:43:33 -05:00
gskrendernodeparser.c Merge branch 'matthiasc/for-main' into 'main' 2024-03-12 11:47:20 +00:00
gskrendernodeparserprivate.h gsk: Allow custom fonts in node files 2024-01-15 18:58:17 -05:00
gskrendernodeprivate.h Rework diffing one more time 2024-02-11 20:48:59 -05:00
gskroundedrect.c gsk: Use gsk_rect_scale() in more places 2024-02-14 20:11:30 +01:00
gskroundedrect.h gsk: Move GskRoundedRect typedef 2023-09-15 03:46:27 +02:00
gskroundedrectprivate.h vulkan: Try really hard to use clear 2023-07-16 13:16:41 +02:00
gskstroke.c stroke: Turn stroke copy intialization into a macro 2023-12-28 07:35:46 +01:00
gskstroke.h Add GskStroke 2023-08-07 13:02:57 -04:00
gskstrokeprivate.h stroke: Turn stroke copy intialization into a macro 2023-12-28 07:35:46 +01:00
gsktransform.c gsk: Make matrix transforms roundtrip better 2024-02-11 19:39:19 -05:00
gsktransform.h Convert headers to #pragma once 2023-03-31 15:11:10 -04:00
gsktransformprivate.h Convert headers to #pragma once 2023-03-31 15:11:10 -04:00
gsktypes.h gsk: Move GskRoundedRect typedef 2023-09-15 03:46:27 +02:00
meson.build gsk: include Vulkan renderer in public header 2024-01-07 14:47:22 +01:00