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

Unified Diff: views/desktop/desktop_main.cc

Issue 7464027: Wayland support for views. views_desktop on Wayland. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Merged native_menu_wayland and native_menu_x and styling fixes Created 9 years, 4 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
Index: views/desktop/desktop_main.cc
diff --git a/views/desktop/desktop_main.cc b/views/desktop/desktop_main.cc
index 09db6165773d3d54e96455607efc9f77010d7496..ebee0391dd8321f4ac277eda05b85287aabbe482 100644
--- a/views/desktop/desktop_main.cc
+++ b/views/desktop/desktop_main.cc
@@ -17,6 +17,12 @@
#include <ole2.h>
#endif
+#if defined(USE_WAYLAND)
+#include "ui/gfx/gl/gl_surface_egl.h"
+#include "ui/wayland/wayland_display.h"
+#include "ui/wayland/wayland_message_pump.h"
+#endif
+
int main(int argc, char** argv) {
#if defined(OS_WIN)
OleInitialize(NULL);
@@ -24,8 +30,10 @@ int main(int argc, char** argv) {
// Initializes gtk stuff.
g_thread_init(NULL);
g_type_init();
+#if !defined(USE_WAYLAND)
gtk_init(&argc, &argv);
#endif
+#endif
CommandLine::Init(argc, argv);
@@ -39,6 +47,16 @@ int main(int argc, char** argv) {
ResourceBundle::InitSharedInstance("en-US");
+#if defined(USE_WAYLAND)
+ // Wayland uses EGL for drawing, so we need to initialize this as early as
+ // possible.
+ if (!gfx::GLSurface::InitializeOneOff()) {
+ LOG(ERROR) << "Failed to initialize GLSurface";
+ return -1;
+ }
+ ui::WaylandMessagePump wayland_message_pump(
+ ui::WaylandDisplay::GetDisplay(gfx::GLSurfaceEGL::GetNativeDisplay()));
+#endif
MessageLoop main_message_loop(MessageLoop::TYPE_UI);
views::desktop::DesktopViewsDelegate views_delegate;

Powered by Google App Engine
This is Rietveld 408576698