diff options
author | 2017-02-13 14:34:15 -0800 | |
---|---|---|
committer | 2017-02-13 14:41:20 -0800 | |
commit | 00eb43dbc04083eab85fbb1a9589e2548f2004ed (patch) | |
tree | eacfad9a4749612efa65d8e15740942fd67f9b85 /libs/hwui/GlLayer.cpp | |
parent | 962230dd82e360916e848d7a27b208b24a1c66e1 (diff) |
DeferredLayerUpdater: clean up Layer lifecycle
Test: refactoring CL, all existent tests should pass
bug:34919311
Change-Id: Ib2889667a5ab8a2aaba443458782bc163467f0ea
Diffstat (limited to 'libs/hwui/GlLayer.cpp')
-rw-r--r-- | libs/hwui/GlLayer.cpp | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/libs/hwui/GlLayer.cpp b/libs/hwui/GlLayer.cpp index 8174bcc35d97..aacad548c68b 100644 --- a/libs/hwui/GlLayer.cpp +++ b/libs/hwui/GlLayer.cpp @@ -43,7 +43,10 @@ GlLayer::GlLayer(RenderState& renderState, uint32_t layerWidth, uint32_t layerHe } GlLayer::~GlLayer() { - if (texture.mId) { + // There's a rare possibility that Caches could have been destroyed already + // since this method is queued up as a task. + // Since this is a reset method, treat this as non-fatal. + if (caches.isInitialized() && texture.mId) { texture.deleteTexture(); } } @@ -64,15 +67,5 @@ void GlLayer::generateTexture() { } } -void GlLayer::clearTexture() { - // There's a rare possibility that Caches could have been destroyed already - // since this method is queued up as a task. - // Since this is a reset method, treat this as non-fatal. - if (caches.isInitialized()) { - caches.textureState().unbindTexture(texture.mId); - } - texture.mId = 0; -} - }; // namespace uirenderer }; // namespace android |