OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef SKY_SHELL_SHELL_H_ | 5 #ifndef SKY_SHELL_SHELL_H_ |
6 #define SKY_SHELL_SHELL_H_ | 6 #define SKY_SHELL_SHELL_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/threading/thread.h" |
11 | 12 |
12 namespace base { | 13 namespace base { |
13 class Thread; | |
14 class SingleThreadTaskRunner; | 14 class SingleThreadTaskRunner; |
15 } | 15 } |
16 | 16 |
17 namespace sky { | 17 namespace sky { |
18 namespace shell { | 18 namespace shell { |
19 class Engine; | 19 class Engine; |
20 class Rasterizer; | 20 class Rasterizer; |
21 class SkyView; | 21 class PlatformView; |
22 | 22 |
23 class Shell { | 23 class Shell { |
24 public: | 24 public: |
25 explicit Shell(scoped_refptr<base::SingleThreadTaskRunner> java_task_runner); | |
26 ~Shell(); | 25 ~Shell(); |
27 | 26 |
28 void Init(); | 27 static void Init( |
| 28 scoped_refptr<base::SingleThreadTaskRunner> java_task_runner); |
| 29 static Shell& Shared(); |
| 30 |
| 31 PlatformView* view() const { return view_.get(); } |
29 | 32 |
30 private: | 33 private: |
| 34 explicit Shell(scoped_refptr<base::SingleThreadTaskRunner> java_task_runner); |
| 35 |
| 36 void InitGPU(const base::Thread::Options& options); |
| 37 void InitUI(const base::Thread::Options& options); |
| 38 void InitView(); |
| 39 |
31 scoped_refptr<base::SingleThreadTaskRunner> java_task_runner_; | 40 scoped_refptr<base::SingleThreadTaskRunner> java_task_runner_; |
32 scoped_ptr<base::Thread> gpu_thread_; | 41 scoped_ptr<base::Thread> gpu_thread_; |
33 scoped_ptr<base::Thread> ui_thread_; | 42 scoped_ptr<base::Thread> ui_thread_; |
34 | 43 |
35 scoped_ptr<SkyView> view_; | 44 scoped_ptr<PlatformView> view_; |
36 scoped_ptr<Rasterizer> rasterizer_; | 45 scoped_ptr<Rasterizer> rasterizer_; |
37 scoped_ptr<Engine> engine_; | 46 scoped_ptr<Engine> engine_; |
38 | 47 |
39 DISALLOW_COPY_AND_ASSIGN(Shell); | 48 DISALLOW_COPY_AND_ASSIGN(Shell); |
40 }; | 49 }; |
41 | 50 |
42 } // namespace shell | 51 } // namespace shell |
43 } // namespace sky | 52 } // namespace sky |
44 | 53 |
45 #endif // SKY_SHELL_SHELL_H_ | 54 #endif // SKY_SHELL_SHELL_H_ |
OLD | NEW |