OLD | NEW |
1 diff --git a/ui/gl/gl_surface.cc b/ui/gl/gl_surface.cc | 1 diff --git a/ui/gl/gl_surface.cc b/ui/gl/gl_surface.cc |
2 index 620cee7..4459d48 100644 | 2 index e1369e5..f4cb61c 100644 |
3 --- a/ui/gl/gl_surface.cc | 3 --- a/ui/gl/gl_surface.cc |
4 +++ b/ui/gl/gl_surface.cc | 4 +++ b/ui/gl/gl_surface.cc |
5 @@ -28,7 +28,7 @@ base::LazyInstance<base::ThreadLocalPointer<GLSurface> >::Leak
y | 5 @@ -28,7 +28,7 @@ base::LazyInstance<base::ThreadLocalPointer<GLSurface> >::Leak
y |
6 } // namespace | 6 } // namespace |
7 | 7 |
8 // static | 8 // static |
9 -bool GLSurface::InitializeOneOff() { | 9 -bool GLSurface::InitializeOneOff() { |
10 +bool GLSurface::InitializeOneOff(GLImplementation impl) { | 10 +bool GLSurface::InitializeOneOff(GLImplementation impl) { |
11 DCHECK_EQ(kGLImplementationNone, GetGLImplementation()); | 11 DCHECK_EQ(kGLImplementationNone, GetGLImplementation()); |
12 | 12 |
13 TRACE_EVENT0("gpu", "GLSurface::InitializeOneOff"); | 13 TRACE_EVENT0("gpu", "GLSurface::InitializeOneOff"); |
14 @@ -40,7 +40,8 @@ bool GLSurface::InitializeOneOff() { | 14 @@ -40,7 +40,8 @@ bool GLSurface::InitializeOneOff() { |
15 CommandLine* cmd = CommandLine::ForCurrentProcess(); | 15 base::CommandLine* cmd = base::CommandLine::ForCurrentProcess(); |
16 | 16 |
17 // The default implementation is always the first one in list. | 17 // The default implementation is always the first one in list. |
18 - GLImplementation impl = allowed_impls[0]; | 18 - GLImplementation impl = allowed_impls[0]; |
19 + if (impl == kGLImplementationNone) | 19 + if (impl == kGLImplementationNone) |
20 + impl = allowed_impls[0]; | 20 + impl = allowed_impls[0]; |
21 bool fallback_to_osmesa = false; | 21 bool fallback_to_osmesa = false; |
22 if (cmd->HasSwitch(switches::kOverrideUseGLWithOSMesaForTests)) { | 22 if (cmd->HasSwitch(switches::kOverrideUseGLWithOSMesaForTests)) { |
23 impl = kGLImplementationOSMesaGL; | 23 impl = kGLImplementationOSMesaGL; |
24 diff --git a/ui/gl/gl_surface.h b/ui/gl/gl_surface.h | 24 diff --git a/ui/gl/gl_surface.h b/ui/gl/gl_surface.h |
25 index 54bcc37..d458063 100644 | 25 index 8993845..220bda6 100644 |
26 --- a/ui/gl/gl_surface.h | 26 --- a/ui/gl/gl_surface.h |
27 +++ b/ui/gl/gl_surface.h | 27 +++ b/ui/gl/gl_surface.h |
28 @@ -72,7 +72,7 @@ class GL_EXPORT GLSurface : public base::RefCounted<GLSurface>
{ | 28 @@ -96,7 +96,7 @@ class GL_EXPORT GLSurface : public base::RefCounted<GLSurface>
{ |
29 virtual bool PostSubBuffer(int x, int y, int width, int height); | 29 const SwapCompletionCallback& callback); |
30 | 30 |
31 // Initialize GL bindings. | 31 // Initialize GL bindings. |
32 - static bool InitializeOneOff(); | 32 - static bool InitializeOneOff(); |
33 + static bool InitializeOneOff(GLImplementation = kGLImplementationNone); | 33 + static bool InitializeOneOff(GLImplementation = kGLImplementationNone); |
34 | 34 |
35 // Unit tests should call these instead of InitializeOneOff() to set up | 35 // Unit tests should call these instead of InitializeOneOff() to set up |
36 // GL bindings appropriate for tests. | 36 // GL bindings appropriate for tests. |
OLD | NEW |