gtk/gsk
Benjamin Otte 37bea9d162 gpu: Don't transition invalid cache items
When a cache item is invalid, don't move it into the hash table.
Instead, just delete it.

Something like this could happen:

1. A texture is cached
In the case of #6867 this would be a webpage in epiphany.

2. The texture cache item is garbage-collected
For example, epiphany might switch to a new tab, and the previous page's
texture will remain. After 15s or so, we collect our item for that
texture.

3. The texture is cached again, but in the target colorspace
We now decide we need the texture again, but not in any colorspace, we
need it in the target colorspace. This might be because we run an
effect on it (like a crossfade) or because we want mipmaps (like in the
overview map, where its zoomed out).

4. The old invalid item is transitioned into the hash table
We now have an invalid item in the hash table. This is extra bad,
because it had only one reference (from the texture), but we treat it
like it has 2 (from us in the hash table and from the texture).
So depending on if the texture is freed before we reuse it, we get
different results: If it was free, we get invalid memory accesses, if it
was not freed, we treat it like a valid cache item and think the image
inside is still valid.

Fixes #6867
2024-07-16 03:15:36 +02:00
..
broadway gdk: Add color state arg to gdk_texture_download_surface() 2024-07-11 14:57:20 +02:00
gl gl: Force U8 textures for U8_SRGB depths 2024-07-11 14:57:20 +02:00
gpu gpu: Don't transition invalid cache items 2024-07-16 03:15:36 +02: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
gskcairorenderer.c cairo: Use the draw context's color state 2024-07-11 14:57:20 +02:00
gskcairorenderer.h gsk: Add header guard to missing header 2024-01-07 07:22:49 +01:00
gskcontour.c gsk: Fix a minor type mismatch 2024-04-13 22:28:48 -04:00
gskcontourprivate.h
gskcurve-ct-values.c
gskcurve.c gsk: Fix a maybe-uninitialized warning 2024-04-12 12:08:03 +01:00
gskcurveprivate.h Add gsk_curve_get_cusps 2023-09-17 00:23:53 -04:00
gskdebug.c gsk: Rename GSK_DEBUG=glyphcache to GSK_DEBUG=cache 2024-07-07 05:24:45 +02:00
gskdebugprivate.h gsk: Rename GSK_DEBUG=glyphcache to GSK_DEBUG=cache 2024-07-07 05:24:45 +02:00
gskdiff.c
gskdiffprivate.h
gskenums.h Add Since annotations to enums 2023-12-22 08:47:47 -05:00
gskenumtypes.c.template
gskenumtypes.h.template
gskglshader.c gskglshader: Fix typo in deprecation docs 2024-07-08 09:21:43 +03:00
gskglshader.h gsk: Deprecate GskGLShader and the rendernode 2024-07-04 21:28:06 +02:00
gskglshaderprivate.h gsk: Deprecate GskGLShader and the rendernode 2024-07-04 21:28:06 +02:00
gskoffload.c Take all transforms into account 2024-07-10 22:11:13 +02:00
gskoffloadprivate.h gdk: Rename GdkTextureTransform to GdkDihedral 2024-07-10 12:36:07 +02:00
gskpath.c Fix typos throughout 2024-01-07 20:44:05 -05:00
gskpath.h
gskpathbuilder.c gskpathbuilder: Document add_cairo_path path arg 2024-06-01 10:01:19 +02:00
gskpathbuilder.h
gskpathmeasure.c
gskpathmeasure.h
gskpathopprivate.h
gskpathparser.c path: Fix parsing rounded rects 2023-09-17 17:01:44 -04:00
gskpathpoint.c gskpathpoint: Document copy and free 2024-05-31 11:47:29 +02:00
gskpathpoint.h Add a few annotations 2023-12-26 21:57:04 -05:00
gskpathpointprivate.h
gskpathprivate.h path: document enum 2024-04-28 08:33:03 +02:00
gskprivate.c Bump the pango dep 2024-04-04 00:56:24 +02:00
gskprivate.h Drop unused private API 2024-04-03 10:53:55 +02:00
gskprofiler.c
gskprofilerprivate.h
gskrectprivate.h transform: Implement transform_bounds() for dihedrals 2024-07-10 21:34:12 +02:00
gskrenderer.c gsk: Require dmabuf support for Vulkan 2024-05-05 15:19:17 -04: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 cairo: Add colorstate to GskRenderNode::draw and use it 2024-07-11 14:57:20 +02:00
gskrendernode.h gsk: Add gsk_render_node_get_opaque_rect() 2024-07-08 15:28:14 +02:00
gskrendernodeimpl.c cairo: Add colorstate to GskRenderNode::draw and use it 2024-07-11 14:57:20 +02:00
gskrendernodeparser.c gdk: Add color state arg to gdk_texture_download_surface() 2024-07-11 14:57:20 +02:00
gskrendernodeparserprivate.h gsk: Allow custom fonts in node files 2024-01-15 18:58:17 -05:00
gskrendernodeprivate.h cairo: Add colorstate to GskRenderNode::draw and use it 2024-07-11 14:57:20 +02:00
gskroundedrect.c Add gdk_dihedral_swaps_xy 2024-07-10 21:34:12 +02:00
gskroundedrect.h
gskroundedrectprivate.h gpu: Implement transform support for dihedral transforms 2024-07-10 21:34:12 +02:00
gskstroke.c gskstroke: Add missing return annotations 2024-06-01 10:01:19 +02:00
gskstroke.h
gskstrokeprivate.h stroke: Turn stroke copy intialization into a macro 2023-12-28 07:35:46 +01:00
gsktransform.c transform: Implement transform_point() for dihedrals 2024-07-10 21:34:12 +02:00
gsktransform.h
gsktransformprivate.h transform: Add gsk_transform_to_dihedral() 2024-07-10 14:38:48 +02:00
gsktypes.h
meson.build gpu: Remove straightalpha shader 2024-07-11 14:57:20 +02:00