Mir

Activity log for bug #1288021

Date Who What changed Old value New value Message
2014-03-05 02:24:50 Daniel van Vugt bug added bug
2015-02-23 16:58:43 Marco Trevisan (Treviño) bug added subscriber Marco Trevisan (Treviño)
2015-09-01 04:30:29 Daniel van Vugt tags clientapi clientapi resize
2015-10-09 09:15:02 Daniel van Vugt mir: assignee Daniel van Vugt (vanvugt)
2015-10-09 09:17:30 Daniel van Vugt summary MirResizeEvent's width/height fields are not useful, even dangerous MirResizeEvent's width/height fields are not in sync with the next buffer the client receives
2015-10-16 03:48:00 Daniel van Vugt description MirResizeEvent's width/height fields are not useful, even dangerous. This is because they represent the latest dimensions of a surface. However, due to compositing and frame scheduling, MirResizeEvent arrives a significant time before the client gets any buffers with the new dimensions. So if the client actually tries to use the width/height provided in MirResizeEvent, it will render incorrectly with ugly artefacts. Clients should always be using the latest _buffer_ dimensions, and not the latest surface dimensions. As demonstrated in examples/* the latest buffer dimensions are available via: mir_buffer_usage_software: Use the width/height returned by mir_surface_get_graphics_region(). mir_buffer_usage_hardware: Use the actual buffer dimensions as accurately reported by EGL as soon as you get a new buffer from eglSwapBuffers: eglSwapBuffers(egldisplay, eglsurface); if (eglQuerySurface(egldisplay, eglsurface, EGL_WIDTH, &width) && eglQuerySurface(egldisplay, eglsurface, EGL_HEIGHT, &height)) { glViewport(0, 0, width, height); } This is current best practice, and will result in smooth client resizing. Unfortunately it means the width/height fields in the MirResizeEvent structure should be ignored. Perhaps we need to deprecate them, or perhaps we should enhance them to represent buffer dimensions instead... MirResizeEvent's width/height fields are not in sync with the next buffer the client receives. This is because they represent the latest dimensions of a surface. However, due to compositing and frame scheduling, MirResizeEvent arrives a significant time before the client gets any buffers with the new dimensions. So if the client actually tries to use the width/height provided in MirResizeEvent, it will render incorrectly with ugly artefacts. Clients should always be using the latest _buffer_ dimensions, and not the latest surface dimensions. As demonstrated in examples/* the latest buffer dimensions are available via: mir_buffer_usage_software: Use the width/height returned by mir_surface_get_graphics_region(). mir_buffer_usage_hardware: Use the actual buffer dimensions as accurately reported by EGL as soon as you get a new buffer from eglSwapBuffers:     eglSwapBuffers(egldisplay, eglsurface);     if (eglQuerySurface(egldisplay, eglsurface, EGL_WIDTH, &width) &&         eglQuerySurface(egldisplay, eglsurface, EGL_HEIGHT, &height))     {         glViewport(0, 0, width, height);     } This is current best practice, and will result in smooth client resizing. Unfortunately it means the width/height fields in the MirResizeEvent structure should be ignored. Perhaps we need to deprecate them, or perhaps we should enhance them to represent buffer dimensions instead...
2015-10-16 03:58:17 Daniel van Vugt tags clientapi resize clientapi resize xmir
2016-04-26 01:28:15 Daniel van Vugt mir: assignee Daniel van Vugt (vanvugt)
2017-11-03 16:20:51 Michał Sawicz mir (Ubuntu): importance Undecided Medium
2017-11-03 16:20:51 Michał Sawicz mir (Ubuntu): status New Triaged