Commits on Source (6)
-
Make sure dep_egl is always a valid dependency object, even if not found. Ensure it is not found when not wanted, to avoid linking when found but not wanted. Using a not-found dependency in Meson is defined to be a safe no-op, so use that to simplify the backend dependencies. libweston/meson.build already errors out if renderer-gl is enabled and EGL is not found, so the same checks can be removed from the backends. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
915d8e8c -
Replace a bunch of copied code with a loop over a simple array. This makes the code easier to read, and allows further refactoring. This is pure refactoring, no changes to results or behavior. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
f47ed789 -
GL-renderer keeps the pointer for the border image data for later use. When we destroy our cairo_surface, that data gets freed. Therefore, reset the pointer stored by GL-renderer too, to ensure use-after-free cannot happen. This is not really necessary in this particular case, because the renderer output is destroyed immediately after, so there is no chance of UAF. However, this is needed for code sharing purposes. Wayland-backend will do exactly this when an output is resized. To share this code with wayland-backend, we also need to reset the pointers. It's harmless and more correct in the output disable path. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
5522f735 -
Refactor this code into two backend-agnostic functions, that in the next step can be moved into code shared between backends. Pure refactoring, no changes. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
c57112a4 -
Move this code from headless-backend to a helper library, so it can be shared with wayland-backend. gl-renderer.h was missing #pragma once, which made the build fail. Unfortunately gl-borders needs gl-renderer.h which will attempt to include EGL headers if gl-renderer is enabled in the build, so we must get the EGL build flags too, just for the headers. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
e619a65b -
Use the gl-renderer border code shared with headless-backend. We can drop all this open-coded stuff. In the output disable path, make sure to call this only when gl-renderer is used. It will also reset the border state in gl-renderer, which is harmless here, and it's necessary in the resize path. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
212c666a
libweston/gl-borders.c
0 → 100644
libweston/gl-borders.h
0 → 100644