diff options
| author | 2011-08-12 12:23:44 -0700 | |
|---|---|---|
| committer | 2011-08-12 12:23:44 -0700 | |
| commit | 1b84e68a879534f084b544827f3969b0c6336f36 (patch) | |
| tree | c80ccd5ee23e9eae3f397c731db6bbbfb9fdad3a /services/surfaceflinger/Layer.cpp | |
| parent | d67fee861baf623a62ea61e3331230b2811f00b4 (diff) | |
| parent | 91b539801833012798b1998c30440136add7e7d4 (diff) | |
Merge "SurfaceFlinger doesn't rely on having a custom RefBase destructor"
Diffstat (limited to 'services/surfaceflinger/Layer.cpp')
| -rw-r--r-- | services/surfaceflinger/Layer.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp index 505c843a64e3..55b354d6c7f0 100644 --- a/services/surfaceflinger/Layer.cpp +++ b/services/surfaceflinger/Layer.cpp @@ -65,14 +65,9 @@ Layer::Layer(SurfaceFlinger* flinger, glGenTextures(1, &mTextureName); } -void Layer::destroy(RefBase const* base) { - mFlinger->destroyLayer(static_cast<LayerBase const*>(base)); -} - void Layer::onFirstRef() { LayerBaseClient::onFirstRef(); - setDestroyer(this); struct FrameQueuedListener : public SurfaceTexture::FrameAvailableListener { FrameQueuedListener(Layer* layer) : mLayer(layer) { } @@ -93,7 +88,16 @@ void Layer::onFirstRef() Layer::~Layer() { - glDeleteTextures(1, &mTextureName); + class MessageDestroyGLState : public MessageBase { + GLuint texture; + public: + MessageDestroyGLState(GLuint texture) : texture(texture) { } + virtual bool handler() { + glDeleteTextures(1, &texture); + return true; + } + }; + mFlinger->postMessageAsync( new MessageDestroyGLState(mTextureName) ); } void Layer::onFrameQueued() { |