Title: [210541] trunk/Source/WebCore
- Revision
- 210541
- Author
- [email protected]
- Date
- 2017-01-10 04:28:46 -0800 (Tue, 10 Jan 2017)
Log Message
[TextureMapper] TextureMapperPlatformLayerProxy::swapBuffers() should hold the lock throughout invocation
https://bugs.webkit.org/show_bug.cgi?id=166852
Reviewed by Michael Catanzaro.
* platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
(WebCore::TextureMapperPlatformLayerProxy::swapBuffer): Append to previous buffer
to the m_usedBuffers Vector while the object's lock is held. Everywhere else the
m_usedBuffers Vector is used under the lock, no reason to not do the same here.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (210540 => 210541)
--- trunk/Source/WebCore/ChangeLog 2017-01-10 12:16:35 UTC (rev 210540)
+++ trunk/Source/WebCore/ChangeLog 2017-01-10 12:28:46 UTC (rev 210541)
@@ -1,3 +1,15 @@
+2017-01-10 Zan Dobersek <[email protected]>
+
+ [TextureMapper] TextureMapperPlatformLayerProxy::swapBuffers() should hold the lock throughout invocation
+ https://bugs.webkit.org/show_bug.cgi?id=166852
+
+ Reviewed by Michael Catanzaro.
+
+ * platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
+ (WebCore::TextureMapperPlatformLayerProxy::swapBuffer): Append to previous buffer
+ to the m_usedBuffers Vector while the object's lock is held. Everywhere else the
+ m_usedBuffers Vector is used under the lock, no reason to not do the same here.
+
2017-01-09 Yusuke Suzuki <[email protected]>
Implement JSSourceCode to propagate SourceCode in module pipeline
Modified: trunk/Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp (210540 => 210541)
--- trunk/Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp 2017-01-10 12:16:35 UTC (rev 210540)
+++ trunk/Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp 2017-01-10 12:28:46 UTC (rev 210541)
@@ -139,19 +139,15 @@
void TextureMapperPlatformLayerProxy::swapBuffer()
{
ASSERT(m_compositorThreadID == WTF::currentThread());
- std::unique_ptr<TextureMapperPlatformLayerBuffer> prevBuffer;
+ LockHolder locker(m_lock);
+ if (!m_targetLayer || !m_pendingBuffer)
+ return;
- {
- LockHolder locker(m_lock);
- if (!m_targetLayer || !m_pendingBuffer)
- return;
+ auto prevBuffer = WTFMove(m_currentBuffer);
- prevBuffer = WTFMove(m_currentBuffer);
+ m_currentBuffer = WTFMove(m_pendingBuffer);
+ m_targetLayer->setContentsLayer(m_currentBuffer.get());
- m_currentBuffer = WTFMove(m_pendingBuffer);
- m_targetLayer->setContentsLayer(m_currentBuffer.get());
- }
-
if (prevBuffer && prevBuffer->hasManagedTexture())
m_usedBuffers.append(WTFMove(prevBuffer));
}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes