diff options
author | Chris Craik <ccraik@google.com> | 2011-10-13 11:53:27 -0700 |
---|---|---|
committer | Chris Craik <ccraik@google.com> | 2011-10-13 14:14:24 -0700 |
commit | 530c83c6351e05a6939ad0b5bc291da073e77b5b (patch) | |
tree | bfdd3c23f00071e7468536cda64aa59822fecfa8 /Source/WebCore/platform/graphics/android/BaseTileTexture.cpp | |
parent | 834299ee1971101446d6f2a422956215b6dd1c06 (diff) | |
download | external_webkit-530c83c6351e05a6939ad0b5bc291da073e77b5b.zip external_webkit-530c83c6351e05a6939ad0b5bc291da073e77b5b.tar.gz external_webkit-530c83c6351e05a6939ad0b5bc291da073e77b5b.tar.bz2 |
Fix crash in BaseTileTexture
bug:5453156
simplified m_owner management - ONLY modified on UI thread
Previously deferring clear of m_owner, now set immediately since texture thread
doesn't use need stale owner info
Change-Id: I9b6f7bfd27af44a818d378ff750c0170d8122cfd
Diffstat (limited to 'Source/WebCore/platform/graphics/android/BaseTileTexture.cpp')
-rw-r--r-- | Source/WebCore/platform/graphics/android/BaseTileTexture.cpp | 24 |
1 files changed, 3 insertions, 21 deletions
diff --git a/Source/WebCore/platform/graphics/android/BaseTileTexture.cpp b/Source/WebCore/platform/graphics/android/BaseTileTexture.cpp index cedad99..5b7acdb 100644 --- a/Source/WebCore/platform/graphics/android/BaseTileTexture.cpp +++ b/Source/WebCore/platform/graphics/android/BaseTileTexture.cpp @@ -56,8 +56,6 @@ BaseTileTexture::BaseTileTexture(uint32_t w, uint32_t h) : DoubleBufferedTexture(eglGetCurrentContext(), TilesManager::instance()->getSharedTextureMode()) , m_owner(0) - , m_delayedReleaseOwner(0) - , m_delayedRelease(false) , m_busy(false) { m_size.set(w, h); @@ -137,13 +135,6 @@ void BaseTileTexture::setNotBusy() { android::Mutex::Autolock lock(m_busyLock); m_busy = false; - if (m_delayedRelease) { - if (m_owner == m_delayedReleaseOwner) - m_owner = 0; - - m_delayedRelease = false; - m_delayedReleaseOwner = 0; - } m_busyCond.signal(); } @@ -170,13 +161,8 @@ void BaseTileTexture::producerUpdate(TextureInfo* textureInfo, const SkBitmap& b bool BaseTileTexture::acquire(TextureOwner* owner, bool force) { - if (m_owner == owner) { - if (m_delayedRelease) { - m_delayedRelease = false; - m_delayedReleaseOwner = 0; - } + if (m_owner == owner) return true; - } return setOwner(owner, force); } @@ -219,17 +205,13 @@ bool BaseTileTexture::release(TextureOwner* owner) if (m_owner != owner) return false; - if (!m_busy) { - m_owner = 0; - } else { - m_delayedRelease = true; - m_delayedReleaseOwner = owner; - } + m_owner = 0; return true; } void BaseTileTexture::releaseAndRemoveFromTile() { + // NOTE: only call on UI thread, so m_owner won't be changing if (m_owner) { // clear both Tile->Texture and Texture->Tile links m_owner->removeTexture(this); |