[RenderEngine] relax locking conditions of image cache.
RenderEngine::drawLayers is currently only called on the main thread,
and layers should not be destroyed while the main thread is running, so
we don't need to lock during the entirety of rendering.
Note that with this change there is still some jank because GPU
rendering does take a long time, but it's not nearly as bad as before.
Bug: 136806342
Test: open photos a bunch of times
Change-Id: I66d52c07f31ccf350dec4df665364868350e13c0
diff --git a/libs/renderengine/gl/GLESRenderEngine.h b/libs/renderengine/gl/GLESRenderEngine.h
index de793c2..d6eab6c 100644
--- a/libs/renderengine/gl/GLESRenderEngine.h
+++ b/libs/renderengine/gl/GLESRenderEngine.h
@@ -85,8 +85,7 @@
bool useProtectedContext(bool useProtectedContext) override;
status_t drawLayers(const DisplaySettings& display, const std::vector<LayerSettings>& layers,
ANativeWindowBuffer* buffer, const bool useFramebufferCache,
- base::unique_fd&& bufferFence, base::unique_fd* drawFence)
- EXCLUDES(mRenderingMutex) override;
+ base::unique_fd&& bufferFence, base::unique_fd* drawFence) override;
// internal to RenderEngine
EGLDisplay getEGLDisplay() const { return mEGLDisplay; }
@@ -220,15 +219,6 @@
// multiple threads is guaranteed thread-safe.
std::mutex mRenderingMutex;
- // See bindExternalTextureBuffer above, but requiring that mRenderingMutex
- // is held.
- status_t bindExternalTextureBufferLocked(uint32_t texName, const sp<GraphicBuffer>& buffer,
- const sp<Fence>& fence) REQUIRES(mRenderingMutex);
- // See cacheExternalTextureBuffer above, but requiring that mRenderingMutex
- // is held.
- status_t cacheExternalTextureBufferLocked(const sp<GraphicBuffer>& buffer)
- REQUIRES(mRenderingMutex);
-
std::unique_ptr<Framebuffer> mDrawingBuffer;
class FlushTracer {