Index: sky/shell/instance.cc |
diff --git a/sky/shell/instance.cc b/sky/shell/instance.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..bd2d2c962e6a006b9c4bb723b6835f9e86dd7122 |
--- /dev/null |
+++ b/sky/shell/instance.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/instance.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 { |
+ |
+Instance::Instance(Shell& shell) |
+ : shell_(shell) { |
+ rasterizer_.reset(new Rasterizer()); |
+ CreateEngine(); |
+ CreateView(); |
+} |
+ |
+Instance::~Instance() { |
+} |
+ |
+void Instance::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 Instance::CreateView() { |
+ 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 |