From 7f45dadaad0318020e4498b56a1689d0af5de8c8 Mon Sep 17 00:00:00 2001 From: dcastagna Date: Mon, 19 Oct 2015 13:17:35 -0700 Subject: media: Use GL shared worker context instead of allocating one. Media used to create its own GL context. This context, that takes up a few MBs of memory, was used to create textures, mailboxes and syncpoints. This CL replaces the media context with the shared worker context already present in RenderThreadImpl. It also makes sure that media drops any reference to it in the main thread (that's required by the shared worker context.) This change will also allow media to access the context in a worker thread, in this way the GL operations won't need to be serialized on the media thread that might be busy decoding video/audio. NOTE: media didn't handle GL context lost properly, but simply stopped working after the first context lost. This CL doesn't fix that and reproduces the same behavior. BUG=544547 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1369843002 Cr-Commit-Position: refs/heads/master@{#354848} --- content/common/gpu/client/command_buffer_proxy_impl.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'content/common') diff --git a/content/common/gpu/client/command_buffer_proxy_impl.cc b/content/common/gpu/client/command_buffer_proxy_impl.cc index 9bd4471..b5f9a36b 100644 --- a/content/common/gpu/client/command_buffer_proxy_impl.cc +++ b/content/common/gpu/client/command_buffer_proxy_impl.cc @@ -131,13 +131,17 @@ void CommandBufferProxyImpl::OnConsoleMessage( } void CommandBufferProxyImpl::AddDeletionObserver(DeletionObserver* observer) { - CheckLock(); + scoped_ptr lock; + if (lock_) + lock.reset(new base::AutoLock(*lock_)); deletion_observers_.AddObserver(observer); } void CommandBufferProxyImpl::RemoveDeletionObserver( DeletionObserver* observer) { - CheckLock(); + scoped_ptr lock; + if (lock_) + lock.reset(new base::AutoLock(*lock_)); deletion_observers_.RemoveObserver(observer); } -- cgit v1.1