summaryrefslogtreecommitdiff
path: root/chromium/components/viz/demo/demo_main.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/components/viz/demo/demo_main.cc')
-rw-r--r--chromium/components/viz/demo/demo_main.cc22
1 files changed, 15 insertions, 7 deletions
diff --git a/chromium/components/viz/demo/demo_main.cc b/chromium/components/viz/demo/demo_main.cc
index f470f6c7d47..6de8e394c3d 100644
--- a/chromium/components/viz/demo/demo_main.cc
+++ b/chromium/components/viz/demo/demo_main.cc
@@ -20,6 +20,7 @@
#include "mojo/core/embedder/scoped_ipc_support.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
+#include "ui/base/ui_base_features.h"
#include "ui/events/platform/platform_event_source.h"
#include "ui/platform_window/platform_window.h"
#include "ui/platform_window/platform_window_delegate.h"
@@ -30,7 +31,6 @@
#endif
#if defined(OS_WIN)
-#include "ui/base/cursor/cursor_loader_win.h"
#include "ui/platform_window/win/win_window.h"
#endif
@@ -85,7 +85,8 @@ class InitUI {
public:
InitUI() {
#if defined(USE_X11)
- XInitThreads();
+ if (!features::IsUsingOzonePlatform())
+ XInitThreads();
#endif
event_source_ = ui::PlatformEventSource::CreateDefault();
}
@@ -117,15 +118,22 @@ class DemoWindow : public ui::PlatformWindowDelegate {
std::unique_ptr<ui::PlatformWindow> CreatePlatformWindow(
const gfx::Rect& bounds) {
ui::PlatformWindowInitProperties props(bounds);
+#if defined(USE_X11) || defined(USE_OZONE)
#if defined(USE_OZONE)
- return ui::OzonePlatform::GetInstance()->CreatePlatformWindow(
- this, std::move(props));
-#elif defined(OS_WIN)
- return std::make_unique<ui::WinWindow>(this, props.bounds);
-#elif defined(USE_X11)
+ if (features::IsUsingOzonePlatform()) {
+ return ui::OzonePlatform::GetInstance()->CreatePlatformWindow(
+ this, std::move(props));
+ }
+#endif
+#if defined(USE_X11)
auto x11_window = std::make_unique<ui::X11Window>(this);
x11_window->Initialize(std::move(props));
return x11_window;
+#endif
+ NOTREACHED();
+ return nullptr;
+#elif defined(OS_WIN)
+ return std::make_unique<ui::WinWindow>(this, props.bounds);
#else
NOTIMPLEMENTED();
return nullptr;