diff options
author | John Reck <jreck@google.com> | 2014-06-30 16:20:04 -0700 |
---|---|---|
committer | John Reck <jreck@google.com> | 2014-06-30 16:36:26 -0700 |
commit | f47a594f5250b1914c36423ee6b371f0b8db09d0 (patch) | |
tree | f86289c7b515c2111fde3ce11e7fca384bc2f603 /libs/hwui/renderthread/RenderProxy.cpp | |
parent | dd59aba6c7e142eae14d5f29ea6873a5b9790174 (diff) |
Fix onTrimMemory for HardwareRenderer
Also fixes detachFunctor possibly drawing after return
Bug: 15189843
Bug: 15990672
Change-Id: I64c48cb674c461a8eeaba407b697e09f72c98ce3
Diffstat (limited to 'libs/hwui/renderthread/RenderProxy.cpp')
-rw-r--r-- | libs/hwui/renderthread/RenderProxy.cpp | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/libs/hwui/renderthread/RenderProxy.cpp b/libs/hwui/renderthread/RenderProxy.cpp index e1ee62058d28..6cd3d0bdb96b 100644 --- a/libs/hwui/renderthread/RenderProxy.cpp +++ b/libs/hwui/renderthread/RenderProxy.cpp @@ -312,18 +312,30 @@ void RenderProxy::detachSurfaceTexture(DeferredLayerUpdater* layer) { postAndWait(task); } -CREATE_BRIDGE2(flushCaches, CanvasContext* context, Caches::FlushMode flushMode) { - args->context->flushCaches(args->flushMode); +CREATE_BRIDGE1(destroyHardwareResources, CanvasContext* context) { + args->context->destroyHardwareResources(); return NULL; } -void RenderProxy::flushCaches(Caches::FlushMode flushMode) { - SETUP_TASK(flushCaches); +void RenderProxy::destroyHardwareResources() { + SETUP_TASK(destroyHardwareResources); args->context = mContext; - args->flushMode = flushMode; post(task); } +CREATE_BRIDGE2(timMemory, RenderThread* thread, int level) { + CanvasContext::trimMemory(*args->thread, args->level); + return NULL; +} + +void RenderProxy::trimMemory(int level) { + RenderThread& thread = RenderThread::getInstance(); + SETUP_TASK(timMemory); + args->thread = &thread; + args->level = level; + thread.queue(task); +} + CREATE_BRIDGE0(fence) { // Intentionally empty return NULL; @@ -334,6 +346,17 @@ void RenderProxy::fence() { postAndWait(task); } +CREATE_BRIDGE1(stopDrawing, CanvasContext* context) { + args->context->stopDrawing(); + return NULL; +} + +void RenderProxy::stopDrawing() { + SETUP_TASK(stopDrawing); + args->context = mContext; + postAndWait(task); +} + CREATE_BRIDGE1(notifyFramePending, CanvasContext* context) { args->context->notifyFramePending(); return NULL; |