[RenderEngine] add an ImageManager thread
Prior to this change, EGLImage management would be performed by both binder threads and the main rendering thread in a synchronized manner. But because of BufferQueue implementation details, it's possible for an app's Surface to be disconnected (destroying all backing EGLImages per the disconnect api spec), while still latching and presenting the most recently queued image (which requires recreating the EGLImage on the main thread), which can cause jank in some scenarios such as app-launch. To mitigate this, defer EGLImage creation and destruction to a separate thread behind RenderEngine so that creating the EGLImage should never be done on the main thread. So scenarios such as app-launch avoid jank by performing the EGLImage creation asynchronously with the main thread, so that the creation is done by the time RenderEngine needs to start rendering. Bug: 136806342 Bug: 137191934 Test: Launching photos app shows no bindExternalImage* calls during the rendering path Test: librenderengine_test Change-Id: Ib809e36267b5604bbbedd4089d15666b22cabc95
Loading
Please register or sign in to comment