mutter/cogl/cogl
Neil Roberts ad071c64f9 cogl: Rebind the EGL image when handling damage
When Cogl gained support for importing pixmaps, I think there was a
misunderstanding that there is a difference in how it works in GLX and
EGL where GLX needs to rebind the pixmap in order to guarantee that
changes are reflected in the texture after it detects damage, whereas
with EGL it doesn’t. The GLX spec makes it pretty clear that it does
need to rebind whereas the EGL spec is a bit harder to follow. As a
fallout from Mesa MR 12869, it seems like the compositor really does
need to rebind the image to comply with the spec. Notably, in
OES_EGL_image_external there is:

"Binding (or re-binding if already bound) an external texture by calling
 BindTexture after all modifications are complete guarantees that
 sampling done in future draw calls will return values corresponding to
 the values in the buffer at or after the time that BindTexture is
 called."

So this commit changes the x11_damage_notify handler for EGL to lazily
queue a rebind like GLX does. The code that binds the image while
allocating the texture has been moved into a reusable helper function.

It seems like there is a bit of a layering violation when accessing the
GL driver internals from the EGL winsys code, but I noticed that the GLX
code also includes the driver GL headers and otherwise it seems pretty
tricky to do properly.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2062>
2021-12-13 16:09:56 +00:00
..
deprecated cogl: Remove cogl_texture_new_with_size 2021-12-07 15:32:21 +00:00
driver cogl: Rebind the EGL image when handling damage 2021-12-13 16:09:56 +00:00
gl-prototypes cogl: Fix GL_EXT_discard_framebuffer extension check 2021-08-24 18:33:09 +02:00
winsys cogl: Rebind the EGL image when handling damage 2021-12-13 16:09:56 +00:00
cogl1-context.h cogl: Remove deprecated backface_culing API 2021-12-07 15:32:21 +00:00
cogl-atlas-texture-private.h
cogl-atlas-texture.c
cogl-atlas-texture.h
cogl-atlas.c
cogl-atlas.h
cogl-attribute-buffer-private.h
cogl-attribute-buffer.c
cogl-attribute-buffer.h
cogl-attribute-private.h
cogl-attribute.c
cogl-attribute.h
cogl-bitmap-conversion.c cogl: Add XRGB_FP_16161616 and XBGR_FP_16161616 formats 2021-09-20 14:39:20 +00:00
cogl-bitmap-packing.h cogl: Add XRGB_FP_16161616 and XBGR_FP_16161616 formats 2021-09-20 14:39:20 +00:00
cogl-bitmap-pixbuf.c
cogl-bitmap-private.h
cogl-bitmap.c
cogl-bitmap.h
cogl-bitmask.c
cogl-bitmask.h
cogl-blend-string.c
cogl-blend-string.h
cogl-blit.c
cogl-blit.h
cogl-boxed-value.c
cogl-boxed-value.h
cogl-buffer-private.h cogl: Mark exported cogl symbols using COGL_EXPORT 2020-03-26 09:05:38 +01:00
cogl-buffer.c
cogl-buffer.h
cogl-clip-stack.c
cogl-clip-stack.h
cogl-closure-list-private.h
cogl-closure-list.c
cogl-color-private.h
cogl-color.c
cogl-color.h
cogl-context-private.h cogl: Remove deprecated backface_culing API 2021-12-07 15:32:21 +00:00
cogl-context.c cogl: Remove deprecated backface_culing API 2021-12-07 15:32:21 +00:00
cogl-context.h
cogl-debug-options.h
cogl-debug.c
cogl-debug.h
cogl-defines.h.in
cogl-defines.h.meson cogl: Drop COGL_HAS_WAYLAND_EGL_SERVER_SUPPORT 2021-12-07 18:36:27 -03:00
cogl-depth-state-private.h
cogl-depth-state.c
cogl-depth-state.h
cogl-display-private.h
cogl-display.c
cogl-display.h
cogl-dma-buf-handle.c
cogl-dma-buf-handle.h
cogl-driver.h
cogl-egl-defines.h.in
cogl-egl-private.h
cogl-egl.h
cogl-feature-private.c
cogl-feature-private.h
cogl-fence-private.h
cogl-fence.c
cogl-fence.h
cogl-flags.h
cogl-frame-info-private.h
cogl-frame-info.c
cogl-frame-info.h
cogl-framebuffer-driver.c
cogl-framebuffer-driver.h
cogl-framebuffer-private.h
cogl-framebuffer.c cogl: Remove usages of framebuffer_draw_primitive 2021-12-07 15:32:21 +00:00
cogl-framebuffer.h cogl: Remove usages of framebuffer_draw_primitive 2021-12-07 15:32:21 +00:00
cogl-gl-header.h.in
cogl-glib-source.c
cogl-glib-source.h
cogl-glsl-shader-boilerplate.h
cogl-graphene.c
cogl-graphene.h
cogl-gtype-private.h
cogl-gtype.c move everything into a cogl/ directory 2016-04-22 16:44:31 +02:00
cogl-i18n-private.h
cogl-index-buffer-private.h
cogl-index-buffer.c
cogl-index-buffer.h
cogl-indices-private.h
cogl-indices.c
cogl-indices.h
cogl-journal-private.h
cogl-journal.c
cogl-list.c
cogl-list.h
cogl-macros.h
cogl-magazine-private.h
cogl-magazine.c
cogl-matrix-stack-private.h
cogl-matrix-stack.c
cogl-matrix-stack.h
cogl-memory-stack-private.h
cogl-memory-stack.c
cogl-meta-texture.c
cogl-meta-texture.h
cogl-mutter.h
cogl-node-private.h
cogl-node.c
cogl-object-private.h
cogl-object.c
cogl-object.h
cogl-offscreen-private.h
cogl-offscreen.c
cogl-offscreen.h
cogl-onscreen-private.h
cogl-onscreen-template-private.h
cogl-onscreen-template.c
cogl-onscreen-template.h
cogl-onscreen.c cogl: Add support for partial update 2021-10-26 16:56:39 +00:00
cogl-onscreen.h cogl: Add support for partial update 2021-10-26 16:56:39 +00:00
cogl-output-private.h
cogl-output.c
cogl-output.h
cogl-pipeline-cache.c
cogl-pipeline-cache.h
cogl-pipeline-debug.c cogl: Plug possible GString leaks 2021-10-25 15:45:35 +02:00
cogl-pipeline-hash-table.c
cogl-pipeline-hash-table.h
cogl-pipeline-layer-private.h
cogl-pipeline-layer-state-private.h
cogl-pipeline-layer-state.c
cogl-pipeline-layer-state.h
cogl-pipeline-layer.c
cogl-pipeline-private.h
cogl-pipeline-snippet-private.h
cogl-pipeline-snippet.c
cogl-pipeline-state-private.h
cogl-pipeline-state.c
cogl-pipeline-state.h
cogl-pipeline.c
cogl-pipeline.h
cogl-pixel-buffer-private.h
cogl-pixel-buffer.c
cogl-pixel-buffer.h
cogl-pixel-format.c cogl: Add XRGB_FP_16161616 and XBGR_FP_16161616 formats 2021-09-20 14:39:20 +00:00
cogl-pixel-format.h cogl: Add XRGB_FP_16161616 and XBGR_FP_16161616 formats 2021-09-20 14:39:20 +00:00
cogl-point-in-poly-private.h
cogl-point-in-poly.c
cogl-poll-private.h
cogl-poll.c
cogl-poll.h
cogl-primitive-private.h
cogl-primitive-texture.c
cogl-primitive-texture.h
cogl-primitive.c
cogl-primitive.h
cogl-primitives-private.h
cogl-primitives.c
cogl-private.h
cogl-profile.c
cogl-profile.h
cogl-rectangle-map.c
cogl-rectangle-map.h
cogl-renderer-private.h
cogl-renderer.c cogl: Plug GString leak 2021-10-25 15:45:35 +02:00
cogl-renderer.h
cogl-sampler-cache-private.h
cogl-sampler-cache.c
cogl-scanout.c
cogl-scanout.h
cogl-snippet-private.h
cogl-snippet.c
cogl-snippet.h
cogl-spans.c
cogl-spans.h
cogl-sub-texture-private.h
cogl-sub-texture.c
cogl-sub-texture.h
cogl-swap-chain-private.h
cogl-swap-chain.c
cogl-swap-chain.h cogl: Mark exported cogl symbols using COGL_EXPORT 2020-03-26 09:05:38 +01:00
cogl-texture-2d-private.h
cogl-texture-2d-sliced-private.h
cogl-texture-2d-sliced.c
cogl-texture-2d-sliced.h
cogl-texture-2d.c cogl: Drop cogl-wayland-server.h 2021-12-07 18:34:00 -03:00
cogl-texture-2d.h
cogl-texture-driver.h
cogl-texture-private.h
cogl-texture.c
cogl-texture.h
cogl-trace.c cogl/trace: Add way to add a description to trace 2021-07-29 15:16:48 +02:00
cogl-trace.h cogl/trace: Add getter for trace enabled state 2021-07-29 15:16:48 +02:00
cogl-types.h cogl/winsys: Remove 'multiple-onscreen' feature 2021-10-18 14:36:15 +00:00
cogl-util.c
cogl-util.h
cogl-version.h
cogl-x11-onscreen.c
cogl-x11-onscreen.h
cogl-x11-renderer-private.h
cogl-xlib-private.h
cogl-xlib-renderer-private.h cogl: Remove unused _cogl_xlib_renderer_get_dispatch_timeout 2019-10-24 16:52:53 -04:00
cogl-xlib-renderer.c
cogl-xlib-renderer.h
cogl-xlib.h
cogl.c cogl: Remove deprecated backface_culing API 2021-12-07 15:32:21 +00:00
cogl.h cogl: Remove cogl_material_new 2021-12-07 15:32:21 +00:00
meson.build cogl: Drop COGL_HAS_WAYLAND_EGL_SERVER_SUPPORT 2021-12-07 18:36:27 -03:00
mutter-cogl.pc.in