| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/threading/thread_restrictions.h" | 9 #include "base/threading/thread_restrictions.h" |
| 10 #include "ui/gl/gl_bindings.h" | 10 #include "ui/gl/gl_bindings.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 // after instituting restrictions on I/O. Going forward they will | 58 // after instituting restrictions on I/O. Going forward they will |
| 59 // likely be used in the browser process on most platforms. The | 59 // likely be used in the browser process on most platforms. The |
| 60 // one-time initialization cost is small, between 2 and 5 ms. | 60 // one-time initialization cost is small, between 2 and 5 ms. |
| 61 base::ThreadRestrictions::ScopedAllowIO allow_io; | 61 base::ThreadRestrictions::ScopedAllowIO allow_io; |
| 62 | 62 |
| 63 switch (implementation) { | 63 switch (implementation) { |
| 64 case kGLImplementationOSMesaGL: | 64 case kGLImplementationOSMesaGL: |
| 65 return InitializeStaticGLBindingsOSMesaGL(); | 65 return InitializeStaticGLBindingsOSMesaGL(); |
| 66 case kGLImplementationDesktopGL: { | 66 case kGLImplementationDesktopGL: { |
| 67 base::NativeLibrary library = NULL; | 67 base::NativeLibrary library = NULL; |
| 68 const CommandLine* command_line = CommandLine::ForCurrentProcess(); | 68 const base::CommandLine* command_line = |
| 69 base::CommandLine::ForCurrentProcess(); |
| 69 | 70 |
| 70 if (command_line->HasSwitch(switches::kTestGLLib)) | 71 if (command_line->HasSwitch(switches::kTestGLLib)) |
| 71 library = LoadLibraryAndPrintError( | 72 library = LoadLibraryAndPrintError( |
| 72 command_line->GetSwitchValueASCII(switches::kTestGLLib).c_str()); | 73 command_line->GetSwitchValueASCII(switches::kTestGLLib).c_str()); |
| 73 | 74 |
| 74 if (!library) { | 75 if (!library) { |
| 75 library = LoadLibraryAndPrintError(kGLLibraryName); | 76 library = LoadLibraryAndPrintError(kGLLibraryName); |
| 76 } | 77 } |
| 77 | 78 |
| 78 if (!library) | 79 if (!library) |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 return GetGLWindowSystemBindingInfoGLX(info); | 201 return GetGLWindowSystemBindingInfoGLX(info); |
| 201 case kGLImplementationEGLGLES2: | 202 case kGLImplementationEGLGLES2: |
| 202 return GetGLWindowSystemBindingInfoEGL(info); | 203 return GetGLWindowSystemBindingInfoEGL(info); |
| 203 default: | 204 default: |
| 204 return false; | 205 return false; |
| 205 } | 206 } |
| 206 return false; | 207 return false; |
| 207 } | 208 } |
| 208 | 209 |
| 209 } // namespace gfx | 210 } // namespace gfx |
| OLD | NEW |