OLD | NEW |
(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 |
OLD | NEW |