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

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

Issue 2313353003: Ozone/Wayland: Move to newer APIs and improve GPU initialization (Closed)
Patch Set: Created 4 years, 3 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 | « no previous file | ui/ozone/platform/wayland/wayland_surface_factory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/platform/wayland/ozone_platform_wayland.cc
diff --git a/ui/ozone/platform/wayland/ozone_platform_wayland.cc b/ui/ozone/platform/wayland/ozone_platform_wayland.cc
index 5fe7761b595e0d48d11022032e2748a1f7c905ce..3ca9242be62950f4df7676efb1b3ebdcfaed65c0 100644
--- a/ui/ozone/platform/wayland/ozone_platform_wayland.cc
+++ b/ui/ozone/platform/wayland/ozone_platform_wayland.cc
@@ -66,6 +66,11 @@ class OzonePlatformWayland : public OzonePlatform {
}
void InitializeUI() override {
+ InitParams default_params;
+ InitializeUI(default_params);
+ }
+
+ void InitializeUI(const InitParams& args) override {
connection_.reset(new WaylandConnection);
if (!connection_->Initialize())
LOG(FATAL) << "Failed to initialize Wayland platform";
@@ -78,10 +83,24 @@ class OzonePlatformWayland : public OzonePlatform {
}
void InitializeGPU() override {
- // Don't reinitialize the surface factory in case InitializeUI was called
- // previously in the same process.
- if (!surface_factory_)
+ InitParams default_params;
+ InitializeGPU(default_params);
+ }
+
+ void InitializeGPU(const InitParams& args) override {
+ // TODO(fwang): args.single_process parameter should be checked here; make
+ // sure callers pass in the proper value. Once it happens, the check whether
+ // surface factory was set in the same process by a previous InitializeUI
+ // call becomes unneeded.
+ if (!surface_factory_) {
+ // TODO(fwang): Separate processes can not share a Wayland connection
+ // and so the current implementations of GLOzoneEGLWayland and
+ // WaylandCanvasSurface may only work when UI and GPU live in the same
+ // process. GetSurfaceFactoryOzone() must be non-null so a dummy instance
+ // of WaylandSurfaceFactory is needed to make the GPU initialization
+ // gracefully fail.
surface_factory_.reset(new WaylandSurfaceFactory(nullptr));
+ }
}
private:
« no previous file with comments | « no previous file | ui/ozone/platform/wayland/wayland_surface_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698