Mesa (staging/18.1): wayland/egl: initialize window surface size to window size

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Aug 9 16:02:18 UTC 2018


Module: Mesa
Branch: staging/18.1
Commit: 4395919bd95501a13ba2fffa0cd00de0f73e0d38
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=4395919bd95501a13ba2fffa0cd00de0f73e0d38

Author: Juan A. Suarez Romero <jasuarez at igalia.com>
Date:   Mon Jun  4 10:22:49 2018 +0000

wayland/egl: initialize window surface size to window size

When creating a windows surface with eglCreateWindowSurface(), the
width and height returned by eglQuerySurface(EGL_{WIDTH,HEIGHT}) is
invalid until buffers are updated (like calling glClear()).

But according to EGL 1.5 spec, section 3.5.6 ("Surface Attributes"):

  "Querying EGL_WIDTH and EGL_HEIGHT returns respectively the width and
   height, in pixels, of the surface. For a window or pixmap surface,
   these values are initially equal to the width and height of the
   native window or pixmap with respect to which the surface was
   created"

This fixes dEQP-EGL.functional.color_clears.* CTS tests

v2:
- Do not modify attached_{width,height} (Daniel)
- Do not update size on resizing window (Brendan)

CC: Daniel Stone <daniel at fooishbar.org>
CC: Brendan King <brendan.king at imgtec.com>
CC: mesa-stable at lists.freedesktop.org
Tested-by: Eric Engestrom <eric at engestrom.ch>
Tested-by: Chad Versace <chadversary at chromium.org>
Reviewed-by: Chad Versace <chadversary at chromium.org>
Reviewed-by: Daniel Stone <daniels at collabora.com>
(cherry picked from commit 1fe7cbdf05b90034577dac4e4aa6157031d80521)
Conflicts resolved by Dylan

Conflicts:
	src/egl/drivers/dri2/platform_wayland.c

---

 src/egl/drivers/dri2/platform_wayland.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c
index cb5314f3db..8b6975f5fb 100644
--- a/src/egl/drivers/dri2/platform_wayland.c
+++ b/src/egl/drivers/dri2/platform_wayland.c
@@ -260,6 +260,10 @@ dri2_wl_create_window_surface(_EGLDriver *drv, _EGLDisplay *disp,
 
    config = dri2_get_dri_config(dri2_conf, EGL_WINDOW_BIT,
                                 dri2_surf->base.GLColorspace);
+
+   dri2_surf->base.Width = window->width;
+   dri2_surf->base.Height = window->height;
+
    visual_idx = dri2_wl_visual_idx_from_config(dri2_dpy, config);
    assert(visual_idx != -1);
 




More information about the mesa-commit mailing list