diff options
author | Derek Sollenberger <djsollen@google.com> | 2010-12-09 11:32:41 -0500 |
---|---|---|
committer | Derek Sollenberger <djsollen@google.com> | 2010-12-09 13:20:34 -0500 |
commit | 56338e6791747d7c23fe7fd4e216d7755a18fa43 (patch) | |
tree | bfb1653800735ee4e95d541668b7a98aeee3a1bb /WebCore/platform/graphics/android/BackedDoubleBufferedTexture.cpp | |
parent | 8a8bcba6421d62a32ffbc3a2461cb978d522dbdc (diff) | |
download | external_webkit-56338e6791747d7c23fe7fd4e216d7755a18fa43.zip external_webkit-56338e6791747d7c23fe7fd4e216d7755a18fa43.tar.gz external_webkit-56338e6791747d7c23fe7fd4e216d7755a18fa43.tar.bz2 |
Refactor recent changes to SharedTexture and TilesManager.
These changes are directly related to the comments found in this
CL --> https://android-git.corp.google.com/g/#change,83984
Change-Id: Ida0acb772f9bcaa4f4f5b394676d45b27f4149d2
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(); |