ui/cocoa: Use the pixman image directly in switchSurface
commit72a3e316daaddddf51b3dd35c72333f9503be397
authorPeter Maydell <peter.maydell@linaro.org>
Mon, 25 Feb 2019 10:24:28 +0000 (25 10:24 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Mon, 4 Mar 2019 16:47:31 +0000 (4 16:47 +0000)
tree1741abc3200cf97a175e8e8c70c017bd59583dce
parent31819e95095798382cdb5a0881f5f934a8f05476
ui/cocoa: Use the pixman image directly in switchSurface

Currently the switchSurface method takes a DisplaySurface. We want
to change our DisplayChangeListener's dpy_gfx_switch callback
to do this work asynchronously on a different thread. The caller
of the switch callback will free the old DisplaySurface
immediately the callback returns, so to ensure that the
other thread doesn't access freed data we need to switch
to using the underlying pixman image instead. The pixman
image is reference counted, so we will be able to take
a reference to it to avoid it vanishing too early.

In this commit we only change the switchSurface method
to take a pixman image, and keep the flow of control
synchronous for now.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: BALATON Zoltan <balaton@eik.bme.hu>
Reviewed-by: Roman Bolshakov <r.bolshakov@yadro.com>
Tested-by: Roman Bolshakov <r.bolshakov@yadro.com>
Message-id: 20190225102433.22401-3-peter.maydell@linaro.org
Message-id: 20190214102816.3393-3-peter.maydell@linaro.org
ui/cocoa.m