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

Unified Diff: sky/shell/sky_main.cc

Issue 890803004: SkyShell should be able to draw a green square with GL (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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: sky/shell/sky_main.cc
diff --git a/sky/shell/sky_main.cc b/sky/shell/sky_main.cc
index 57a2f6e55843bf01540fb3f9f18dfefec25ca4a1..4cbea0b0f64847237244305d609c5359d076c027 100644
--- a/sky/shell/sky_main.cc
+++ b/sky/shell/sky_main.cc
@@ -17,6 +17,8 @@
#include "base/run_loop.h"
#include "base/threading/simple_thread.h"
#include "jni/SkyMain_jni.h"
+#include "sky/shell/shell.h"
+#include "ui/gl/gl_surface_egl.h"
using base::LazyInstance;
@@ -31,6 +33,8 @@ LazyInstance<scoped_ptr<base::MessageLoop>> g_java_message_loop =
LazyInstance<base::android::ScopedJavaGlobalRef<jobject>> g_main_activiy =
LAZY_INSTANCE_INITIALIZER;
+LazyInstance<scoped_ptr<Shell>> g_shell = LAZY_INSTANCE_INITIALIZER;
+
void InitializeLogging() {
logging::LoggingSettings settings;
settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG;
@@ -58,6 +62,14 @@ static void Init(JNIEnv* env,
g_java_message_loop.Get().reset(new base::MessageLoopForUI);
base::MessageLoopForUI::current()->Start();
+
+ gfx::GLSurface::InitializeOneOff();
+
+ g_shell.Get().reset(new Shell(g_java_message_loop.Get()->task_runner()));
+
+ g_java_message_loop.Get()->PostTask(
+ FROM_HERE,
+ base::Bind(&Shell::Init, base::Unretained(g_shell.Get().get())));
}
static jboolean Start(JNIEnv* env, jclass clazz) {
« sky/shell/library_loader.cc ('K') | « sky/shell/shell.cc ('k') | sky/shell/sky_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698