Commit 958ca8b8 authored by hush@chromium.org's avatar hush@chromium.org

Nullify video context provider when there is no harware compositor.

BUG=

Review URL: https://codereview.chromium.org/461333002

Cr-Commit-Position: refs/heads/master@{#289474}
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@289474 0039d316-1c4b-4281-b951-d872f2087c98
parent 0fa827fa
...@@ -223,6 +223,11 @@ void SynchronousCompositorFactoryImpl::CompositorReleasedHardwareDraw() { ...@@ -223,6 +223,11 @@ void SynchronousCompositorFactoryImpl::CompositorReleasedHardwareDraw() {
base::AutoLock lock(num_hardware_compositor_lock_); base::AutoLock lock(num_hardware_compositor_lock_);
DCHECK_GT(num_hardware_compositors_, 0u); DCHECK_GT(num_hardware_compositors_, 0u);
num_hardware_compositors_--; num_hardware_compositors_--;
if (num_hardware_compositors_ == 0) {
// Nullify the video_context_provider_ now so that it is not null only if
// there is at least 1 hardware compositor
video_context_provider_ = NULL;
}
} }
bool SynchronousCompositorFactoryImpl::CanCreateMainThreadContext() { bool SynchronousCompositorFactoryImpl::CanCreateMainThreadContext() {
...@@ -236,8 +241,8 @@ SynchronousCompositorFactoryImpl::TryCreateStreamTextureFactory() { ...@@ -236,8 +241,8 @@ SynchronousCompositorFactoryImpl::TryCreateStreamTextureFactory() {
context_provider; context_provider;
// This check only guarantees the main thread context is created after // This check only guarantees the main thread context is created after
// a compositor did successfully initialize hardware draw in the past. // a compositor did successfully initialize hardware draw in the past.
// In particular this does not guarantee that the main thread context // When all compositors have released hardware draw, main thread context
// will fail creation when all compositors release hardware draw. // creation is guaranteed to fail.
if (CanCreateMainThreadContext() && !video_context_provider_) { if (CanCreateMainThreadContext() && !video_context_provider_) {
DCHECK(service_); DCHECK(service_);
DCHECK(share_context_.get()); DCHECK(share_context_.get());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment