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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 | 124 |
125 bool GLSurfaceEGL::InitializeOneOff() { | 125 bool GLSurfaceEGL::InitializeOneOff() { |
126 static bool initialized = false; | 126 static bool initialized = false; |
127 if (initialized) | 127 if (initialized) |
128 return true; | 128 return true; |
129 | 129 |
130 #if defined(USE_X11) | 130 #if defined(USE_X11) |
131 g_native_display = base::MessagePumpForUI::GetDefaultXDisplay(); | 131 g_native_display = base::MessagePumpForUI::GetDefaultXDisplay(); |
132 #elif defined(OS_WIN) | 132 #elif defined(OS_WIN) |
133 g_native_display = EGL_DEFAULT_DISPLAY; | 133 g_native_display = EGL_DEFAULT_DISPLAY; |
134 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableD3D11)) { | 134 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableD3D11) && |
| 135 CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableD3D11)) { |
135 g_native_display = EGL_D3D11_ELSE_D3D9_DISPLAY_ANGLE; | 136 g_native_display = EGL_D3D11_ELSE_D3D9_DISPLAY_ANGLE; |
136 } | 137 } |
137 #elif defined(USE_OZONE) | 138 #elif defined(USE_OZONE) |
138 gfx::SurfaceFactoryOzone* surface_factory = | 139 gfx::SurfaceFactoryOzone* surface_factory = |
139 gfx::SurfaceFactoryOzone::GetInstance(); | 140 gfx::SurfaceFactoryOzone::GetInstance(); |
140 if (surface_factory->InitializeHardware() != | 141 if (surface_factory->InitializeHardware() != |
141 gfx::SurfaceFactoryOzone::INITIALIZED) { | 142 gfx::SurfaceFactoryOzone::INITIALIZED) { |
142 LOG(ERROR) << "OZONE failed to initialize hardware"; | 143 LOG(ERROR) << "OZONE failed to initialize hardware"; |
143 return false; | 144 return false; |
144 } | 145 } |
(...skipping 721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
866 } | 867 } |
867 default: | 868 default: |
868 NOTREACHED(); | 869 NOTREACHED(); |
869 return NULL; | 870 return NULL; |
870 } | 871 } |
871 } | 872 } |
872 | 873 |
873 #endif | 874 #endif |
874 | 875 |
875 } // namespace gfx | 876 } // namespace gfx |
OLD | NEW |