summaryrefslogtreecommitdiffstats
path: root/ui/compositor
diff options
context:
space:
mode:
authorccameron@chromium.org <ccameron@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-03 13:00:08 +0000
committerccameron@chromium.org <ccameron@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-03 13:00:08 +0000
commit032b23bdf5cee5eb23e4764580173f0459dfd9ca (patch)
treee9fc3d379108ed01fe06b5916cef78d4d394dc57 /ui/compositor
parent5bdca91f9d0a2d795ab573252a9cf49dfb001cbe (diff)
downloadchromium_src-032b23bdf5cee5eb23e4764580173f0459dfd9ca.zip
chromium_src-032b23bdf5cee5eb23e4764580173f0459dfd9ca.tar.gz
chromium_src-032b23bdf5cee5eb23e4764580173f0459dfd9ca.tar.bz2
Fall back to software mode if Aura can't create a GL context
Wire up fallback from Compositor::CreateOutputSurface to ContextFactory::CreateOutputSurface, so that we force using the software compositor after failing to create a GL context enough times. BUG=319267 Review URL: https://codereview.chromium.org/93593002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@238382 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/compositor')
-rw-r--r--ui/compositor/compositor.cc2
-rw-r--r--ui/compositor/compositor.h2
-rw-r--r--ui/compositor/test/default_context_factory.cc3
-rw-r--r--ui/compositor/test/default_context_factory.h2
-rw-r--r--ui/compositor/test/test_context_factory.cc3
-rw-r--r--ui/compositor/test/test_context_factory.h2
6 files changed, 8 insertions, 6 deletions
diff --git a/ui/compositor/compositor.cc b/ui/compositor/compositor.cc
index b2eea11..da0bcde 100644
--- a/ui/compositor/compositor.cc
+++ b/ui/compositor/compositor.cc
@@ -508,7 +508,7 @@ void Compositor::Layout() {
}
scoped_ptr<cc::OutputSurface> Compositor::CreateOutputSurface(bool fallback) {
- return ContextFactory::GetInstance()->CreateOutputSurface(this);
+ return ContextFactory::GetInstance()->CreateOutputSurface(this, fallback);
}
void Compositor::DidCommit() {
diff --git a/ui/compositor/compositor.h b/ui/compositor/compositor.h
index 7dabd53..f74abe0 100644
--- a/ui/compositor/compositor.h
+++ b/ui/compositor/compositor.h
@@ -86,7 +86,7 @@ class COMPOSITOR_EXPORT ContextFactory {
// per-compositor data (e.g. a shared context), that needs to be cleaned up
// by calling RemoveCompositor when the compositor gets destroyed.
virtual scoped_ptr<cc::OutputSurface> CreateOutputSurface(
- Compositor* compositor) = 0;
+ Compositor* compositor, bool software_fallback) = 0;
// Creates a reflector that copies the content of the |mirrored_compositor|
// onto |mirroing_layer|.
diff --git a/ui/compositor/test/default_context_factory.cc b/ui/compositor/test/default_context_factory.cc
index f5601c9..4839e1f1 100644
--- a/ui/compositor/test/default_context_factory.cc
+++ b/ui/compositor/test/default_context_factory.cc
@@ -30,7 +30,8 @@ bool DefaultContextFactory::Initialize() {
}
scoped_ptr<cc::OutputSurface> DefaultContextFactory::CreateOutputSurface(
- Compositor* compositor) {
+ Compositor* compositor, bool software_fallback) {
+ DCHECK(!software_fallback);
blink::WebGraphicsContext3D::Attributes attrs;
attrs.depth = false;
attrs.stencil = false;
diff --git a/ui/compositor/test/default_context_factory.h b/ui/compositor/test/default_context_factory.h
index b89bdd8..7b8501b 100644
--- a/ui/compositor/test/default_context_factory.h
+++ b/ui/compositor/test/default_context_factory.h
@@ -23,7 +23,7 @@ class DefaultContextFactory : public ContextFactory {
// ContextFactory implementation
virtual scoped_ptr<cc::OutputSurface> CreateOutputSurface(
- Compositor* compositor) OVERRIDE;
+ Compositor* compositor, bool software_fallback) OVERRIDE;
virtual scoped_refptr<Reflector> CreateReflector(
Compositor* compositor,
diff --git a/ui/compositor/test/test_context_factory.cc b/ui/compositor/test/test_context_factory.cc
index d47dec9..0c4b274 100644
--- a/ui/compositor/test/test_context_factory.cc
+++ b/ui/compositor/test/test_context_factory.cc
@@ -15,7 +15,8 @@ TestContextFactory::TestContextFactory() {}
TestContextFactory::~TestContextFactory() {}
scoped_ptr<cc::OutputSurface> TestContextFactory::CreateOutputSurface(
- Compositor* compositor) {
+ Compositor* compositor, bool software_fallback) {
+ DCHECK(!software_fallback);
return make_scoped_ptr(
new cc::OutputSurface(cc::TestContextProvider::Create()));
}
diff --git a/ui/compositor/test/test_context_factory.h b/ui/compositor/test/test_context_factory.h
index d419292..9b4bd9d 100644
--- a/ui/compositor/test/test_context_factory.h
+++ b/ui/compositor/test/test_context_factory.h
@@ -19,7 +19,7 @@ class TestContextFactory : public ContextFactory {
// ContextFactory implementation
virtual scoped_ptr<cc::OutputSurface> CreateOutputSurface(
- Compositor* compositor) OVERRIDE;
+ Compositor* compositor, bool software_fallback) OVERRIDE;
virtual scoped_refptr<Reflector> CreateReflector(
Compositor* mirrored_compositor,