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

Unified Diff: ui/ozone/platform/wayland/wayland_surface_factory.cc

Issue 2926423002: ozone: Allow using swiftshader with --use-gl=swiftshader. (Closed)
Patch Set: . Created 3 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/ozone/platform/drm/gpu/gbm_surface_factory.cc ('k') | ui/ozone/platform/x11/x11_surface_factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/platform/wayland/wayland_surface_factory.cc
diff --git a/ui/ozone/platform/wayland/wayland_surface_factory.cc b/ui/ozone/platform/wayland/wayland_surface_factory.cc
index 1adb2d74ace82e1fb032f9cad885e444fd3a292f..e84c7bdc1037f7bf6709cef2a46738de12a437fa 100644
--- a/ui/ozone/platform/wayland/wayland_surface_factory.cc
+++ b/ui/ozone/platform/wayland/wayland_surface_factory.cc
@@ -141,7 +141,7 @@ class GLOzoneEGLWayland : public GLOzoneEGL {
protected:
intptr_t GetNativeDisplay() override;
- bool LoadGLES2Bindings() override;
+ bool LoadGLES2Bindings(gl::GLImplementation impl) override;
private:
WaylandConnection* connection_;
@@ -176,9 +176,11 @@ intptr_t GLOzoneEGLWayland::GetNativeDisplay() {
return reinterpret_cast<intptr_t>(connection_->display());
}
-bool GLOzoneEGLWayland::LoadGLES2Bindings() {
+bool GLOzoneEGLWayland::LoadGLES2Bindings(gl::GLImplementation impl) {
+ // TODO: It may not be necessary to set this environment variable when using
+ // swiftshader.
setenv("EGL_PLATFORM", "wayland", 0);
- return LoadDefaultEGLGLES2Bindings();
+ return LoadDefaultEGLGLES2Bindings(impl);
}
} // namespace
@@ -204,8 +206,10 @@ WaylandSurfaceFactory::CreateCanvasForWidget(gfx::AcceleratedWidget widget) {
std::vector<gl::GLImplementation>
WaylandSurfaceFactory::GetAllowedGLImplementations() {
std::vector<gl::GLImplementation> impls;
- if (egl_implementation_)
+ if (egl_implementation_) {
impls.push_back(gl::kGLImplementationEGLGLES2);
+ impls.push_back(gl::kGLImplementationSwiftShaderGL);
+ }
impls.push_back(gl::kGLImplementationOSMesaGL);
return impls;
}
« no previous file with comments | « ui/ozone/platform/drm/gpu/gbm_surface_factory.cc ('k') | ui/ozone/platform/x11/x11_surface_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698