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.h" |
| 6 |
| 7 #include "base/bind.h" |
| 8 #include "base/single_thread_task_runner.h" |
| 9 #include "base/threading/thread.h" |
| 10 #include "sky/shell/sky_view.h" |
| 11 |
| 12 namespace sky { |
| 13 namespace shell { |
| 14 |
| 15 Shell::Shell(scoped_refptr<base::SingleThreadTaskRunner> java_task_runner) |
| 16 : java_task_runner_(java_task_runner) { |
| 17 } |
| 18 |
| 19 Shell::~Shell() { |
| 20 } |
| 21 |
| 22 void Shell::Init() { |
| 23 gpu_thread_.reset(new base::Thread("gpu_thread")); |
| 24 gpu_thread_->Start(); |
| 25 gpu_driver_.reset(new GPUDriver()); |
| 26 |
| 27 view_.reset(new SkyView(this)); |
| 28 view_->Init(); |
| 29 } |
| 30 |
| 31 void Shell::OnAcceleratedWidgetAvailable(gfx::AcceleratedWidget widget) { |
| 32 gpu_thread_->message_loop()->PostTask( |
| 33 FROM_HERE, |
| 34 base::Bind(&GPUDriver::Init, gpu_driver_->GetWeakPtr(), widget)); |
| 35 } |
| 36 |
| 37 void Shell::OnDestroyed() { |
| 38 } |
| 39 |
| 40 } // namespace shell |
| 41 } // namespace sky |
OLD | NEW |