OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "ui/gl/init/gl_initializer.h" | 5 #include "ui/gl/init/gl_initializer.h" |
6 | 6 |
| 7 #include <dwmapi.h> |
| 8 |
7 #include "base/at_exit.h" | 9 #include "base/at_exit.h" |
8 #include "base/base_paths.h" | 10 #include "base/base_paths.h" |
9 #include "base/bind.h" | 11 #include "base/bind.h" |
10 #include "base/command_line.h" | 12 #include "base/command_line.h" |
11 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
12 #include "base/lazy_instance.h" | 14 #include "base/lazy_instance.h" |
13 #include "base/logging.h" | 15 #include "base/logging.h" |
14 #include "base/native_library.h" | 16 #include "base/native_library.h" |
15 #include "base/path_service.h" | 17 #include "base/path_service.h" |
16 #include "base/strings/stringprintf.h" | 18 #include "base/strings/stringprintf.h" |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 VSyncProviderWin::InitializeOneOff(); | 258 VSyncProviderWin::InitializeOneOff(); |
257 | 259 |
258 switch (GetGLImplementation()) { | 260 switch (GetGLImplementation()) { |
259 case kGLImplementationDesktopGL: | 261 case kGLImplementationDesktopGL: |
260 if (!GLSurfaceWGL::InitializeOneOff()) { | 262 if (!GLSurfaceWGL::InitializeOneOff()) { |
261 LOG(ERROR) << "GLSurfaceWGL::InitializeOneOff failed."; | 263 LOG(ERROR) << "GLSurfaceWGL::InitializeOneOff failed."; |
262 return false; | 264 return false; |
263 } | 265 } |
264 break; | 266 break; |
265 case kGLImplementationEGLGLES2: | 267 case kGLImplementationEGLGLES2: |
| 268 GLSurfaceEGL::SetNativeDisplay(GetDC(nullptr)); |
266 if (!GLSurfaceEGL::InitializeOneOff()) { | 269 if (!GLSurfaceEGL::InitializeOneOff()) { |
267 LOG(ERROR) << "GLSurfaceEGL::InitializeOneOff failed."; | 270 LOG(ERROR) << "GLSurfaceEGL::InitializeOneOff failed."; |
268 return false; | 271 return false; |
269 } | 272 } |
270 break; | 273 break; |
271 case kGLImplementationOSMesaGL: | 274 case kGLImplementationOSMesaGL: |
272 case kGLImplementationMockGL: | 275 case kGLImplementationMockGL: |
273 break; | 276 break; |
274 default: | 277 default: |
275 NOTREACHED(); | 278 NOTREACHED(); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 } | 324 } |
322 | 325 |
323 ClearGLBindingsEGL(); | 326 ClearGLBindingsEGL(); |
324 ClearGLBindingsGL(); | 327 ClearGLBindingsGL(); |
325 ClearGLBindingsOSMESA(); | 328 ClearGLBindingsOSMESA(); |
326 ClearGLBindingsWGL(); | 329 ClearGLBindingsWGL(); |
327 } | 330 } |
328 | 331 |
329 } // namespace init | 332 } // namespace init |
330 } // namespace gl | 333 } // namespace gl |
OLD | NEW |