Don't preload textures for AssetAtlas
Bug: 18317479
RenderNode::prepareSubTree calls prefetchAndMarkInUse
on every bitmapResoruce in the DisplayList. However,
this resulted in textures being uploaded for bitmaps
that would be drawn from the AssetAtlas instead.
To fix this we teach TextureCache about the AssetAtlas
so that calls to TextureCache return the Texture from
AssetAtlas if it exists. Thus usage of AssetAtlas
is now purely to allow for further optimizations via
draw merging instead of a requirement to get
any benefit at all.
Change-Id: I65282fa05bac46f4e93822b3467ffa0261ccf200
diff --git a/libs/hwui/RenderState.h b/libs/hwui/RenderState.h
index afeef95..1ecfb1c 100644
--- a/libs/hwui/RenderState.h
+++ b/libs/hwui/RenderState.h
@@ -23,6 +23,7 @@
#include <private/hwui/DrawGlInfo.h>
+#include "AssetAtlas.h"
#include "Caches.h"
#include "utils/Macros.h"
@@ -73,6 +74,8 @@
// more thinking...
void postDecStrong(VirtualLightRefBase* object);
+ AssetAtlas& assetAtlas() { return mAssetAtlas; }
+
private:
friend class renderthread::RenderThread;
friend class Caches;
@@ -86,6 +89,7 @@
renderthread::RenderThread& mRenderThread;
Caches* mCaches;
+ AssetAtlas mAssetAtlas;
std::set<const Layer*> mActiveLayers;
std::set<renderthread::CanvasContext*> mRegisteredContexts;