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