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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 | 97 |
98 bool GLSurfaceEGL::InitializeOneOff() { | 98 bool GLSurfaceEGL::InitializeOneOff() { |
99 static bool initialized = false; | 99 static bool initialized = false; |
100 if (initialized) | 100 if (initialized) |
101 return true; | 101 return true; |
102 | 102 |
103 #if defined(USE_X11) | 103 #if defined(USE_X11) |
104 g_native_display = base::MessagePumpForUI::GetDefaultXDisplay(); | 104 g_native_display = base::MessagePumpForUI::GetDefaultXDisplay(); |
105 #elif defined(OS_WIN) | 105 #elif defined(OS_WIN) |
106 g_native_display = EGL_DEFAULT_DISPLAY; | 106 g_native_display = EGL_DEFAULT_DISPLAY; |
107 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableD3D11)) { | 107 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableD3D11) && |
| 108 CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableD3D11)) { |
108 g_native_display = EGL_D3D11_ELSE_D3D9_DISPLAY_ANGLE; | 109 g_native_display = EGL_D3D11_ELSE_D3D9_DISPLAY_ANGLE; |
109 } | 110 } |
110 #elif defined(USE_OZONE) | 111 #elif defined(USE_OZONE) |
111 ui::SurfaceFactoryOzone* surface_factory = | 112 ui::SurfaceFactoryOzone* surface_factory = |
112 ui::SurfaceFactoryOzone::GetInstance(); | 113 ui::SurfaceFactoryOzone::GetInstance(); |
113 if (surface_factory->InitializeHardware() != | 114 if (surface_factory->InitializeHardware() != |
114 ui::SurfaceFactoryOzone::INITIALIZED) { | 115 ui::SurfaceFactoryOzone::INITIALIZED) { |
115 LOG(ERROR) << "OZONE failed to initialize hardware"; | 116 LOG(ERROR) << "OZONE failed to initialize hardware"; |
116 return false; | 117 return false; |
117 } | 118 } |
(...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
680 } | 681 } |
681 default: | 682 default: |
682 NOTREACHED(); | 683 NOTREACHED(); |
683 return NULL; | 684 return NULL; |
684 } | 685 } |
685 } | 686 } |
686 | 687 |
687 #endif | 688 #endif |
688 | 689 |
689 } // namespace gfx | 690 } // namespace gfx |
OLD | NEW |