summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDerek Sollenberger <djsollen@google.com>2010-10-26 06:04:10 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2010-10-26 06:04:10 -0700
commit09e26c78506587b3f5d930d7bc72a23287ffbec0 (patch)
tree748cf1d37be578b3bfa9f4cc82cba47e040a7c52
parent8ec7b2904c3529cc84242031dc15882782e343e9 (diff)
parent9eabecbe3e8578cc63349efb29720772741dee86 (diff)
downloadexternal_webkit-09e26c78506587b3f5d930d7bc72a23287ffbec0.zip
external_webkit-09e26c78506587b3f5d930d7bc72a23287ffbec0.tar.gz
external_webkit-09e26c78506587b3f5d930d7bc72a23287ffbec0.tar.bz2
Merge "Minor cleanup of the DoubleBufferedTexture."
-rw-r--r--WebCore/platform/graphics/android/DoubleBufferedTexture.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/WebCore/platform/graphics/android/DoubleBufferedTexture.cpp b/WebCore/platform/graphics/android/DoubleBufferedTexture.cpp
index bce230f..35e2821 100644
--- a/WebCore/platform/graphics/android/DoubleBufferedTexture.cpp
+++ b/WebCore/platform/graphics/android/DoubleBufferedTexture.cpp
@@ -39,19 +39,20 @@ DoubleBufferedTexture::DoubleBufferedTexture(EGLContext sharedContext)
m_display = eglGetCurrentDisplay();
m_pContext = EGL_NO_CONTEXT;
m_cContext = sharedContext;
- m_writeableTexture = GL_NO_TEXTURE;
+ m_writeableTexture = &m_textureA;
m_lockedConsumerTexture = GL_NO_TEXTURE;
m_supportsEGLImage = GLUtils::isEGLImageSupported();
}
SharedTexture* DoubleBufferedTexture::getWriteableTexture()
{
- return (m_writeableTexture == &m_textureA) ? &m_textureA : &m_textureB;
+ return reinterpret_cast<SharedTexture*>(
+ android_atomic_release_load((int32_t*)&m_writeableTexture));
}
SharedTexture* DoubleBufferedTexture::getReadableTexture()
{
- return (m_writeableTexture != &m_textureA) ? &m_textureA : &m_textureB;
+ return (getWriteableTexture() != &m_textureA) ? &m_textureA : &m_textureB;
}
EGLContext DoubleBufferedTexture::producerAcquireContext()
@@ -86,9 +87,6 @@ EGLContext DoubleBufferedTexture::producerAcquireContext()
m_textureA.unlock();
m_textureB.unlock();
- // select a front buffer
- m_writeableTexture = &m_textureA;
-
m_pContext = context;
return context;
}
@@ -109,6 +107,7 @@ void DoubleBufferedTexture::producerRelease()
SharedTexture* sharedTex = getWriteableTexture();
LOGV("Releasing P Lock (%d)", sharedTex->getSourceTextureId());
sharedTex->releaseSource();
+ LOGV("Released P Lock (%d)", sharedTex->getSourceTextureId());
}
void DoubleBufferedTexture::producerReleaseAndSwap()
@@ -117,7 +116,6 @@ void DoubleBufferedTexture::producerReleaseAndSwap()
// swap the front and back buffers using an atomic op for the memory barrier
android_atomic_acquire_store((int32_t)getReadableTexture(), (int32_t*)&m_writeableTexture);
- LOGV("Released P Lock (%d)", m_writeableTexture->getSourceTextureId());
}
TextureInfo* DoubleBufferedTexture::consumerLock()