diff options
author | John Reck <jreck@google.com> | 2014-05-23 15:11:19 -0700 |
---|---|---|
committer | John Reck <jreck@google.com> | 2014-05-23 15:40:14 -0700 |
commit | e1628b7c6fc3822fa83cf02028ce8ad67abb0afe (patch) | |
tree | 096479f24da83593cab3505bde3aa8688e3b8f10 /libs | |
parent | ec41d7ababd3145b7f19e5bd69480e9436cb5c7c (diff) | |
download | frameworks_base-e1628b7c6fc3822fa83cf02028ce8ad67abb0afe.zip frameworks_base-e1628b7c6fc3822fa83cf02028ce8ad67abb0afe.tar.gz frameworks_base-e1628b7c6fc3822fa83cf02028ce8ad67abb0afe.tar.bz2 |
Implement FlushCaches TODO
Change-Id: Id05429e98ffe0858275b32c41fb215c1d8d930b2
Diffstat (limited to 'libs')
-rw-r--r-- | libs/hwui/renderthread/CanvasContext.cpp | 7 | ||||
-rw-r--r-- | libs/hwui/renderthread/CanvasContext.h | 2 | ||||
-rw-r--r-- | libs/hwui/renderthread/RenderProxy.cpp | 12 | ||||
-rw-r--r-- | libs/hwui/renderthread/RenderProxy.h | 3 |
4 files changed, 24 insertions, 0 deletions
diff --git a/libs/hwui/renderthread/CanvasContext.cpp b/libs/hwui/renderthread/CanvasContext.cpp index b6b3428..160fbea 100644 --- a/libs/hwui/renderthread/CanvasContext.cpp +++ b/libs/hwui/renderthread/CanvasContext.cpp @@ -556,6 +556,13 @@ bool CanvasContext::copyLayerInto(DeferredLayerUpdater* layer, SkBitmap* bitmap) return LayerRenderer::copyLayer(layer->backingLayer(), bitmap); } +void CanvasContext::flushCaches(Caches::FlushMode flushMode) { + if (mGlobalContext->hasContext()) { + requireGlContext(); + Caches::getInstance().flush(flushMode); + } +} + void CanvasContext::runWithGlContext(RenderTask* task) { requireGlContext(); task->run(); diff --git a/libs/hwui/renderthread/CanvasContext.h b/libs/hwui/renderthread/CanvasContext.h index a54b33e..da85d44 100644 --- a/libs/hwui/renderthread/CanvasContext.h +++ b/libs/hwui/renderthread/CanvasContext.h @@ -63,6 +63,8 @@ public: bool copyLayerInto(DeferredLayerUpdater* layer, SkBitmap* bitmap); + void flushCaches(Caches::FlushMode flushMode); + void invokeFunctor(Functor* functor); void runWithGlContext(RenderTask* task); diff --git a/libs/hwui/renderthread/RenderProxy.cpp b/libs/hwui/renderthread/RenderProxy.cpp index 2e103d8..8e772f2 100644 --- a/libs/hwui/renderthread/RenderProxy.cpp +++ b/libs/hwui/renderthread/RenderProxy.cpp @@ -282,6 +282,18 @@ void RenderProxy::destroyLayer(DeferredLayerUpdater* layer) { post(task); } +CREATE_BRIDGE2(flushCaches, CanvasContext* context, Caches::FlushMode flushMode) { + args->context->flushCaches(args->flushMode); + return NULL; +} + +void RenderProxy::flushCaches(Caches::FlushMode flushMode) { + SETUP_TASK(flushCaches); + args->context = mContext; + args->flushMode = flushMode; + post(task); +} + CREATE_BRIDGE0(fence) { // Intentionally empty return NULL; diff --git a/libs/hwui/renderthread/RenderProxy.h b/libs/hwui/renderthread/RenderProxy.h index 8aeb264..22d4e22 100644 --- a/libs/hwui/renderthread/RenderProxy.h +++ b/libs/hwui/renderthread/RenderProxy.h @@ -29,6 +29,7 @@ #include <utils/StrongPointer.h> #include <utils/Vector.h> +#include "../Caches.h" #include "DrawFrameTask.h" namespace android { @@ -81,6 +82,8 @@ public: ANDROID_API bool copyLayerInto(DeferredLayerUpdater* layer, SkBitmap* bitmap); ANDROID_API void destroyLayer(DeferredLayerUpdater* layer); + ANDROID_API void flushCaches(Caches::FlushMode flushMode); + ANDROID_API void fence(); ANDROID_API void notifyFramePending(); |