Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(234)

Side by Side Diff: ui/ozone/platform/x11/x11_surface_factory.cc

Issue 2366643002: Add ThreadChecker for Ozone X11 GPU. (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/ozone/platform/x11/x11_surface_factory.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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());
161 std::vector<gl::GLImplementation> impls; 162 std::vector<gl::GLImplementation> impls;
162 impls.push_back(gl::kGLImplementationEGLGLES2); 163 impls.push_back(gl::kGLImplementationEGLGLES2);
163 // DesktopGL (GLX) should be the first option when crbug.com/646982 is fixed. 164 // DesktopGL (GLX) should be the first option when crbug.com/646982 is fixed.
164 impls.push_back(gl::kGLImplementationDesktopGL); 165 impls.push_back(gl::kGLImplementationDesktopGL);
165 impls.push_back(gl::kGLImplementationOSMesaGL); 166 impls.push_back(gl::kGLImplementationOSMesaGL);
166 return impls; 167 return impls;
167 } 168 }
168 169
169 GLOzone* X11SurfaceFactory::GetGLOzone(gl::GLImplementation implementation) { 170 GLOzone* X11SurfaceFactory::GetGLOzone(gl::GLImplementation implementation) {
171 DCHECK(thread_checker_.CalledOnValidThread());
170 switch (implementation) { 172 switch (implementation) {
171 case gl::kGLImplementationDesktopGL: 173 case gl::kGLImplementationDesktopGL:
172 return glx_implementation_.get(); 174 return glx_implementation_.get();
173 case gl::kGLImplementationEGLGLES2: 175 case gl::kGLImplementationEGLGLES2:
174 return egl_implementation_.get(); 176 return egl_implementation_.get();
175 default: 177 default:
176 return nullptr; 178 return nullptr;
177 } 179 }
178 } 180 }
179 181
180 } // namespace ui 182 } // namespace ui
OLDNEW
« no previous file with comments | « ui/ozone/platform/x11/x11_surface_factory.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698