OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/ozone/platform/x11/x11_surface_factory.h" | 5 #include "ui/ozone/platform/x11/x11_surface_factory.h" |
6 | 6 |
7 #include <X11/Xlib.h> | 7 #include <X11/Xlib.h> |
8 | 8 |
9 #include "third_party/khronos/EGL/egl.h" | 9 #include "third_party/khronos/EGL/egl.h" |
10 #include "ui/gfx/x/x11_types.h" | 10 #include "ui/gfx/x/x11_types.h" |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 X11SurfaceFactory::X11SurfaceFactory() { | 152 X11SurfaceFactory::X11SurfaceFactory() { |
153 glx_implementation_.reset(new GLOzoneGLX()); | 153 glx_implementation_.reset(new GLOzoneGLX()); |
154 egl_implementation_.reset(new GLOzoneEGLX11()); | 154 egl_implementation_.reset(new GLOzoneEGLX11()); |
155 } | 155 } |
156 | 156 |
157 X11SurfaceFactory::~X11SurfaceFactory() {} | 157 X11SurfaceFactory::~X11SurfaceFactory() {} |
158 | 158 |
159 std::vector<gl::GLImplementation> | 159 std::vector<gl::GLImplementation> |
160 X11SurfaceFactory::GetAllowedGLImplementations() { | 160 X11SurfaceFactory::GetAllowedGLImplementations() { |
161 std::vector<gl::GLImplementation> impls; | 161 std::vector<gl::GLImplementation> impls; |
| 162 impls.push_back(gl::kGLImplementationEGLGLES2); |
| 163 // DesktopGL (GLX) should be the first option when crbug.com/646982 is fixed. |
162 impls.push_back(gl::kGLImplementationDesktopGL); | 164 impls.push_back(gl::kGLImplementationDesktopGL); |
163 impls.push_back(gl::kGLImplementationEGLGLES2); | |
164 impls.push_back(gl::kGLImplementationOSMesaGL); | 165 impls.push_back(gl::kGLImplementationOSMesaGL); |
165 return impls; | 166 return impls; |
166 } | 167 } |
167 | 168 |
168 GLOzone* X11SurfaceFactory::GetGLOzone(gl::GLImplementation implementation) { | 169 GLOzone* X11SurfaceFactory::GetGLOzone(gl::GLImplementation implementation) { |
169 switch (implementation) { | 170 switch (implementation) { |
170 case gl::kGLImplementationDesktopGL: | 171 case gl::kGLImplementationDesktopGL: |
171 return glx_implementation_.get(); | 172 return glx_implementation_.get(); |
172 case gl::kGLImplementationEGLGLES2: | 173 case gl::kGLImplementationEGLGLES2: |
173 return egl_implementation_.get(); | 174 return egl_implementation_.get(); |
174 default: | 175 default: |
175 return nullptr; | 176 return nullptr; |
176 } | 177 } |
177 } | 178 } |
178 | 179 |
179 } // namespace ui | 180 } // namespace ui |
OLD | NEW |