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 #include "ui/ozone/platform/dri/ozone_platform_gbm.h" | 5 #include "ui/ozone/platform/dri/ozone_platform_gbm.h" |
6 | 6 |
7 #include <dlfcn.h> | 7 #include <dlfcn.h> |
8 #include <gbm.h> | 8 #include <gbm.h> |
9 #include <stdlib.h> | 9 #include <stdlib.h> |
10 | 10 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 // OzonePlatform: | 71 // OzonePlatform: |
72 virtual ui::SurfaceFactoryOzone* GetSurfaceFactoryOzone() OVERRIDE { | 72 virtual ui::SurfaceFactoryOzone* GetSurfaceFactoryOzone() OVERRIDE { |
73 return surface_factory_ozone_.get(); | 73 return surface_factory_ozone_.get(); |
74 } | 74 } |
75 virtual EventFactoryOzone* GetEventFactoryOzone() OVERRIDE { | 75 virtual EventFactoryOzone* GetEventFactoryOzone() OVERRIDE { |
76 return event_factory_ozone_.get(); | 76 return event_factory_ozone_.get(); |
77 } | 77 } |
78 virtual CursorFactoryOzone* GetCursorFactoryOzone() OVERRIDE { | 78 virtual CursorFactoryOzone* GetCursorFactoryOzone() OVERRIDE { |
79 return cursor_factory_ozone_.get(); | 79 return cursor_factory_ozone_.get(); |
80 } | 80 } |
| 81 virtual GpuPlatformSupport* GetGpuPlatformSupport() OVERRIDE { |
| 82 return gpu_platform_support_.get() |
| 83 } |
| 84 virtual GpuPlatformSupportHost* GetGpuPlatformSupportHost() OVERRIDE { |
| 85 return gpu_platform_support_host_.get(); |
| 86 } |
81 #if defined(OS_CHROMEOS) | 87 #if defined(OS_CHROMEOS) |
82 virtual scoped_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate() | 88 virtual scoped_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate() |
83 OVERRIDE { | 89 OVERRIDE { |
84 return scoped_ptr<NativeDisplayDelegate>(new NativeDisplayDelegateOzone()); | 90 return scoped_ptr<NativeDisplayDelegate>(new NativeDisplayDelegateOzone()); |
85 } | 91 } |
86 virtual scoped_ptr<TouchscreenDeviceManager> | 92 virtual scoped_ptr<TouchscreenDeviceManager> |
87 CreateTouchscreenDeviceManager() OVERRIDE { | 93 CreateTouchscreenDeviceManager() OVERRIDE { |
88 return scoped_ptr<TouchscreenDeviceManager>( | 94 return scoped_ptr<TouchscreenDeviceManager>( |
89 new TouchscreenDeviceManagerOzone()); | 95 new TouchscreenDeviceManagerOzone()); |
90 } | 96 } |
91 #endif | 97 #endif |
92 virtual void InitializeUI() OVERRIDE { | 98 virtual void InitializeUI() OVERRIDE { |
93 vt_manager_.reset(new VirtualTerminalManager()); | 99 vt_manager_.reset(new VirtualTerminalManager()); |
94 // Needed since the browser process creates the accelerated widgets and that | 100 // Needed since the browser process creates the accelerated widgets and that |
95 // happens through SFO. | 101 // happens through SFO. |
96 surface_factory_ozone_.reset(new GbmSurfaceFactory(NULL, NULL, NULL)); | 102 surface_factory_ozone_.reset(new GbmSurfaceFactory(NULL, NULL, NULL)); |
97 | 103 |
98 device_manager_ = CreateDeviceManager(); | 104 device_manager_ = CreateDeviceManager(); |
99 cursor_factory_ozone_.reset(new CursorFactoryOzone()); | 105 cursor_factory_ozone_.reset(new CursorFactoryOzone()); |
100 event_factory_ozone_.reset(new EventFactoryEvdev( | 106 event_factory_ozone_.reset(new EventFactoryEvdev( |
101 NULL, device_manager_.get())); | 107 NULL, device_manager_.get())); |
| 108 |
| 109 gpu_platform_support_host_.reset(CreateStubGpuPlatformSupportHost()); |
102 } | 110 } |
103 | 111 |
104 virtual void InitializeGPU() OVERRIDE { | 112 virtual void InitializeGPU() OVERRIDE { |
105 dri_.reset(new DriWrapper(kDefaultGraphicsCardPath)); | 113 dri_.reset(new DriWrapper(kDefaultGraphicsCardPath)); |
106 surface_generator_.reset(new GbmSurfaceGenerator(dri_.get())); | 114 surface_generator_.reset(new GbmSurfaceGenerator(dri_.get())); |
107 screen_manager_.reset(new ScreenManager(dri_.get(), | 115 screen_manager_.reset(new ScreenManager(dri_.get(), |
108 surface_generator_.get())); | 116 surface_generator_.get())); |
109 surface_factory_ozone_.reset( | 117 surface_factory_ozone_.reset( |
110 new GbmSurfaceFactory(dri_.get(), | 118 new GbmSurfaceFactory(dri_.get(), |
111 surface_generator_->device(), | 119 surface_generator_->device(), |
112 screen_manager_.get())); | 120 screen_manager_.get())); |
| 121 |
| 122 gpu_platform_support_.reset(CreateStubGpuPlatformSupport()); |
113 } | 123 } |
114 | 124 |
115 private: | 125 private: |
116 scoped_ptr<VirtualTerminalManager> vt_manager_; | 126 scoped_ptr<VirtualTerminalManager> vt_manager_; |
117 scoped_ptr<DriWrapper> dri_; | 127 scoped_ptr<DriWrapper> dri_; |
118 scoped_ptr<GbmSurfaceGenerator> surface_generator_; | 128 scoped_ptr<GbmSurfaceGenerator> surface_generator_; |
119 scoped_ptr<ScreenManager> screen_manager_; | 129 scoped_ptr<ScreenManager> screen_manager_; |
120 scoped_ptr<DeviceManager> device_manager_; | 130 scoped_ptr<DeviceManager> device_manager_; |
121 | 131 |
122 scoped_ptr<GbmSurfaceFactory> surface_factory_ozone_; | 132 scoped_ptr<GbmSurfaceFactory> surface_factory_ozone_; |
123 scoped_ptr<CursorFactoryOzone> cursor_factory_ozone_; | 133 scoped_ptr<CursorFactoryOzone> cursor_factory_ozone_; |
124 scoped_ptr<EventFactoryEvdev> event_factory_ozone_; | 134 scoped_ptr<EventFactoryEvdev> event_factory_ozone_; |
125 | 135 |
| 136 scoped_ptr<GpuPlatformSupport> gpu_platform_support_; |
| 137 scoped_ptr<GpuPlatformSupportHost> gpu_platform_support_host_; |
| 138 |
126 DISALLOW_COPY_AND_ASSIGN(OzonePlatformGbm); | 139 DISALLOW_COPY_AND_ASSIGN(OzonePlatformGbm); |
127 }; | 140 }; |
128 | 141 |
129 } // namespace | 142 } // namespace |
130 | 143 |
131 OzonePlatform* CreateOzonePlatformGbm() { return new OzonePlatformGbm; } | 144 OzonePlatform* CreateOzonePlatformGbm() { return new OzonePlatformGbm; } |
132 | 145 |
133 } // namespace ui | 146 } // namespace ui |
OLD | NEW |