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

Unified Diff: sky/shell/shell_view.cc

Issue 1187503003: Refactor SkyShell to allow multiple SkyViews (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: s/instance/sky_shell/ Created 5 years, 6 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 | « sky/shell/shell_view.h ('k') | sky/shell/ui/engine.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/shell/shell_view.cc
diff --git a/sky/shell/shell_view.cc b/sky/shell/shell_view.cc
new file mode 100644
index 0000000000000000000000000000000000000000..bbcd069a3ab91b57b8f6d9f4863a2098cf45988d
--- /dev/null
+++ b/sky/shell/shell_view.cc
@@ -0,0 +1,43 @@
+// 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_view.h"
+
+#include "base/bind.h"
+#include "base/single_thread_task_runner.h"
+#include "sky/shell/gpu/rasterizer.h"
+#include "sky/shell/platform_view.h"
+#include "sky/shell/shell.h"
+#include "sky/shell/ui/engine.h"
+
+namespace sky {
+namespace shell {
+
+ShellView::ShellView(Shell& shell)
+ : shell_(shell) {
+ rasterizer_.reset(new Rasterizer());
+ CreateEngine();
+ CreatePlatformView();
+}
+
+ShellView::~ShellView() {
+}
+
+void ShellView::CreateEngine() {
+ Engine::Config config;
+ config.service_provider_context = shell_.service_provider_context();
+ config.gpu_task_runner = shell_.gpu_task_runner();
+ config.gpu_delegate = rasterizer_->GetWeakPtr();
+ engine_.reset(new Engine(config));
+}
+
+void ShellView::CreatePlatformView() {
+ PlatformView::Config config;
+ config.ui_task_runner = shell_.ui_task_runner();
+ config.ui_delegate = engine_->GetWeakPtr();
+ view_.reset(PlatformView::Create(config));
+}
+
+} // namespace shell
+} // namespace sky
« no previous file with comments | « sky/shell/shell_view.h ('k') | sky/shell/ui/engine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698