Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(968)

Unified Diff: content/browser/android/in_process/synchronous_compositor_factory_impl.cc

Issue 461333002: Nullify video context provider when there is no harware compositor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/android/in_process/synchronous_compositor_factory_impl.cc
diff --git a/content/browser/android/in_process/synchronous_compositor_factory_impl.cc b/content/browser/android/in_process/synchronous_compositor_factory_impl.cc
index 45e5aa14d4621f2568fcee9c727eb2d5f7b45407..8f6553b9370f940c39ec9060b973cd18c12d00ec 100644
--- a/content/browser/android/in_process/synchronous_compositor_factory_impl.cc
+++ b/content/browser/android/in_process/synchronous_compositor_factory_impl.cc
@@ -232,6 +232,11 @@ void SynchronousCompositorFactoryImpl::CompositorReleasedHardwareDraw() {
base::AutoLock lock(num_hardware_compositor_lock_);
DCHECK_GT(num_hardware_compositors_, 0u);
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() {
@@ -245,8 +250,8 @@ SynchronousCompositorFactoryImpl::TryCreateStreamTextureFactory() {
context_provider;
// This check only guarantees the main thread context is created after
// a compositor did successfully initialize hardware draw in the past.
- // In particular this does not guarantee that the main thread context
- // will fail creation when all compositors release hardware draw.
+ // When all compositors have released hardware draw, main thread context
+ // creation is guaranteed to fail.
if (CanCreateMainThreadContext() && !video_context_provider_) {
DCHECK(service_);
DCHECK(share_context_.get());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698