summaryrefslogtreecommitdiff
path: root/libs/hwui/renderstate/RenderState.cpp
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2017-05-22 15:04:21 -0700
committerJohn Reck <jreck@google.com>2017-05-22 17:17:05 -0700
commit9a814875c4e3a98fea99dae623f22268a9afa38a (patch)
tree5d9a07eb07cdacea805609a723f9b35537010420 /libs/hwui/renderstate/RenderState.cpp
parent3915e25d41ce40f24fd41d8bcd6a058403d0bbc5 (diff)
Improve time to texture destruction
Eliminate textureCache.mGarbage which is only cleared in a trimMemory. Instead when we hit ~Bitmap post a message to RenderThread to release the texture immediately Bug: 38258699 Test: manual Change-Id: I962ba275e89afb628ba02f74769287edbab9fed4
Diffstat (limited to 'libs/hwui/renderstate/RenderState.cpp')
-rw-r--r--libs/hwui/renderstate/RenderState.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/libs/hwui/renderstate/RenderState.cpp b/libs/hwui/renderstate/RenderState.cpp
index c8833d2a7489..b89272ebd486 100644
--- a/libs/hwui/renderstate/RenderState.cpp
+++ b/libs/hwui/renderstate/RenderState.cpp
@@ -122,6 +122,13 @@ void RenderState::flush(Caches::FlushMode mode) {
mCaches->flush(mode);
}
+void RenderState::onBitmapDestroyed(uint32_t pixelRefId) {
+ if (mCaches->textureCache.destroyTexture(pixelRefId)) {
+ glFlush();
+ GL_CHECKPOINT(MODERATE);
+ }
+}
+
void RenderState::setViewport(GLsizei width, GLsizei height) {
mViewportWidth = width;
mViewportHeight = height;