| 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/base/cursor/ozone/bitmap_cursor_factory_ozone.h" |
| 9 #include "ui/events/ozone/device/device_manager.h" | 9 #include "ui/events/ozone/device/device_manager.h" |
| 10 #include "ui/events/ozone/evdev/cursor_delegate_evdev.h" | 10 #include "ui/events/ozone/evdev/cursor_delegate_evdev.h" |
| 11 #include "ui/events/ozone/evdev/event_factory_evdev.h" | 11 #include "ui/events/ozone/evdev/event_factory_evdev.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_cursor.h" |
| 14 #include "ui/ozone/platform/dri/dri_surface_factory.h" | 14 #include "ui/ozone/platform/dri/dri_surface_factory.h" |
| 15 #include "ui/ozone/platform/dri/dri_window.h" | 15 #include "ui/ozone/platform/dri/dri_window.h" |
| 16 #include "ui/ozone/platform/dri/dri_window_delegate_impl.h" | 16 #include "ui/ozone/platform/dri/dri_window_delegate_impl.h" |
| 17 #include "ui/ozone/platform/dri/dri_window_manager.h" | 17 #include "ui/ozone/platform/dri/dri_window_manager.h" |
| 18 #include "ui/ozone/platform/dri/dri_wrapper.h" | 18 #include "ui/ozone/platform/dri/dri_wrapper.h" |
| 19 #include "ui/ozone/platform/dri/screen_manager.h" | 19 #include "ui/ozone/platform/dri/screen_manager.h" |
| 20 #include "ui/ozone/platform/dri/virtual_terminal_manager.h" | 20 #include "ui/ozone/platform/dri/virtual_terminal_manager.h" |
| 21 #include "ui/ozone/public/ozone_platform.h" | 21 #include "ui/ozone/public/ozone_platform.h" |
| 22 | 22 |
| 23 #if defined(OS_CHROMEOS) | 23 #if defined(OS_CHROMEOS) |
| 24 #include "ui/ozone/common/chromeos/touchscreen_device_manager_ozone.h" | |
| 25 #include "ui/ozone/platform/dri/chromeos/native_display_delegate_dri.h" | 24 #include "ui/ozone/platform/dri/chromeos/native_display_delegate_dri.h" |
| 26 #endif | 25 #endif |
| 27 | 26 |
| 28 namespace ui { | 27 namespace ui { |
| 29 | 28 |
| 30 namespace { | 29 namespace { |
| 31 | 30 |
| 32 const char kDefaultGraphicsCardPath[] = "/dev/dri/card0"; | 31 const char kDefaultGraphicsCardPath[] = "/dev/dri/card0"; |
| 33 | 32 |
| 34 // OzonePlatform for Linux DRI (Direct Rendering Infrastructure) | 33 // OzonePlatform for Linux DRI (Direct Rendering Infrastructure) |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 cursor_.get())); | 74 cursor_.get())); |
| 76 platform_window->Initialize(); | 75 platform_window->Initialize(); |
| 77 return platform_window.PassAs<PlatformWindow>(); | 76 return platform_window.PassAs<PlatformWindow>(); |
| 78 } | 77 } |
| 79 #if defined(OS_CHROMEOS) | 78 #if defined(OS_CHROMEOS) |
| 80 virtual scoped_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate() | 79 virtual scoped_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate() |
| 81 OVERRIDE { | 80 OVERRIDE { |
| 82 return scoped_ptr<NativeDisplayDelegate>(new NativeDisplayDelegateDri( | 81 return scoped_ptr<NativeDisplayDelegate>(new NativeDisplayDelegateDri( |
| 83 dri_.get(), screen_manager_.get(), device_manager_.get())); | 82 dri_.get(), screen_manager_.get(), device_manager_.get())); |
| 84 } | 83 } |
| 85 virtual scoped_ptr<TouchscreenDeviceManager> | |
| 86 CreateTouchscreenDeviceManager() OVERRIDE { | |
| 87 return scoped_ptr<TouchscreenDeviceManager>( | |
| 88 new TouchscreenDeviceManagerOzone()); | |
| 89 } | |
| 90 #endif | 84 #endif |
| 91 virtual void InitializeUI() OVERRIDE { | 85 virtual void InitializeUI() OVERRIDE { |
| 92 dri_->Initialize(); | 86 dri_->Initialize(); |
| 93 surface_factory_ozone_.reset(new DriSurfaceFactory( | 87 surface_factory_ozone_.reset(new DriSurfaceFactory( |
| 94 dri_.get(), screen_manager_.get(), &window_manager_)); | 88 dri_.get(), screen_manager_.get(), &window_manager_)); |
| 95 cursor_factory_ozone_.reset(new BitmapCursorFactoryOzone); | 89 cursor_factory_ozone_.reset(new BitmapCursorFactoryOzone); |
| 96 cursor_.reset(new DriCursor(surface_factory_ozone_.get())); | 90 cursor_.reset(new DriCursor(surface_factory_ozone_.get())); |
| 97 event_factory_ozone_.reset( | 91 event_factory_ozone_.reset( |
| 98 new EventFactoryEvdev(cursor_.get(), device_manager_.get())); | 92 new EventFactoryEvdev(cursor_.get(), device_manager_.get())); |
| 99 if (surface_factory_ozone_->InitializeHardware() != | 93 if (surface_factory_ozone_->InitializeHardware() != |
| (...skipping 19 matching lines...) Expand all Loading... |
| 119 DriWindowManager window_manager_; | 113 DriWindowManager window_manager_; |
| 120 | 114 |
| 121 DISALLOW_COPY_AND_ASSIGN(OzonePlatformDri); | 115 DISALLOW_COPY_AND_ASSIGN(OzonePlatformDri); |
| 122 }; | 116 }; |
| 123 | 117 |
| 124 } // namespace | 118 } // namespace |
| 125 | 119 |
| 126 OzonePlatform* CreateOzonePlatformDri() { return new OzonePlatformDri; } | 120 OzonePlatform* CreateOzonePlatformDri() { return new OzonePlatformDri; } |
| 127 | 121 |
| 128 } // namespace ui | 122 } // namespace ui |
| OLD | NEW |