From ebd52610cfeff6e557fde284a7e1efc5e6438285 Mon Sep 17 00:00:00 2001 From: John Reck Date: Wed, 10 Dec 2014 16:47:36 -0800 Subject: 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 --- libs/hwui/RenderState.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libs/hwui/RenderState.cpp') diff --git a/libs/hwui/RenderState.cpp b/libs/hwui/RenderState.cpp index a8cf26f0d5da..d1f5f4e0fdd2 100644 --- a/libs/hwui/RenderState.cpp +++ b/libs/hwui/RenderState.cpp @@ -38,6 +38,7 @@ void RenderState::onGLContextCreated() { mCaches = &Caches::getInstance(); mCaches->init(); mCaches->setRenderState(this); + mCaches->textureCache.setAssetAtlas(&mAssetAtlas); } void RenderState::onGLContextDestroyed() { @@ -72,6 +73,7 @@ void RenderState::onGLContextDestroyed() { LOG_ALWAYS_FATAL("%d layers have survived gl context destruction", size); } */ + mAssetAtlas.terminate(); } void RenderState::setViewport(GLsizei width, GLsizei height) { -- cgit v1.2.3-59-g8ed1b