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

Unified Diff: sky/shell/shell.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/shell.cc
diff --git a/sky/shell/shell.cc b/sky/shell/shell.cc
new file mode 100644
index 0000000000000000000000000000000000000000..3a465d008fadd4c55c3248722133938d95bf374a
--- /dev/null
+++ b/sky/shell/shell.cc
@@ -0,0 +1,41 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "sky/shell/shell.h"
+
+#include "base/bind.h"
+#include "base/single_thread_task_runner.h"
+#include "base/threading/thread.h"
+#include "sky/shell/sky_view.h"
+
+namespace sky {
+namespace shell {
+
+Shell::Shell(scoped_refptr<base::SingleThreadTaskRunner> java_task_runner)
+ : java_task_runner_(java_task_runner) {
+}
+
+Shell::~Shell() {
+}
+
+void Shell::Init() {
+ gpu_thread_.reset(new base::Thread("gpu_thread"));
+ gpu_thread_->Start();
+ gpu_driver_.reset(new GPUDriver());
+
+ view_.reset(new SkyView(this));
+ view_->Init();
+}
+
+void Shell::OnAcceleratedWidgetAvailable(gfx::AcceleratedWidget widget) {
+ gpu_thread_->message_loop()->PostTask(
+ FROM_HERE,
+ base::Bind(&GPUDriver::Init, gpu_driver_->GetWeakPtr(), widget));
+}
+
+void Shell::OnDestroyed() {
+}
+
+} // namespace shell
+} // namespace sky
« sky/shell/library_loader.cc ('K') | « sky/shell/shell.h ('k') | sky/shell/sky_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698