| 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 // This include must be here so that the includes provided transitively | 5 // This include must be here so that the includes provided transitively |
| 6 // by gl_surface_egl.h don't make it impossible to compile this code. | 6 // by gl_surface_egl.h don't make it impossible to compile this code. |
| 7 #include "third_party/mesa/src/include/GL/osmesa.h" | 7 #include "third_party/mesa/src/include/GL/osmesa.h" |
| 8 | 8 |
| 9 #include "ui/gl/gl_surface_egl.h" | 9 #include "ui/gl/gl_surface_egl.h" |
| 10 | 10 |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 return true; | 101 return true; |
| 102 | 102 |
| 103 #if defined (USE_OZONE) | 103 #if defined (USE_OZONE) |
| 104 ui::SurfaceFactoryOzone::GetInstance()->InitializeHardware(); | 104 ui::SurfaceFactoryOzone::GetInstance()->InitializeHardware(); |
| 105 #endif | 105 #endif |
| 106 | 106 |
| 107 #if defined(USE_X11) | 107 #if defined(USE_X11) |
| 108 g_native_display = base::MessagePumpForUI::GetDefaultXDisplay(); | 108 g_native_display = base::MessagePumpForUI::GetDefaultXDisplay(); |
| 109 #elif defined(OS_WIN) | 109 #elif defined(OS_WIN) |
| 110 g_native_display = EGL_DEFAULT_DISPLAY; | 110 g_native_display = EGL_DEFAULT_DISPLAY; |
| 111 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableD3D11)) | 111 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableD3D11) || |
| 112 CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableD3D11)) { |
| 112 g_native_display = EGL_D3D11_ELSE_D3D9_DISPLAY_ANGLE; | 113 g_native_display = EGL_D3D11_ELSE_D3D9_DISPLAY_ANGLE; |
| 114 } |
| 113 #else | 115 #else |
| 114 g_native_display = EGL_DEFAULT_DISPLAY; | 116 g_native_display = EGL_DEFAULT_DISPLAY; |
| 115 #endif | 117 #endif |
| 116 g_display = eglGetDisplay(g_native_display); | 118 g_display = eglGetDisplay(g_native_display); |
| 117 if (!g_display) { | 119 if (!g_display) { |
| 118 LOG(ERROR) << "eglGetDisplay failed with error " << GetLastEGLErrorString(); | 120 LOG(ERROR) << "eglGetDisplay failed with error " << GetLastEGLErrorString(); |
| 119 return false; | 121 return false; |
| 120 } | 122 } |
| 121 | 123 |
| 122 if (!eglInitialize(g_display, NULL, NULL)) { | 124 if (!eglInitialize(g_display, NULL, NULL)) { |
| (...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 673 } | 675 } |
| 674 default: | 676 default: |
| 675 NOTREACHED(); | 677 NOTREACHED(); |
| 676 return NULL; | 678 return NULL; |
| 677 } | 679 } |
| 678 } | 680 } |
| 679 | 681 |
| 680 #endif | 682 #endif |
| 681 | 683 |
| 682 } // namespace gfx | 684 } // namespace gfx |
| OLD | NEW |