summaryrefslogtreecommitdiff
path: root/libs/hwui/OpenGLRenderer.cpp
diff options
context:
space:
mode:
author Romain Guy <romainguy@google.com> 2010-11-11 15:36:56 -0800
committer Romain Guy <romainguy@google.com> 2010-11-11 15:36:56 -0800
commitfe48f65922d4a3cc4aefe058cee5acec51504a20 (patch)
tree97ea23ae71dade1ef7bf783523bea9cda31dd042 /libs/hwui/OpenGLRenderer.cpp
parent50c5e4c36e494d092576d42cf2b406abab20510a (diff)
Free resources only from the GL context thread.
Bug #3179882 Resources were freed following garbage collections on a worker thread. This worker thread had no EGL context, which would cause the renderer to incorrectly assume that the memory was liberated. Change-Id: Ifdb51f94ddf42641e8654522787bfac532976c7c
Diffstat (limited to 'libs/hwui/OpenGLRenderer.cpp')
-rw-r--r--libs/hwui/OpenGLRenderer.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp
index acce1a2155fe..ad7258446509 100644
--- a/libs/hwui/OpenGLRenderer.cpp
+++ b/libs/hwui/OpenGLRenderer.cpp
@@ -135,6 +135,8 @@ void OpenGLRenderer::setViewport(int width, int height) {
}
void OpenGLRenderer::prepare(bool opaque) {
+ mCaches.clearGarbage();
+
mSnapshot = new Snapshot(mFirstSnapshot,
SkCanvas::kMatrix_SaveFlag | SkCanvas::kClip_SaveFlag);
mSaveCount = 1;