OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_dri.h" | 5 #include "ui/ozone/platform/dri/ozone_platform_dri.h" |
6 | 6 |
7 #include "base/at_exit.h" | 7 #include "base/at_exit.h" |
8 #include "ui/events/ozone/device/device_manager.h" | 8 #include "ui/events/ozone/device/device_manager.h" |
9 #include "ui/events/ozone/evdev/cursor_delegate_evdev.h" | 9 #include "ui/events/ozone/evdev/cursor_delegate_evdev.h" |
10 #include "ui/events/ozone/evdev/event_factory_evdev.h" | 10 #include "ui/events/ozone/evdev/event_factory_evdev.h" |
11 #include "ui/ozone/platform/dri/cursor_factory_evdev_dri.h" | 11 #include "ui/ozone/platform/dri/cursor_factory_evdev_dri.h" |
12 #include "ui/ozone/platform/dri/dri_buffer.h" | 12 #include "ui/ozone/platform/dri/dri_buffer.h" |
13 #include "ui/ozone/platform/dri/dri_surface_factory.h" | 13 #include "ui/ozone/platform/dri/dri_surface_factory.h" |
14 #include "ui/ozone/platform/dri/dri_window.h" | 14 #include "ui/ozone/platform/dri/dri_window.h" |
15 #include "ui/ozone/platform/dri/dri_window_delegate_impl.h" | |
16 #include "ui/ozone/platform/dri/dri_window_manager.h" | |
15 #include "ui/ozone/platform/dri/dri_wrapper.h" | 17 #include "ui/ozone/platform/dri/dri_wrapper.h" |
16 #include "ui/ozone/platform/dri/screen_manager.h" | 18 #include "ui/ozone/platform/dri/screen_manager.h" |
17 #include "ui/ozone/platform/dri/virtual_terminal_manager.h" | 19 #include "ui/ozone/platform/dri/virtual_terminal_manager.h" |
18 #include "ui/ozone/public/ozone_platform.h" | 20 #include "ui/ozone/public/ozone_platform.h" |
19 | 21 |
20 #if defined(OS_CHROMEOS) | 22 #if defined(OS_CHROMEOS) |
21 #include "ui/ozone/common/chromeos/touchscreen_device_manager_ozone.h" | 23 #include "ui/ozone/common/chromeos/touchscreen_device_manager_ozone.h" |
22 #include "ui/ozone/platform/dri/chromeos/native_display_delegate_dri.h" | 24 #include "ui/ozone/platform/dri/chromeos/native_display_delegate_dri.h" |
23 #endif | 25 #endif |
24 | 26 |
(...skipping 30 matching lines...) Expand all Loading... | |
55 } | 57 } |
56 virtual GpuPlatformSupport* GetGpuPlatformSupport() OVERRIDE { | 58 virtual GpuPlatformSupport* GetGpuPlatformSupport() OVERRIDE { |
57 return NULL; // no GPU support | 59 return NULL; // no GPU support |
58 } | 60 } |
59 virtual GpuPlatformSupportHost* GetGpuPlatformSupportHost() OVERRIDE { | 61 virtual GpuPlatformSupportHost* GetGpuPlatformSupportHost() OVERRIDE { |
60 return NULL; // no GPU support | 62 return NULL; // no GPU support |
61 } | 63 } |
62 virtual scoped_ptr<PlatformWindow> CreatePlatformWindow( | 64 virtual scoped_ptr<PlatformWindow> CreatePlatformWindow( |
63 PlatformWindowDelegate* delegate, | 65 PlatformWindowDelegate* delegate, |
64 const gfx::Rect& bounds) OVERRIDE { | 66 const gfx::Rect& bounds) OVERRIDE { |
65 return scoped_ptr<PlatformWindow>( | 67 return scoped_ptr<PlatformWindow>(new DriWindow( |
66 new DriWindow(delegate, | 68 delegate, |
67 bounds, | 69 bounds, |
68 surface_factory_ozone_.get(), | 70 scoped_ptr<DriWindowDelegate>(new DriWindowDelegateImpl( |
alexst (slow to review)
2014/08/20 21:51:09
make_scoped_ptr()
dnicoara
2014/08/21 20:54:17
"I'm sorry dave i'm afraid i can't do that"
Need
| |
69 event_factory_ozone_.get())); | 71 window_manager_.NextAcceleratedWidget(), screen_manager_.get())), |
72 event_factory_ozone_.get())); | |
70 } | 73 } |
71 #if defined(OS_CHROMEOS) | 74 #if defined(OS_CHROMEOS) |
72 virtual scoped_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate() | 75 virtual scoped_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate() |
73 OVERRIDE { | 76 OVERRIDE { |
74 return scoped_ptr<NativeDisplayDelegate>(new NativeDisplayDelegateDri( | 77 return scoped_ptr<NativeDisplayDelegate>(new NativeDisplayDelegateDri( |
75 dri_.get(), screen_manager_.get(), device_manager_.get())); | 78 dri_.get(), screen_manager_.get(), device_manager_.get())); |
76 } | 79 } |
77 virtual scoped_ptr<TouchscreenDeviceManager> | 80 virtual scoped_ptr<TouchscreenDeviceManager> |
78 CreateTouchscreenDeviceManager() OVERRIDE { | 81 CreateTouchscreenDeviceManager() OVERRIDE { |
79 return scoped_ptr<TouchscreenDeviceManager>( | 82 return scoped_ptr<TouchscreenDeviceManager>( |
80 new TouchscreenDeviceManagerOzone()); | 83 new TouchscreenDeviceManagerOzone()); |
81 } | 84 } |
82 #endif | 85 #endif |
83 virtual void InitializeUI() OVERRIDE { | 86 virtual void InitializeUI() OVERRIDE { |
84 surface_factory_ozone_.reset( | 87 surface_factory_ozone_.reset(new DriSurfaceFactory( |
85 new DriSurfaceFactory(dri_.get(), screen_manager_.get())); | 88 dri_.get(), screen_manager_.get(), &window_manager_)); |
86 cursor_factory_ozone_.reset( | 89 cursor_factory_ozone_.reset( |
87 new CursorFactoryEvdevDri(surface_factory_ozone_.get())); | 90 new CursorFactoryEvdevDri(surface_factory_ozone_.get())); |
88 event_factory_ozone_.reset(new EventFactoryEvdev( | 91 event_factory_ozone_.reset(new EventFactoryEvdev( |
89 cursor_factory_ozone_.get(), device_manager_.get())); | 92 cursor_factory_ozone_.get(), device_manager_.get())); |
90 if (surface_factory_ozone_->InitializeHardware() != | 93 if (surface_factory_ozone_->InitializeHardware() != |
91 DriSurfaceFactory::INITIALIZED) | 94 DriSurfaceFactory::INITIALIZED) |
92 LOG(FATAL) << "failed to initialize display hardware"; | 95 LOG(FATAL) << "failed to initialize display hardware"; |
93 | 96 |
94 } | 97 } |
95 | 98 |
96 virtual void InitializeGPU() OVERRIDE {} | 99 virtual void InitializeGPU() OVERRIDE {} |
97 | 100 |
98 private: | 101 private: |
99 scoped_ptr<VirtualTerminalManager> vt_manager_; | 102 scoped_ptr<VirtualTerminalManager> vt_manager_; |
100 scoped_ptr<DriWrapper> dri_; | 103 scoped_ptr<DriWrapper> dri_; |
101 scoped_ptr<DriBufferGenerator> buffer_generator_; | 104 scoped_ptr<DriBufferGenerator> buffer_generator_; |
102 scoped_ptr<ScreenManager> screen_manager_; | 105 scoped_ptr<ScreenManager> screen_manager_; |
103 scoped_ptr<DeviceManager> device_manager_; | 106 scoped_ptr<DeviceManager> device_manager_; |
104 | 107 |
105 scoped_ptr<DriSurfaceFactory> surface_factory_ozone_; | 108 scoped_ptr<DriSurfaceFactory> surface_factory_ozone_; |
106 scoped_ptr<CursorFactoryEvdevDri> cursor_factory_ozone_; | 109 scoped_ptr<CursorFactoryEvdevDri> cursor_factory_ozone_; |
107 scoped_ptr<EventFactoryEvdev> event_factory_ozone_; | 110 scoped_ptr<EventFactoryEvdev> event_factory_ozone_; |
108 | 111 |
112 DriWindowManager window_manager_; | |
113 | |
109 DISALLOW_COPY_AND_ASSIGN(OzonePlatformDri); | 114 DISALLOW_COPY_AND_ASSIGN(OzonePlatformDri); |
110 }; | 115 }; |
111 | 116 |
112 } // namespace | 117 } // namespace |
113 | 118 |
114 OzonePlatform* CreateOzonePlatformDri() { return new OzonePlatformDri; } | 119 OzonePlatform* CreateOzonePlatformDri() { return new OzonePlatformDri; } |
115 | 120 |
116 } // namespace ui | 121 } // namespace ui |
OLD | NEW |