summaryrefslogtreecommitdiff
path: root/libs/hwui/DeferredLayerUpdater.h
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2014-05-29 18:56:11 -0700
committerJohn Reck <jreck@google.com>2014-05-30 12:19:33 -0700
commitd72e0a339b54af0c4e731513bbad120dff694723 (patch)
treeca8ac198de9a0cfeeae1e9e8039e35523e7810c3 /libs/hwui/DeferredLayerUpdater.h
parentaee470c0232afdac4256d13020fa0cf04f30395c (diff)
Re-jigger layers
Bug: 15185239 Bug: 15238382 Make DeferredLayerUpdater ref counted so that HardwareLayer:finalizer() works non-crashily on leaked layers Give DeferredLayerUpdater the ability to have a layer destroyer set so that leaked layers can still be recycled on the RenderThread Order layer updates based off of pushLayerUpdate() calls to fix issue with nested layers Change-Id: I4449cee607f7e5126e02fed7464cf48038e3dfdf
Diffstat (limited to 'libs/hwui/DeferredLayerUpdater.h')
-rw-r--r--libs/hwui/DeferredLayerUpdater.h14
1 files changed, 6 insertions, 8 deletions
diff --git a/libs/hwui/DeferredLayerUpdater.h b/libs/hwui/DeferredLayerUpdater.h
index cc62caa6dc86..b7cfe804564d 100644
--- a/libs/hwui/DeferredLayerUpdater.h
+++ b/libs/hwui/DeferredLayerUpdater.h
@@ -30,13 +30,15 @@
namespace android {
namespace uirenderer {
+typedef void (*LayerDestroyer)(Layer* layer);
+
// Container to hold the properties a layer should be set to at the start
// of a render pass
-class DeferredLayerUpdater {
+class DeferredLayerUpdater : public VirtualLightRefBase {
public:
// Note that DeferredLayerUpdater assumes it is taking ownership of the layer
// and will not call incrementRef on it as a result.
- ANDROID_API DeferredLayerUpdater(Layer* layer, OpenGLRenderer* renderer = 0);
+ ANDROID_API DeferredLayerUpdater(Layer* layer, LayerDestroyer = 0);
ANDROID_API ~DeferredLayerUpdater();
ANDROID_API bool setSize(uint32_t width, uint32_t height) {
@@ -83,12 +85,6 @@ public:
return mLayer;
}
- ANDROID_API Layer* detachBackingLayer() {
- Layer* layer = mLayer;
- mLayer = 0;
- return layer;
- }
-
private:
// Generic properties
uint32_t mWidth;
@@ -111,6 +107,8 @@ private:
Layer* mLayer;
Caches& mCaches;
+ LayerDestroyer mDestroyer;
+
void doUpdateTexImage();
};