summaryrefslogtreecommitdiffstats
path: root/libs/hwui
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2014-06-27 14:45:25 -0700
committerJohn Reck <jreck@google.com>2014-06-27 22:34:16 +0000
commit918ad523b2780e0c893f3d2a32d4ec13f2a7e921 (patch)
treea10eb15752acf14bbf50b6e250ca8e8beeb2f736 /libs/hwui
parent81af3aef9a0d015311f6c97e318c81092c74eb47 (diff)
downloadframeworks_base-918ad523b2780e0c893f3d2a32d4ec13f2a7e921.zip
frameworks_base-918ad523b2780e0c893f3d2a32d4ec13f2a7e921.tar.gz
frameworks_base-918ad523b2780e0c893f3d2a32d4ec13f2a7e921.tar.bz2
More cleanups
Change-Id: Id5967944b949a2aec57e4fe9fdcdc04c11b8c35a
Diffstat (limited to 'libs/hwui')
-rw-r--r--libs/hwui/DeferredLayerUpdater.cpp8
-rw-r--r--libs/hwui/DeferredLayerUpdater.h2
-rw-r--r--libs/hwui/renderthread/RenderProxy.cpp11
-rw-r--r--libs/hwui/renderthread/RenderProxy.h1
4 files changed, 22 insertions, 0 deletions
diff --git a/libs/hwui/DeferredLayerUpdater.cpp b/libs/hwui/DeferredLayerUpdater.cpp
index 02b0372..836de45 100644
--- a/libs/hwui/DeferredLayerUpdater.cpp
+++ b/libs/hwui/DeferredLayerUpdater.cpp
@@ -119,5 +119,13 @@ void DeferredLayerUpdater::doUpdateTexImage() {
}
}
+void DeferredLayerUpdater::detachSurfaceTexture() {
+ if (mSurfaceTexture.get()) {
+ mSurfaceTexture->detachFromContext();
+ mSurfaceTexture = 0;
+ mLayer->clearTexture();
+ }
+}
+
} /* namespace uirenderer */
} /* namespace android */
diff --git a/libs/hwui/DeferredLayerUpdater.h b/libs/hwui/DeferredLayerUpdater.h
index 5905b95..c838c32 100644
--- a/libs/hwui/DeferredLayerUpdater.h
+++ b/libs/hwui/DeferredLayerUpdater.h
@@ -81,6 +81,8 @@ public:
return mLayer;
}
+ ANDROID_API void detachSurfaceTexture();
+
private:
// Generic properties
uint32_t mWidth;
diff --git a/libs/hwui/renderthread/RenderProxy.cpp b/libs/hwui/renderthread/RenderProxy.cpp
index f90a26a..e1ee620 100644
--- a/libs/hwui/renderthread/RenderProxy.cpp
+++ b/libs/hwui/renderthread/RenderProxy.cpp
@@ -301,6 +301,17 @@ void RenderProxy::cancelLayerUpdate(DeferredLayerUpdater* layer) {
mDrawFrameTask.removeLayerUpdate(layer);
}
+CREATE_BRIDGE1(detachSurfaceTexture, DeferredLayerUpdater* layer) {
+ args->layer->detachSurfaceTexture();
+ return NULL;
+}
+
+void RenderProxy::detachSurfaceTexture(DeferredLayerUpdater* layer) {
+ SETUP_TASK(detachSurfaceTexture);
+ args->layer = layer;
+ postAndWait(task);
+}
+
CREATE_BRIDGE2(flushCaches, CanvasContext* context, Caches::FlushMode flushMode) {
args->context->flushCaches(args->flushMode);
return NULL;
diff --git a/libs/hwui/renderthread/RenderProxy.h b/libs/hwui/renderthread/RenderProxy.h
index df0aff0..c7358e6 100644
--- a/libs/hwui/renderthread/RenderProxy.h
+++ b/libs/hwui/renderthread/RenderProxy.h
@@ -83,6 +83,7 @@ public:
ANDROID_API bool copyLayerInto(DeferredLayerUpdater* layer, SkBitmap* bitmap);
ANDROID_API void pushLayerUpdate(DeferredLayerUpdater* layer);
ANDROID_API void cancelLayerUpdate(DeferredLayerUpdater* layer);
+ ANDROID_API void detachSurfaceTexture(DeferredLayerUpdater* layer);
ANDROID_API void flushCaches(Caches::FlushMode flushMode);