| 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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 | 151 |
| 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 DCHECK(thread_checker_.CalledOnValidThread()); | |
| 162 std::vector<gl::GLImplementation> impls; | 161 std::vector<gl::GLImplementation> impls; |
| 163 impls.push_back(gl::kGLImplementationEGLGLES2); | 162 impls.push_back(gl::kGLImplementationEGLGLES2); |
| 164 // DesktopGL (GLX) should be the first option when crbug.com/646982 is fixed. | 163 // DesktopGL (GLX) should be the first option when crbug.com/646982 is fixed. |
| 165 impls.push_back(gl::kGLImplementationDesktopGL); | 164 impls.push_back(gl::kGLImplementationDesktopGL); |
| 166 impls.push_back(gl::kGLImplementationOSMesaGL); | 165 impls.push_back(gl::kGLImplementationOSMesaGL); |
| 167 return impls; | 166 return impls; |
| 168 } | 167 } |
| 169 | 168 |
| 170 GLOzone* X11SurfaceFactory::GetGLOzone(gl::GLImplementation implementation) { | 169 GLOzone* X11SurfaceFactory::GetGLOzone(gl::GLImplementation implementation) { |
| 171 DCHECK(thread_checker_.CalledOnValidThread()); | |
| 172 switch (implementation) { | 170 switch (implementation) { |
| 173 case gl::kGLImplementationDesktopGL: | 171 case gl::kGLImplementationDesktopGL: |
| 174 return glx_implementation_.get(); | 172 return glx_implementation_.get(); |
| 175 case gl::kGLImplementationEGLGLES2: | 173 case gl::kGLImplementationEGLGLES2: |
| 176 return egl_implementation_.get(); | 174 return egl_implementation_.get(); |
| 177 default: | 175 default: |
| 178 return nullptr; | 176 return nullptr; |
| 179 } | 177 } |
| 180 } | 178 } |
| 181 | 179 |
| 182 } // namespace ui | 180 } // namespace ui |
| OLD | NEW |