diff options
author | Nicolas Roard <nicolas@android.com> | 2010-12-13 10:19:28 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2010-12-13 10:19:28 -0800 |
commit | 97b3a15064089a16c787d230d6dcd24c8231e3bc (patch) | |
tree | 99a46f8c528f6a897ef6cfa1ec2fe8cfe5c3ed46 /WebCore/platform/graphics/android | |
parent | 6c5f919ea53c0c48f3ee00d4dbc297eba9c1d44e (diff) | |
parent | e846e5780f8a50e85389d25846b866ba79e85e14 (diff) | |
download | external_webkit-97b3a15064089a16c787d230d6dcd24c8231e3bc.zip external_webkit-97b3a15064089a16c787d230d6dcd24c8231e3bc.tar.gz external_webkit-97b3a15064089a16c787d230d6dcd24c8231e3bc.tar.bz2 |
Merge "Fix onDestroy()"
Diffstat (limited to 'WebCore/platform/graphics/android')
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 |