OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 UI_OZONE_PUBLIC_OZONE_PLATFORM_H_ | 5 #ifndef UI_OZONE_PUBLIC_OZONE_PLATFORM_H_ |
6 #define UI_OZONE_PUBLIC_OZONE_PLATFORM_H_ | 6 #define UI_OZONE_PUBLIC_OZONE_PLATFORM_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "ui/ozone/ozone_export.h" | 9 #include "ui/ozone/ozone_export.h" |
10 | 10 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
43 OzonePlatform(); | 43 OzonePlatform(); |
44 virtual ~OzonePlatform(); | 44 virtual ~OzonePlatform(); |
45 | 45 |
46 // Initializes the subsystems/resources necessary for the UI process (e.g. | 46 // Initializes the subsystems/resources necessary for the UI process (e.g. |
47 // events, surface, etc.) | 47 // events, surface, etc.) |
48 static void InitializeForUI(); | 48 static void InitializeForUI(); |
49 | 49 |
50 // Initializes the subsystems/resources necessary for the GPU process. | 50 // Initializes the subsystems/resources necessary for the GPU process. |
51 static void InitializeForGPU(); | 51 static void InitializeForGPU(); |
52 | 52 |
53 // Initializes the subsystems/resources necessary for the GPU process, after | |
54 // the message loop is started. This is used mainly for initialization tasks | |
55 // that need to take a reference to the UI thread MessageLoopProxy. | |
56 // InitializeForGPU() necessarily needs to be called first. | |
57 static void InitializeForGPUPostMainLoop(); | |
58 | |
53 static OzonePlatform* GetInstance(); | 59 static OzonePlatform* GetInstance(); |
54 | 60 |
55 // Factory getters to override in subclasses. The returned objects will be | 61 // Factory getters to override in subclasses. The returned objects will be |
56 // injected into the appropriate layer at startup. Subclasses should not | 62 // injected into the appropriate layer at startup. Subclasses should not |
57 // inject these objects themselves. Ownership is retained by OzonePlatform. | 63 // inject these objects themselves. Ownership is retained by OzonePlatform. |
58 virtual ui::SurfaceFactoryOzone* GetSurfaceFactoryOzone() = 0; | 64 virtual ui::SurfaceFactoryOzone* GetSurfaceFactoryOzone() = 0; |
59 virtual ui::CursorFactoryOzone* GetCursorFactoryOzone() = 0; | 65 virtual ui::CursorFactoryOzone* GetCursorFactoryOzone() = 0; |
60 virtual ui::InputController* GetInputController() = 0; | 66 virtual ui::InputController* GetInputController() = 0; |
61 virtual ui::GpuPlatformSupport* GetGpuPlatformSupport() = 0; | 67 virtual ui::GpuPlatformSupport* GetGpuPlatformSupport() = 0; |
62 virtual ui::GpuPlatformSupportHost* GetGpuPlatformSupportHost() = 0; | 68 virtual ui::GpuPlatformSupportHost* GetGpuPlatformSupportHost() = 0; |
63 virtual scoped_ptr<SystemInputInjector> CreateSystemInputInjector() = 0; | 69 virtual scoped_ptr<SystemInputInjector> CreateSystemInputInjector() = 0; |
64 virtual scoped_ptr<PlatformWindow> CreatePlatformWindow( | 70 virtual scoped_ptr<PlatformWindow> CreatePlatformWindow( |
65 PlatformWindowDelegate* delegate, | 71 PlatformWindowDelegate* delegate, |
66 const gfx::Rect& bounds) = 0; | 72 const gfx::Rect& bounds) = 0; |
67 virtual scoped_ptr<ui::NativeDisplayDelegate> | 73 virtual scoped_ptr<ui::NativeDisplayDelegate> |
68 CreateNativeDisplayDelegate() = 0; | 74 CreateNativeDisplayDelegate() = 0; |
69 | 75 |
70 private: | 76 private: |
71 virtual void InitializeUI() = 0; | 77 virtual void InitializeUI() = 0; |
72 virtual void InitializeGPU() = 0; | 78 virtual void InitializeGPU() = 0; |
79 virtual void InitializeGPUPostMainLoop() = 0; | |
spang
2015/03/31 20:58:49
Can you capitalize it as 'Gpu'. We could change th
vignatti (out of this project)
2015/04/01 16:26:11
Done.
| |
73 | 80 |
74 static void CreateInstance(); | 81 static void CreateInstance(); |
75 | 82 |
76 static OzonePlatform* instance_; | 83 static OzonePlatform* instance_; |
77 | 84 |
78 DISALLOW_COPY_AND_ASSIGN(OzonePlatform); | 85 DISALLOW_COPY_AND_ASSIGN(OzonePlatform); |
79 }; | 86 }; |
80 | 87 |
81 } // namespace ui | 88 } // namespace ui |
82 | 89 |
83 #endif // UI_OZONE_PUBLIC_OZONE_PLATFORM_H_ | 90 #endif // UI_OZONE_PUBLIC_OZONE_PLATFORM_H_ |
OLD | NEW |