diff options
author | Nicolas Roard <nicolasroard@google.com> | 2011-10-11 18:57:52 -0700 |
---|---|---|
committer | Nicolas Roard <nicolasroard@google.com> | 2011-10-12 11:05:45 -0700 |
commit | 9651fe9381af8dcc55a6370c3d2a65fcbdab846e (patch) | |
tree | bbcf1435a98f631127711a2eced82e67d8eba5c0 /Source/WebCore/platform/graphics/android/TilesManager.cpp | |
parent | 144926737b2b4e6f76f5c6347db3093b8a483e21 (diff) | |
download | external_webkit-9651fe9381af8dcc55a6370c3d2a65fcbdab846e.zip external_webkit-9651fe9381af8dcc55a6370c3d2a65fcbdab846e.tar.gz external_webkit-9651fe9381af8dcc55a6370c3d2a65fcbdab846e.tar.bz2 |
Refactor the image sharing code
We add a separate Images Manager, working
both in GL and software rendering.
bug:5425148
Change-Id: Ib5bc88ad94d49c7f1eb969a716691ac98dc10b77
Diffstat (limited to 'Source/WebCore/platform/graphics/android/TilesManager.cpp')
-rw-r--r-- | Source/WebCore/platform/graphics/android/TilesManager.cpp | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/Source/WebCore/platform/graphics/android/TilesManager.cpp b/Source/WebCore/platform/graphics/android/TilesManager.cpp index 2d0cc7f..74cc764 100644 --- a/Source/WebCore/platform/graphics/android/TilesManager.cpp +++ b/Source/WebCore/platform/graphics/android/TilesManager.cpp @@ -429,52 +429,6 @@ void TilesManager::unregisterGLWebViewState(GLWebViewState* state) transferQueue()->discardQueue(); } -void TilesManager::addImage(SkBitmapRef* imgRef) -{ - if (!imgRef) - return; - - android::Mutex::Autolock lock(m_imagesLock); - if (!m_images.contains(imgRef)) - m_images.set(imgRef, new ImageTexture(imgRef)); -} - -void TilesManager::removeImage(SkBitmapRef* imgRef) -{ - android::Mutex::Autolock lock(m_imagesLock); - if (!m_images.contains(imgRef)) - return; - - ImageTexture* image = m_images.get(imgRef); - image->release(); - - if (!image->refCount()) { - m_images.remove(imgRef); - delete image; - } -} - -void TilesManager::showImages() -{ - XLOGC("We have %d images", m_images.size()); - HashMap<SkBitmapRef*, ImageTexture*>::iterator end = m_images.end(); - int i = 0; - for (HashMap<SkBitmapRef*, ImageTexture*>::iterator it = m_images.begin(); it != end; ++it) { - XLOGC("Image %x (%d/%d) has %d references", it->first, i, - m_images.size(), it->second->refCount()); - i++; - } -} - -ImageTexture* TilesManager::getTextureForImage(SkBitmapRef* img, bool retain) -{ - android::Mutex::Autolock lock(m_imagesLock); - ImageTexture* image = m_images.get(img); - if (retain && image) - image->retain(); - return image; -} - TilesManager* TilesManager::instance() { if (!gInstance) { |