summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/platform/graphics/android/TransferQueue.cpp
diff options
context:
space:
mode:
authorTeng-Hui Zhu <ztenghui@google.com>2011-08-22 13:37:08 -0700
committerTeng-Hui Zhu <ztenghui@google.com>2011-08-22 13:39:24 -0700
commit99722bcc8d0f9fcde19f6dfaab330c44326e4638 (patch)
tree11ec4d205c7b15174f2d8a7f597be275d2e93d05 /Source/WebCore/platform/graphics/android/TransferQueue.cpp
parent1af71ac3df81a9b312f5375ae3cb6c33c129227b (diff)
downloadexternal_webkit-99722bcc8d0f9fcde19f6dfaab330c44326e4638.zip
external_webkit-99722bcc8d0f9fcde19f6dfaab330c44326e4638.tar.gz
external_webkit-99722bcc8d0f9fcde19f6dfaab330c44326e4638.tar.bz2
Avoid the lock when dealing with Surface Texture
The lock over the surface texture operation is unnecessary. They just need to be around the transfer queue operation. bug:5185840 Change-Id: Ia09ec5f6049421047aac1944efbf601cdc179a52
Diffstat (limited to 'Source/WebCore/platform/graphics/android/TransferQueue.cpp')
-rw-r--r--Source/WebCore/platform/graphics/android/TransferQueue.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/Source/WebCore/platform/graphics/android/TransferQueue.cpp b/Source/WebCore/platform/graphics/android/TransferQueue.cpp
index 00c9e68..851d02c 100644
--- a/Source/WebCore/platform/graphics/android/TransferQueue.cpp
+++ b/Source/WebCore/platform/graphics/android/TransferQueue.cpp
@@ -288,10 +288,9 @@ void TransferQueue::updateDirtyBaseTiles()
void TransferQueue::updateQueueWithBitmap(const TileRenderInfo* renderInfo,
int x, int y, const SkBitmap& bitmap)
{
- android::Mutex::Autolock lock(m_transferQueueItemLocks);
-
+ m_transferQueueItemLocks.lock();
bool ready = readyForUpdate();
-
+ m_transferQueueItemLocks.unlock();
if (!ready) {
XLOG("Quit bitmap update: not ready! for tile x y %d %d",
renderInfo->x, renderInfo->y);
@@ -333,9 +332,10 @@ void TransferQueue::updateQueueWithBitmap(const TileRenderInfo* renderInfo,
}
ANativeWindow_unlockAndPost(m_ANW.get());
-
+ m_transferQueueItemLocks.lock();
// b) After update the Surface Texture, now udpate the transfer queue info.
addItemInTransferQueue(renderInfo);
+ m_transferQueueItemLocks.unlock();
XLOG("Bitmap updated x, y %d %d, baseTile %p",
renderInfo->x, renderInfo->y, renderInfo->baseTile);
}