From: Derek Sollenberger Date: Tue, 12 Oct 2010 18:56:35 +0000 (-0400) Subject: Remove unnecessary mutex locks from texture sharing code X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=c2232e10301fba77b8765957339451f605c37085;p=android-x86%2Fexternal-webkit.git Remove unnecessary mutex locks from texture sharing code The DoubleBufferedTexture currently uses a mutex to protect access to m_frontTexture on the producer functions. This mutex is not needed in the producerLock/producerRelease functions as they will always be called by the thread that sets m_frontTexture. Additionally, this data will be initialized before calls to those funtions as the thread must always call aquireContext() before calling these functions. Change-Id: I110ad357c5eed4c0f5501761174e0da4b872af5d http://b/3089605 --- diff --git a/WebCore/platform/graphics/android/DoubleBufferedTexture.cpp b/WebCore/platform/graphics/android/DoubleBufferedTexture.cpp index e71339898..7746603f5 100644 --- a/WebCore/platform/graphics/android/DoubleBufferedTexture.cpp +++ b/WebCore/platform/graphics/android/DoubleBufferedTexture.cpp @@ -95,9 +95,7 @@ EGLContext DoubleBufferedTexture::producerAcquireContext() { } TextureInfo* DoubleBufferedTexture::producerLock() { - m_varLock.lock(); SharedTexture* sharedTex = getFrontTexture(); - m_varLock.unlock(); LOGV("Acquiring P Lock (%d)", sharedTex->getSourceTextureId()); TextureInfo* texInfo = sharedTex->lockSource(); LOGV("Acquired P Lock"); @@ -106,11 +104,9 @@ TextureInfo* DoubleBufferedTexture::producerLock() { } void DoubleBufferedTexture::producerRelease() { - m_varLock.lock(); // get the front texture and cache the id SharedTexture* sharedTex = getFrontTexture(); LOGV("Releasing P Lock (%d)", sharedTex->getSourceTextureId()); - m_varLock.unlock(); sharedTex->releaseSource();