| 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 <stdlib.h> | 7 #include <stdlib.h> |
| 8 #include <gbm.h> | 8 #include <gbm.h> |
| 9 | 9 |
| 10 #include "ui/base/cursor/ozone/cursor_factory_ozone.h" | 10 #include "ui/base/cursor/ozone/cursor_factory_ozone.h" |
| 11 #include "ui/events/ozone/device/device_manager.h" | 11 #include "ui/events/ozone/device/device_manager.h" |
| 12 #include "ui/events/ozone/evdev/event_factory_evdev.h" | 12 #include "ui/events/ozone/evdev/event_factory_evdev.h" |
| 13 #include "ui/ozone/ozone_platform.h" | 13 #include "ui/ozone/ozone_platform.h" |
| 14 #include "ui/ozone/platform/dri/dri_wrapper.h" | 14 #include "ui/ozone/platform/dri/dri_wrapper.h" |
| 15 #include "ui/ozone/platform/dri/gbm_surface.h" | 15 #include "ui/ozone/platform/dri/gbm_surface.h" |
| 16 #include "ui/ozone/platform/dri/gbm_surface_factory.h" | 16 #include "ui/ozone/platform/dri/gbm_surface_factory.h" |
| 17 #include "ui/ozone/platform/dri/scanout_surface.h" | 17 #include "ui/ozone/platform/dri/scanout_surface.h" |
| 18 #include "ui/ozone/platform/dri/screen_manager.h" | 18 #include "ui/ozone/platform/dri/screen_manager.h" |
| 19 | 19 |
| 20 #if defined(OS_CHROMEOS) | 20 #if defined(OS_CHROMEOS) |
| 21 #include "ui/ozone/common/chromeos/native_display_delegate_ozone.h" | 21 #include "ui/ozone/common/chromeos/native_display_delegate_ozone.h" |
| 22 #include "ui/ozone/common/chromeos/touchscreen_device_manager_ozone.h" |
| 22 #endif | 23 #endif |
| 23 | 24 |
| 24 namespace ui { | 25 namespace ui { |
| 25 | 26 |
| 26 namespace { | 27 namespace { |
| 27 | 28 |
| 28 const char kDefaultGraphicsCardPath[] = "/dev/dri/card0"; | 29 const char kDefaultGraphicsCardPath[] = "/dev/dri/card0"; |
| 29 | 30 |
| 30 class GbmSurfaceGenerator : public ScanoutSurfaceGenerator { | 31 class GbmSurfaceGenerator : public ScanoutSurfaceGenerator { |
| 31 public: | 32 public: |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 return event_factory_ozone_.get(); | 64 return event_factory_ozone_.get(); |
| 64 } | 65 } |
| 65 virtual CursorFactoryOzone* GetCursorFactoryOzone() OVERRIDE { | 66 virtual CursorFactoryOzone* GetCursorFactoryOzone() OVERRIDE { |
| 66 return cursor_factory_ozone_.get(); | 67 return cursor_factory_ozone_.get(); |
| 67 } | 68 } |
| 68 #if defined(OS_CHROMEOS) | 69 #if defined(OS_CHROMEOS) |
| 69 virtual scoped_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate() | 70 virtual scoped_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate() |
| 70 OVERRIDE { | 71 OVERRIDE { |
| 71 return scoped_ptr<NativeDisplayDelegate>(new NativeDisplayDelegateOzone()); | 72 return scoped_ptr<NativeDisplayDelegate>(new NativeDisplayDelegateOzone()); |
| 72 } | 73 } |
| 74 virtual scoped_ptr<TouchscreenDeviceManager> |
| 75 CreateTouchscreenDeviceManager() OVERRIDE { |
| 76 return scoped_ptr<TouchscreenDeviceManager>( |
| 77 new TouchscreenDeviceManagerOzone()); |
| 78 } |
| 73 #endif | 79 #endif |
| 74 virtual void InitializeUI() OVERRIDE { | 80 virtual void InitializeUI() OVERRIDE { |
| 75 // Needed since the browser process creates the accelerated widgets and that | 81 // Needed since the browser process creates the accelerated widgets and that |
| 76 // happens through SFO. | 82 // happens through SFO. |
| 77 surface_factory_ozone_.reset(new GbmSurfaceFactory(NULL, NULL, NULL)); | 83 surface_factory_ozone_.reset(new GbmSurfaceFactory(NULL, NULL, NULL)); |
| 78 | 84 |
| 79 device_manager_ = CreateDeviceManager(); | 85 device_manager_ = CreateDeviceManager(); |
| 80 cursor_factory_ozone_.reset(new CursorFactoryOzone()); | 86 cursor_factory_ozone_.reset(new CursorFactoryOzone()); |
| 81 event_factory_ozone_.reset(new EventFactoryEvdev( | 87 event_factory_ozone_.reset(new EventFactoryEvdev( |
| 82 NULL, device_manager_.get())); | 88 NULL, device_manager_.get())); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 105 scoped_ptr<EventFactoryEvdev> event_factory_ozone_; | 111 scoped_ptr<EventFactoryEvdev> event_factory_ozone_; |
| 106 | 112 |
| 107 DISALLOW_COPY_AND_ASSIGN(OzonePlatformGbm); | 113 DISALLOW_COPY_AND_ASSIGN(OzonePlatformGbm); |
| 108 }; | 114 }; |
| 109 | 115 |
| 110 } // namespace | 116 } // namespace |
| 111 | 117 |
| 112 OzonePlatform* CreateOzonePlatformGbm() { return new OzonePlatformGbm; } | 118 OzonePlatform* CreateOzonePlatformGbm() { return new OzonePlatformGbm; } |
| 113 | 119 |
| 114 } // namespace ui | 120 } // namespace ui |
| OLD | NEW |