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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « sky/shell/shell_view.h ('k') | sky/shell/ui/engine.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "sky/shell/shell_view.h"
6
7 #include "base/bind.h"
8 #include "base/single_thread_task_runner.h"
9 #include "sky/shell/gpu/rasterizer.h"
10 #include "sky/shell/platform_view.h"
11 #include "sky/shell/shell.h"
12 #include "sky/shell/ui/engine.h"
13
14 namespace sky {
15 namespace shell {
16
17 ShellView::ShellView(Shell& shell)
18 : shell_(shell) {
19 rasterizer_.reset(new Rasterizer());
20 CreateEngine();
21 CreatePlatformView();
22 }
23
24 ShellView::~ShellView() {
25 }
26
27 void ShellView::CreateEngine() {
28 Engine::Config config;
29 config.service_provider_context = shell_.service_provider_context();
30 config.gpu_task_runner = shell_.gpu_task_runner();
31 config.gpu_delegate = rasterizer_->GetWeakPtr();
32 engine_.reset(new Engine(config));
33 }
34
35 void ShellView::CreatePlatformView() {
36 PlatformView::Config config;
37 config.ui_task_runner = shell_.ui_task_runner();
38 config.ui_delegate = engine_->GetWeakPtr();
39 view_.reset(PlatformView::Create(config));
40 }
41
42 } // namespace shell
43 } // namespace sky
OLDNEW
« 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