nested: Fix skipping frames due to texture update without a context
authorAnder Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Tue, 16 Jul 2013 11:24:04 +0000 (14:24 +0300)
committerKristian Høgsberg <krh@bitplanet.net>
Fri, 16 Aug 2013 17:56:00 +0000 (10:56 -0700)
commitd224bb92187fd3af930a3528c9cee91f16aa30dc
treea5ed27cd5e8f568b2b51e72d1de207b1f0992485
parent0d5fe3a2312624674b8484f8255ae5f6ed0fba72
nested: Fix skipping frames due to texture update without a context

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.
clients/nested.c