summary refs log tree commit diff stats
path: root/include/ui/egl-helpers.h
diff options
context:
space:
mode:
authorWeifeng Liu <weifeng.liu.z@gmail.com>2025-05-11 15:33:19 +0800
committerMarc-André Lureau <marcandre.lureau@redhat.com>2025-05-24 17:04:09 +0200
commitf05e1a93f48729b568fdf86a12d56ee142cee5e1 (patch)
treec7e8dbc79b70b26d3da2ce03f4092dcd93c0e838 /include/ui/egl-helpers.h
parentfdc09b028fde9d2ec70418735f354b51c8295d0f (diff)
downloadfocaccia-qemu-f05e1a93f48729b568fdf86a12d56ee142cee5e1.tar.gz
focaccia-qemu-f05e1a93f48729b568fdf86a12d56ee142cee5e1.zip
ui/gtk-egl: Render guest content with padding in fixed-scale mode
Scaling was not respected when rendering frames in gtk-egl.c (used if
gl=on and X11 mode). To fix this, add fields x and y to struct egl_fb
for x offset and y offset so we can add padding to window.

Signed-off-by: Weifeng Liu <weifeng.liu.z@gmail.com>
Message-ID: <20250511073337.876650-10-weifeng.liu.z@gmail.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Diffstat (limited to 'include/ui/egl-helpers.h')
-rw-r--r--include/ui/egl-helpers.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/ui/egl-helpers.h b/include/ui/egl-helpers.h
index fb80e15142..acf993fcf5 100644
--- a/include/ui/egl-helpers.h
+++ b/include/ui/egl-helpers.h
@@ -17,6 +17,8 @@ extern bool qemu_egl_angle_d3d;
 typedef struct egl_fb {
     int width;
     int height;
+    int x;
+    int y;
     GLuint texture;
     GLuint framebuffer;
     bool delete_texture;
@@ -26,7 +28,7 @@ typedef struct egl_fb {
 #define EGL_FB_INIT { 0, }
 
 void egl_fb_destroy(egl_fb *fb);
-void egl_fb_setup_default(egl_fb *fb, int width, int height);
+void egl_fb_setup_default(egl_fb *fb, int width, int height, int x, int y);
 void egl_fb_setup_for_tex(egl_fb *fb, int width, int height,
                           GLuint texture, bool delete);
 void egl_fb_setup_new_tex(egl_fb *fb, int width, int height);