| 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/base/cursor/ozone/bitmap_cursor_factory_ozone.h" |
| 8 #include "ui/events/ozone/device/device_manager.h" | 9 #include "ui/events/ozone/device/device_manager.h" |
| 9 #include "ui/events/ozone/evdev/cursor_delegate_evdev.h" | 10 #include "ui/events/ozone/evdev/cursor_delegate_evdev.h" |
| 10 #include "ui/events/ozone/evdev/event_factory_evdev.h" | 11 #include "ui/events/ozone/evdev/event_factory_evdev.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_cursor.h" |
| 13 #include "ui/ozone/platform/dri/dri_surface_factory.h" | 14 #include "ui/ozone/platform/dri/dri_surface_factory.h" |
| 14 #include "ui/ozone/platform/dri/dri_window.h" | 15 #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_delegate_impl.h" |
| 16 #include "ui/ozone/platform/dri/dri_window_manager.h" | 17 #include "ui/ozone/platform/dri/dri_window_manager.h" |
| 17 #include "ui/ozone/platform/dri/dri_wrapper.h" | 18 #include "ui/ozone/platform/dri/dri_wrapper.h" |
| 18 #include "ui/ozone/platform/dri/screen_manager.h" | 19 #include "ui/ozone/platform/dri/screen_manager.h" |
| 19 #include "ui/ozone/platform/dri/virtual_terminal_manager.h" | 20 #include "ui/ozone/platform/dri/virtual_terminal_manager.h" |
| 20 #include "ui/ozone/public/ozone_platform.h" | 21 #include "ui/ozone/public/ozone_platform.h" |
| 21 | 22 |
| 22 #if defined(OS_CHROMEOS) | 23 #if defined(OS_CHROMEOS) |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 } | 64 } |
| 64 virtual scoped_ptr<PlatformWindow> CreatePlatformWindow( | 65 virtual scoped_ptr<PlatformWindow> CreatePlatformWindow( |
| 65 PlatformWindowDelegate* delegate, | 66 PlatformWindowDelegate* delegate, |
| 66 const gfx::Rect& bounds) OVERRIDE { | 67 const gfx::Rect& bounds) OVERRIDE { |
| 67 scoped_ptr<DriWindow> platform_window(new DriWindow( | 68 scoped_ptr<DriWindow> platform_window(new DriWindow( |
| 68 delegate, | 69 delegate, |
| 69 bounds, | 70 bounds, |
| 70 scoped_ptr<DriWindowDelegate>(new DriWindowDelegateImpl( | 71 scoped_ptr<DriWindowDelegate>(new DriWindowDelegateImpl( |
| 71 window_manager_.NextAcceleratedWidget(), screen_manager_.get())), | 72 window_manager_.NextAcceleratedWidget(), screen_manager_.get())), |
| 72 event_factory_ozone_.get(), | 73 event_factory_ozone_.get(), |
| 73 &window_manager_)); | 74 &window_manager_, |
| 75 cursor_.get())); |
| 74 platform_window->Initialize(); | 76 platform_window->Initialize(); |
| 75 return platform_window.PassAs<PlatformWindow>(); | 77 return platform_window.PassAs<PlatformWindow>(); |
| 76 } | 78 } |
| 77 #if defined(OS_CHROMEOS) | 79 #if defined(OS_CHROMEOS) |
| 78 virtual scoped_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate() | 80 virtual scoped_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate() |
| 79 OVERRIDE { | 81 OVERRIDE { |
| 80 return scoped_ptr<NativeDisplayDelegate>(new NativeDisplayDelegateDri( | 82 return scoped_ptr<NativeDisplayDelegate>(new NativeDisplayDelegateDri( |
| 81 dri_.get(), screen_manager_.get(), device_manager_.get())); | 83 dri_.get(), screen_manager_.get(), device_manager_.get())); |
| 82 } | 84 } |
| 83 virtual scoped_ptr<TouchscreenDeviceManager> | 85 virtual scoped_ptr<TouchscreenDeviceManager> |
| 84 CreateTouchscreenDeviceManager() OVERRIDE { | 86 CreateTouchscreenDeviceManager() OVERRIDE { |
| 85 return scoped_ptr<TouchscreenDeviceManager>( | 87 return scoped_ptr<TouchscreenDeviceManager>( |
| 86 new TouchscreenDeviceManagerOzone()); | 88 new TouchscreenDeviceManagerOzone()); |
| 87 } | 89 } |
| 88 #endif | 90 #endif |
| 89 virtual void InitializeUI() OVERRIDE { | 91 virtual void InitializeUI() OVERRIDE { |
| 90 surface_factory_ozone_.reset(new DriSurfaceFactory( | 92 surface_factory_ozone_.reset(new DriSurfaceFactory( |
| 91 dri_.get(), screen_manager_.get(), &window_manager_)); | 93 dri_.get(), screen_manager_.get(), &window_manager_)); |
| 92 cursor_factory_ozone_.reset( | 94 cursor_factory_ozone_.reset(new BitmapCursorFactoryOzone); |
| 93 new CursorFactoryEvdevDri(surface_factory_ozone_.get())); | 95 cursor_.reset(new DriCursor(surface_factory_ozone_.get())); |
| 94 event_factory_ozone_.reset(new EventFactoryEvdev( | 96 event_factory_ozone_.reset( |
| 95 cursor_factory_ozone_.get(), device_manager_.get())); | 97 new EventFactoryEvdev(cursor_.get(), device_manager_.get())); |
| 96 if (surface_factory_ozone_->InitializeHardware() != | 98 if (surface_factory_ozone_->InitializeHardware() != |
| 97 DriSurfaceFactory::INITIALIZED) | 99 DriSurfaceFactory::INITIALIZED) |
| 98 LOG(FATAL) << "failed to initialize display hardware"; | 100 LOG(FATAL) << "failed to initialize display hardware"; |
| 99 | 101 |
| 100 } | 102 } |
| 101 | 103 |
| 102 virtual void InitializeGPU() OVERRIDE {} | 104 virtual void InitializeGPU() OVERRIDE {} |
| 103 | 105 |
| 104 private: | 106 private: |
| 105 scoped_ptr<VirtualTerminalManager> vt_manager_; | 107 scoped_ptr<VirtualTerminalManager> vt_manager_; |
| 106 scoped_ptr<DriWrapper> dri_; | 108 scoped_ptr<DriWrapper> dri_; |
| 107 scoped_ptr<DriBufferGenerator> buffer_generator_; | 109 scoped_ptr<DriBufferGenerator> buffer_generator_; |
| 108 scoped_ptr<ScreenManager> screen_manager_; | 110 scoped_ptr<ScreenManager> screen_manager_; |
| 109 scoped_ptr<DeviceManager> device_manager_; | 111 scoped_ptr<DeviceManager> device_manager_; |
| 110 | 112 |
| 111 scoped_ptr<DriSurfaceFactory> surface_factory_ozone_; | 113 scoped_ptr<DriSurfaceFactory> surface_factory_ozone_; |
| 112 scoped_ptr<CursorFactoryEvdevDri> cursor_factory_ozone_; | 114 scoped_ptr<BitmapCursorFactoryOzone> cursor_factory_ozone_; |
| 115 scoped_ptr<DriCursor> cursor_; |
| 113 scoped_ptr<EventFactoryEvdev> event_factory_ozone_; | 116 scoped_ptr<EventFactoryEvdev> event_factory_ozone_; |
| 114 | 117 |
| 115 DriWindowManager window_manager_; | 118 DriWindowManager window_manager_; |
| 116 | 119 |
| 117 DISALLOW_COPY_AND_ASSIGN(OzonePlatformDri); | 120 DISALLOW_COPY_AND_ASSIGN(OzonePlatformDri); |
| 118 }; | 121 }; |
| 119 | 122 |
| 120 } // namespace | 123 } // namespace |
| 121 | 124 |
| 122 OzonePlatform* CreateOzonePlatformDri() { return new OzonePlatformDri; } | 125 OzonePlatform* CreateOzonePlatformDri() { return new OzonePlatformDri; } |
| 123 | 126 |
| 124 } // namespace ui | 127 } // namespace ui |
| OLD | NEW |