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

Unified Diff: sky/shell/shell.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.h ('k') | sky/shell/shell_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/shell/shell.cc
diff --git a/sky/shell/shell.cc b/sky/shell/shell.cc
index 00f24e27d808a4e53796cbd5fc97d1474f288567..33ad2dfcdb3aaba60f9ed82b51148a8fffe02c24 100644
--- a/sky/shell/shell.cc
+++ b/sky/shell/shell.cc
@@ -9,8 +9,6 @@
#include "mojo/common/message_pump_mojo.h"
#include "mojo/edk/embedder/embedder.h"
#include "mojo/edk/embedder/simple_platform_support.h"
-#include "sky/shell/platform_view.h"
-#include "sky/shell/gpu/rasterizer.h"
#include "sky/shell/ui/engine.h"
namespace sky {
@@ -34,9 +32,14 @@ Shell::Shell(scoped_ptr<ServiceProviderContext> service_provider_context)
base::Thread::Options options;
options.message_pump_factory = base::Bind(&CreateMessagePumpMojo);
- InitGPU(options);
- InitUI(options);
- InitView();
+ gpu_thread_.reset(new base::Thread("gpu_thread"));
+ gpu_thread_->StartWithOptions(options);
+
+ ui_thread_.reset(new base::Thread("ui_thread"));
+ ui_thread_->StartWithOptions(options);
+
+ ui_task_runner()->PostTask(
+ FROM_HERE, base::Bind(&Engine::Init, service_provider_context_.get()));
}
Shell::~Shell() {
@@ -51,33 +54,5 @@ Shell& Shell::Shared() {
return *g_shell;
}
-void Shell::InitGPU(const base::Thread::Options& options) {
- gpu_thread_.reset(new base::Thread("gpu_thread"));
- gpu_thread_->StartWithOptions(options);
-
- rasterizer_.reset(new Rasterizer());
-}
-
-void Shell::InitUI(const base::Thread::Options& options) {
- ui_thread_.reset(new base::Thread("ui_thread"));
- ui_thread_->StartWithOptions(options);
-
- Engine::Config config;
- config.service_provider_context = service_provider_context_.get();
- config.gpu_task_runner = gpu_thread_->message_loop()->task_runner();
- config.gpu_delegate = rasterizer_->GetWeakPtr();
- engine_.reset(new Engine(config));
-
- ui_thread_->message_loop()->PostTask(
- FROM_HERE, base::Bind(&Engine::Init, engine_->GetWeakPtr()));
-}
-
-void Shell::InitView() {
- PlatformView::Config config;
- config.ui_task_runner = ui_thread_->message_loop()->task_runner();
- config.ui_delegate = engine_->GetWeakPtr();
- view_.reset(new PlatformView(config));
-}
-
} // namespace shell
} // namespace sky
« no previous file with comments | « sky/shell/shell.h ('k') | sky/shell/shell_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698