summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/graphics/android
diff options
context:
space:
mode:
authorNicolas Roard <nicolas@android.com>2010-12-13 10:19:28 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2010-12-13 10:19:28 -0800
commit97b3a15064089a16c787d230d6dcd24c8231e3bc (patch)
tree99a46f8c528f6a897ef6cfa1ec2fe8cfe5c3ed46 /WebCore/platform/graphics/android
parent6c5f919ea53c0c48f3ee00d4dbc297eba9c1d44e (diff)
parente846e5780f8a50e85389d25846b866ba79e85e14 (diff)
downloadexternal_webkit-97b3a15064089a16c787d230d6dcd24c8231e3bc.zip
external_webkit-97b3a15064089a16c787d230d6dcd24c8231e3bc.tar.gz
external_webkit-97b3a15064089a16c787d230d6dcd24c8231e3bc.tar.bz2
Merge "Fix onDestroy()"
Diffstat (limited to 'WebCore/platform/graphics/android')
-rw-r--r--WebCore/platform/graphics/android/BackedDoubleBufferedTexture.cpp9
-rw-r--r--WebCore/platform/graphics/android/BackedDoubleBufferedTexture.h6
-rw-r--r--WebCore/platform/graphics/android/DoubleBufferedTexture.cpp2
-rw-r--r--WebCore/platform/graphics/android/DoubleBufferedTexture.h8
4 files changed, 13 insertions, 12 deletions
diff --git a/WebCore/platform/graphics/android/BackedDoubleBufferedTexture.cpp b/WebCore/platform/graphics/android/BackedDoubleBufferedTexture.cpp
index ced0c2e..37e8e7b 100644
--- a/WebCore/platform/graphics/android/BackedDoubleBufferedTexture.cpp
+++ b/WebCore/platform/graphics/android/BackedDoubleBufferedTexture.cpp
@@ -53,9 +53,11 @@ BackedDoubleBufferedTexture::~BackedDoubleBufferedTexture()
{
m_bitmap.reset();
delete m_canvas;
+ SharedTexture* textures[3] = { &m_textureA, &m_textureB, 0 };
+ destroyTextures(textures);
}
-void BackedDoubleBufferedTexture::onDestroy(SharedTexture** textures)
+void BackedDoubleBufferedTexture::destroyTextures(SharedTexture** textures)
{
int x = 0;
while (textures[x] != 0) {
@@ -136,4 +138,9 @@ void BackedDoubleBufferedTexture::release(BaseTile* owner)
m_owner = 0;
}
+void BackedDoubleBufferedTexture::release()
+{
+ m_owner = 0;
+}
+
} // namespace WebCore
diff --git a/WebCore/platform/graphics/android/BackedDoubleBufferedTexture.h b/WebCore/platform/graphics/android/BackedDoubleBufferedTexture.h
index 76b9f36..69578d5 100644
--- a/WebCore/platform/graphics/android/BackedDoubleBufferedTexture.h
+++ b/WebCore/platform/graphics/android/BackedDoubleBufferedTexture.h
@@ -67,6 +67,7 @@ public:
// returns false if ownership cannot be transferred because the tile is busy
bool acquire(BaseTile* owner);
void release(BaseTile* owner);
+ void release();
// private member accessor functions
BaseTile* owner() { return m_owner; } // only used by the consumer thread
@@ -75,10 +76,9 @@ public:
// This is to be only used for debugging on the producer thread
bool busy() { return m_busy; }
-protected:
- virtual void onDestroy(SharedTexture** textures);
-
private:
+ void destroyTextures(SharedTexture** textures);
+
SkBitmap m_bitmap;
SkCanvas* m_canvas;
int m_usedLevel;
diff --git a/WebCore/platform/graphics/android/DoubleBufferedTexture.cpp b/WebCore/platform/graphics/android/DoubleBufferedTexture.cpp
index a3ae5ab..31a1186 100644
--- a/WebCore/platform/graphics/android/DoubleBufferedTexture.cpp
+++ b/WebCore/platform/graphics/android/DoubleBufferedTexture.cpp
@@ -58,8 +58,6 @@ DoubleBufferedTexture::DoubleBufferedTexture(EGLContext sharedContext)
DoubleBufferedTexture::~DoubleBufferedTexture()
{
- SharedTexture* textures[3] = { &m_textureA, &m_textureB, 0 };
- onDestroy(textures);
#ifdef DEBUG_COUNT
gDoubleBufferedTextureCount--;
#endif
diff --git a/WebCore/platform/graphics/android/DoubleBufferedTexture.h b/WebCore/platform/graphics/android/DoubleBufferedTexture.h
index c028302..c7f5f49 100644
--- a/WebCore/platform/graphics/android/DoubleBufferedTexture.h
+++ b/WebCore/platform/graphics/android/DoubleBufferedTexture.h
@@ -51,17 +51,13 @@ public:
void consumerRelease();
protected:
- // enables sub-classes to signal the provider thread that the consumer is
- // being deleted and therefore should clean up any producer specific
- // textures or EGLImages
- virtual void onDestroy(SharedTexture** textures) { };
+ SharedTexture m_textureA;
+ SharedTexture m_textureB;
private:
SharedTexture* getReadableTexture();
SharedTexture* getWriteableTexture();
- SharedTexture m_textureA;
- SharedTexture m_textureB;
SharedTexture* m_writeableTexture;
SharedTexture* m_lockedConsumerTexture; // only used by the consumer