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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
142 | 142 |
143 if (warpDevice) { | 143 if (warpDevice) { |
144 display_attribs.push_back(EGL_PLATFORM_ANGLE_DEVICE_TYPE_ANGLE); | 144 display_attribs.push_back(EGL_PLATFORM_ANGLE_DEVICE_TYPE_ANGLE); |
145 display_attribs.push_back(EGL_PLATFORM_ANGLE_DEVICE_TYPE_WARP_ANGLE); | 145 display_attribs.push_back(EGL_PLATFORM_ANGLE_DEVICE_TYPE_WARP_ANGLE); |
146 } | 146 } |
147 | 147 |
148 #if defined(USE_X11) && !defined(OS_CHROMEOS) | 148 #if defined(USE_X11) && !defined(OS_CHROMEOS) |
149 Visual* visual; | 149 Visual* visual; |
150 ui::XVisualManager::GetInstance()->ChooseVisualForWindow( | 150 ui::XVisualManager::GetInstance()->ChooseVisualForWindow( |
151 true, &visual, nullptr, nullptr, nullptr); | 151 true, &visual, nullptr, nullptr, nullptr); |
152 if (visual == CopyFromParent) | |
Corentin Wallez
2016/11/03 21:16:56
How about making XVisualManager only return CopyFr
| |
153 visual = DefaultVisual(g_display, DefaultScreen(g_display)); | |
152 display_attribs.push_back(EGL_X11_VISUAL_ID_ANGLE); | 154 display_attribs.push_back(EGL_X11_VISUAL_ID_ANGLE); |
153 display_attribs.push_back(static_cast<EGLint>(XVisualIDFromVisual(visual))); | 155 display_attribs.push_back(static_cast<EGLint>(XVisualIDFromVisual(visual))); |
154 #endif | 156 #endif |
155 | 157 |
156 display_attribs.push_back(EGL_NONE); | 158 display_attribs.push_back(EGL_NONE); |
157 | 159 |
158 return eglGetPlatformDisplayEXT(EGL_PLATFORM_ANGLE_ANGLE, | 160 return eglGetPlatformDisplayEXT(EGL_PLATFORM_ANGLE_ANGLE, |
159 reinterpret_cast<void*>(native_display), | 161 reinterpret_cast<void*>(native_display), |
160 &display_attribs[0]); | 162 &display_attribs[0]); |
161 } | 163 } |
(...skipping 1038 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1200 } | 1202 } |
1201 | 1203 |
1202 void* SurfacelessEGL::GetShareHandle() { | 1204 void* SurfacelessEGL::GetShareHandle() { |
1203 return NULL; | 1205 return NULL; |
1204 } | 1206 } |
1205 | 1207 |
1206 SurfacelessEGL::~SurfacelessEGL() { | 1208 SurfacelessEGL::~SurfacelessEGL() { |
1207 } | 1209 } |
1208 | 1210 |
1209 } // namespace gl | 1211 } // namespace gl |
OLD | NEW |