Skip to content

Fix buffer age checks on multiple monitors

Carlos Garnacho requested to merge wip/carlosg/fix-multimonitor-buffer-age into master

From the main commit:

    cogl/egl: Make surface current before querying buffer age
    
    Unknown since when, we started deferring the eglMakeCurrent for the
    current framebuffer till we started painting on it, which means we
    are preparing for rendering a view without guarantees that the
    framebuffer we will paint to is the current drawing surface for the
    EGL context.
    
    A fairly common case where that assumption will break is multimonitor
    set ups, in this case we will be preparing to paint to a view while
    the current draw surface is that of the previously rendered view's.
    
    Mesa will in this case return EGL_BAD_SURFACE when querying the buffer
    age, since the surface is not yet the current draw surface. This
    makes us give up on buffer age checks, and paint the whole view. Since
    the problem repeats when painting the next view, we are effectively
    doing full-screen redraws on all monitors.
    
    Since cogl usually works implicitly, and querying the buffer age is
    meaningless if you're not meant to paint on a surface, make the surface
    the current draw surface implicitly before querying the buffer age.
    
    This brings us glorious partial invalidations back when several views
    had to be repainted.

Merge request reports