Access VectorDrawableAtlas only on RenderThread
VectorDrawableAtlas dtor can run only on RenderThread, because
it releases GPU resources. It is usually CacheManager, which
destroys the atlas on RenderThread in response to trimMemory.
This CL fixes a rare situation, when a Java finalizer thread
deletes the atlas.
Bug: 137722646
Test: Manual testing on a device
Change-Id: I9d900809c23efaead9aaf16ee3306bc8c7c6b379
diff --git a/libs/hwui/renderthread/RenderThread.h b/libs/hwui/renderthread/RenderThread.h
index df7eeb3..5aa1af3 100644
--- a/libs/hwui/renderthread/RenderThread.h
+++ b/libs/hwui/renderthread/RenderThread.h
@@ -53,6 +53,10 @@
class VkFunctorDrawHandler;
}
+namespace VectorDrawable {
+class Tree;
+}
+
namespace renderthread {
class CanvasContext;
@@ -138,6 +142,7 @@
friend class android::uirenderer::TestUtils;
friend class android::uirenderer::WebViewFunctor;
friend class android::uirenderer::skiapipeline::VkFunctorDrawHandler;
+ friend class android::uirenderer::VectorDrawable::Tree;
RenderThread();
virtual ~RenderThread();