| 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 "ui/gl/gl_surface_egl.h" | 5 #include "ui/gl/gl_surface_egl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 | 169 |
| 170 display_attribs.push_back(EGL_PLATFORM_ANGLE_TYPE_ANGLE); | 170 display_attribs.push_back(EGL_PLATFORM_ANGLE_TYPE_ANGLE); |
| 171 display_attribs.push_back(platform_type); | 171 display_attribs.push_back(platform_type); |
| 172 | 172 |
| 173 if (warpDevice) { | 173 if (warpDevice) { |
| 174 display_attribs.push_back(EGL_PLATFORM_ANGLE_DEVICE_TYPE_ANGLE); | 174 display_attribs.push_back(EGL_PLATFORM_ANGLE_DEVICE_TYPE_ANGLE); |
| 175 display_attribs.push_back(EGL_PLATFORM_ANGLE_DEVICE_TYPE_WARP_ANGLE); | 175 display_attribs.push_back(EGL_PLATFORM_ANGLE_DEVICE_TYPE_WARP_ANGLE); |
| 176 } | 176 } |
| 177 | 177 |
| 178 #if defined(USE_X11) && !defined(OS_CHROMEOS) | 178 #if defined(USE_X11) && !defined(OS_CHROMEOS) |
| 179 Visual* visual; | 179 std::string visualid_str = |
| 180 ui::ChooseVisualForWindow(&visual, nullptr); | 180 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
| 181 switches::kX11VisualID); |
| 182 unsigned int visualid = 0; |
| 183 bool succeed = base::StringToUint(visualid_str, &visualid); |
| 184 DCHECK(succeed); |
| 181 display_attribs.push_back(EGL_X11_VISUAL_ID_ANGLE); | 185 display_attribs.push_back(EGL_X11_VISUAL_ID_ANGLE); |
| 182 display_attribs.push_back((EGLint)visual->visualid); | 186 display_attribs.push_back((EGLint)visualid); |
| 183 #endif | 187 #endif |
| 184 | 188 |
| 185 display_attribs.push_back(EGL_NONE); | 189 display_attribs.push_back(EGL_NONE); |
| 186 | 190 |
| 187 return eglGetPlatformDisplayEXT(EGL_PLATFORM_ANGLE_ANGLE, | 191 return eglGetPlatformDisplayEXT(EGL_PLATFORM_ANGLE_ANGLE, |
| 188 reinterpret_cast<void*>(native_display), | 192 reinterpret_cast<void*>(native_display), |
| 189 &display_attribs[0]); | 193 &display_attribs[0]); |
| 190 } | 194 } |
| 191 | 195 |
| 192 EGLDisplay GetDisplayFromType(DisplayType display_type, | 196 EGLDisplay GetDisplayFromType(DisplayType display_type, |
| (...skipping 927 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1120 } | 1124 } |
| 1121 | 1125 |
| 1122 void* SurfacelessEGL::GetShareHandle() { | 1126 void* SurfacelessEGL::GetShareHandle() { |
| 1123 return NULL; | 1127 return NULL; |
| 1124 } | 1128 } |
| 1125 | 1129 |
| 1126 SurfacelessEGL::~SurfacelessEGL() { | 1130 SurfacelessEGL::~SurfacelessEGL() { |
| 1127 } | 1131 } |
| 1128 | 1132 |
| 1129 } // namespace gfx | 1133 } // namespace gfx |
| OLD | NEW |