diff options
author | 2014-12-10 16:47:36 -0800 | |
---|---|---|
committer | 2014-12-10 17:07:41 -0800 | |
commit | ebd52610cfeff6e557fde284a7e1efc5e6438285 (patch) | |
tree | 6e371646828e9074579fe91f869954a67f48e93a /libs/hwui/OpenGLRenderer.cpp | |
parent | fa3f43145ac1af62ed063d3cd7ba1c30a81bb3fd (diff) |
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
Diffstat (limited to 'libs/hwui/OpenGLRenderer.cpp')
-rwxr-xr-x | libs/hwui/OpenGLRenderer.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp index 075f2c509b24..62fdb93d73d5 100755 --- a/libs/hwui/OpenGLRenderer.cpp +++ b/libs/hwui/OpenGLRenderer.cpp @@ -2049,7 +2049,7 @@ status_t OpenGLRenderer::drawBitmapMesh(const SkBitmap* bitmap, int meshWidth, i } mCaches.activeTexture(0); - Texture* texture = mCaches.assetAtlas.getEntryTexture(bitmap); + Texture* texture = mRenderState.assetAtlas().getEntryTexture(bitmap); const UvMapper& mapper(getMapper(texture)); for (int32_t y = 0; y < meshHeight; y++) { @@ -2232,7 +2232,7 @@ status_t OpenGLRenderer::drawPatch(const SkBitmap* bitmap, const Res_png_9patch* return DrawGlInfo::kStatusDone; } - AssetAtlas::Entry* entry = mCaches.assetAtlas.getEntry(bitmap); + AssetAtlas::Entry* entry = mRenderState.assetAtlas().getEntry(bitmap); const Patch* mesh = mCaches.patchCache.get(entry, bitmap->width(), bitmap->height(), right - left, bottom - top, patch); @@ -3028,7 +3028,7 @@ const SkPaint* OpenGLRenderer::filterPaint(const SkPaint* paint) { /////////////////////////////////////////////////////////////////////////////// Texture* OpenGLRenderer::getTexture(const SkBitmap* bitmap) { - Texture* texture = mCaches.assetAtlas.getEntryTexture(bitmap); + Texture* texture = mRenderState.assetAtlas().getEntryTexture(bitmap); if (!texture) { return mCaches.textureCache.get(bitmap); } |