summaryrefslogtreecommitdiffstats
path: root/content/common
diff options
context:
space:
mode:
authordcastagna <dcastagna@chromium.org>2015-10-19 13:17:35 -0700
committerCommit bot <commit-bot@chromium.org>2015-10-19 20:18:15 +0000
commit7f45dadaad0318020e4498b56a1689d0af5de8c8 (patch)
tree16a3ec0ac454a6b63daed251a5b69fc8e62287c1 /content/common
parentde5c3d3116f445c3a8528eb32fade4f76b2d0c00 (diff)
downloadchromium_src-7f45dadaad0318020e4498b56a1689d0af5de8c8.zip
chromium_src-7f45dadaad0318020e4498b56a1689d0af5de8c8.tar.gz
chromium_src-7f45dadaad0318020e4498b56a1689d0af5de8c8.tar.bz2
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}
Diffstat (limited to 'content/common')
-rw-r--r--content/common/gpu/client/command_buffer_proxy_impl.cc8
1 files changed, 6 insertions, 2 deletions
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<base::AutoLock> lock;
+ if (lock_)
+ lock.reset(new base::AutoLock(*lock_));
deletion_observers_.AddObserver(observer);
}
void CommandBufferProxyImpl::RemoveDeletionObserver(
DeletionObserver* observer) {
- CheckLock();
+ scoped_ptr<base::AutoLock> lock;
+ if (lock_)
+ lock.reset(new base::AutoLock(*lock_));
deletion_observers_.RemoveObserver(observer);
}