[Mesa-dev] [PATCH] wayland/egl: initialize window surface size to window size

Daniel Stone daniel at fooishbar.org
Mon Aug 6 15:02:54 UTC 2018

Hi Juan,

On Tue, 5 Jun 2018 at 18:23, Juan A. Suarez Romero <jasuarez at igalia.com> wrote:
> On Tue, 2018-06-05 at 12:41 +0100, Daniel Stone wrote:
> > > - In Wayland/Mesa, the surface is not resized at the time the native window is
> > > resized; this is done in *eglSwapBuffers*, following
> >
> > Disagree, given that we are in charge of exactly when the native
> > window is 'resized'. It's unclear to me what 'resize the surface prior
> > to copying its pixels to the native window' even means: does this
> > require we do a scale blit, or a crop blit, or?
> >
> > The semantics Mesa has interpreted until recently is that
> > wl_egl_resize_window() constitutes a resize _request_, and that the
> > last submitted request is acted upon and latched at the first draw
> > call. This then constitutes the native surface size up until the next
> > first draw call. I think these are good semantics, and we have to be
> > quite picky about what exactly we implement, since clients rely on
> > them. Not just cosmetically (atomic resizing of subsurface chains),
> > but also because if you get your window sizing wrong on the desktop,
> > you'll catch a fatal error from the compositor (X11 just shrugs and
> > does nothing).
> >
> > I think these are good semantics (as to exactly when resize takes
> > effect), but for the moment we only update the EGL_{WIDTH,HEIGHT}
> > surface query results after the first draw call. I would suggest that
> > in the period after eglSwapBuffers but before the first draw call, we
> > also update those values, and that we update them after eglSwapBuffers
> > has executed as well. This makes the semantics that any native window
> > resize requests take effect immediately after eglSwapBuffers (or just
> > immediately, if no swap has ever been executed) and before the first
> > draw call (or buffer_age query ... cf. 9ca6711faa03) for a given
> > frame; in between the first draw call and eglSwapBuffers, the native
> > resize requests will be queued until after eglSwapBuffers.
> I see. The surface size should be updated inmediately, after a window resize is
> done, as you said.
> I'll send then a new patch version. Actually I'll split this patch in two: one
> to correctly initialize the surface size (there is no doubt on this, and this
> patch alone will fix the test), and another patch to correctly update the
> surface size when the window is resized.

I think the v3 2/2 patch doesn't actually conform to this behaviour,
as it unconditionally sets the surface width/height from
wl_egl_window_resize() rather than waiting until the resized buffers
are actually going to take effect.


More information about the mesa-dev mailing list