From 56338e6791747d7c23fe7fd4e216d7755a18fa43 Mon Sep 17 00:00:00 2001 From: Derek Sollenberger Date: Thu, 9 Dec 2010 11:32:41 -0500 Subject: 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 --- .../graphics/android/BackedDoubleBufferedTexture.cpp | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'WebCore/platform/graphics/android/BackedDoubleBufferedTexture.cpp') 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(); -- cgit v1.1