diff options
Diffstat (limited to 'WebCore/platform/graphics/android/BackedDoubleBufferedTexture.cpp')
-rw-r--r-- | WebCore/platform/graphics/android/BackedDoubleBufferedTexture.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/WebCore/platform/graphics/android/BackedDoubleBufferedTexture.cpp b/WebCore/platform/graphics/android/BackedDoubleBufferedTexture.cpp index 02168a9..ced0c2e 100644 --- a/WebCore/platform/graphics/android/BackedDoubleBufferedTexture.cpp +++ b/WebCore/platform/graphics/android/BackedDoubleBufferedTexture.cpp @@ -25,8 +25,9 @@ #include "config.h" #include "BackedDoubleBufferedTexture.h" - #include "BaseTile.h" +#include "DeleteTextureOperation.h" +#include "TilesManager.h" #include "GLUtils.h" #define LOG_NDEBUG 1 @@ -54,6 +55,23 @@ BackedDoubleBufferedTexture::~BackedDoubleBufferedTexture() delete m_canvas; } +void BackedDoubleBufferedTexture::onDestroy(SharedTexture** textures) +{ + int x = 0; + while (textures[x] != 0) { + // We need to delete the source texture and EGLImage in the texture + // generation thread. In theory we should be able to delete the EGLImage + // from either thread, but it currently throws an error if not deleted + // in the same EGLContext from which it was created. + textures[x]->lock(); + DeleteTextureOperation* operation = new DeleteTextureOperation( + textures[x]->getSourceTextureId(), textures[x]->getEGLImage()); + textures[x]->unlock(); + TilesManager::instance()->scheduleOperation(operation); + x++; + } +} + TextureInfo* BackedDoubleBufferedTexture::producerLock() { m_busyLock.lock(); |