Skip to content
  • Ander Conselvan de Oliveira's avatar
    nested: Fix skipping frames due to texture update without a context · d224bb92
    Ander Conselvan de Oliveira authored
    Calls into cairo-gles may change the current context, so it was only by
    chance that sometimes we had the proper one as current and updated the
    correct texture in surface_attach().
    
    In order to fix this, calling display_acquire_window_surface() before
    binding the texture for setup is necessary. However this call has the
    side effect of allocating a cairo surface for the window. At flush time,
    the existence of this surface will cause an eglSwapBuffers(), even
    if no rendering was done to it, leading to undefined contents on the
    screen. This happens when the idle redraw task runs while there is a
    pending frame callback.
    
    Workaround this by moving the texture setup from surface_attach() to the
    redraw handler, so that the cairo surface is only allocated when
    redering is done.
    d224bb92