| 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 #ifndef UI_OZONE_PLATFORM_DRI_SCREEN_MANAGER_H_ | 5 #ifndef UI_OZONE_PLATFORM_DRI_SCREEN_MANAGER_H_ |
| 6 #define UI_OZONE_PLATFORM_DRI_SCREEN_MANAGER_H_ | 6 #define UI_OZONE_PLATFORM_DRI_SCREEN_MANAGER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
| 12 #include "ui/gfx/native_widget_types.h" | 12 #include "ui/gfx/native_widget_types.h" |
| 13 #include "ui/ozone/platform/dri/hardware_display_controller.h" | 13 #include "ui/ozone/platform/dri/hardware_display_controller.h" |
| 14 | 14 |
| 15 typedef struct _drmModeModeInfo drmModeModeInfo; | 15 typedef struct _drmModeModeInfo drmModeModeInfo; |
| 16 | 16 |
| 17 namespace gfx { | 17 namespace gfx { |
| 18 class Point; | 18 class Point; |
| 19 class Rect; | 19 class Rect; |
| 20 class Size; | 20 class Size; |
| 21 } // namespace gfx | 21 } // namespace gfx |
| 22 | 22 |
| 23 namespace ui { | 23 namespace ui { |
| 24 | 24 |
| 25 class DriWrapper; | 25 class DriWrapper; |
| 26 class ScanoutSurfaceGenerator; |
| 26 | 27 |
| 27 // Responsible for keeping track of active displays and configuring them. | 28 // Responsible for keeping track of active displays and configuring them. |
| 28 class OZONE_EXPORT ScreenManager { | 29 class OZONE_EXPORT ScreenManager { |
| 29 public: | 30 public: |
| 30 ScreenManager(DriWrapper* dri); | 31 ScreenManager(DriWrapper* dri, ScanoutSurfaceGenerator* surface_generator); |
| 31 virtual ~ScreenManager(); | 32 virtual ~ScreenManager(); |
| 32 | 33 |
| 33 // Remove a display controller from the list of active controllers. The | 34 // Remove a display controller from the list of active controllers. The |
| 34 // controller is removed since it was disconnected. | 35 // controller is removed since it was disconnected. |
| 35 void RemoveDisplayController(uint32_t crtc, uint32_t connector); | 36 void RemoveDisplayController(uint32_t crtc, uint32_t connector); |
| 36 | 37 |
| 37 // Configure (and add if not present) a display controller. The display | 38 // Configure (and add if not present) a display controller. The display |
| 38 // controller is identified by (|crtc|, |connector|) and the controller is | 39 // controller is identified by (|crtc|, |connector|) and the controller is |
| 39 // modeset using |mode|. | 40 // modeset using |mode|. |
| 40 bool ConfigureDisplayController(uint32_t crtc, | 41 bool ConfigureDisplayController(uint32_t crtc, |
| (...skipping 20 matching lines...) Expand all Loading... |
| 61 // Returns an iterator into |controllers_| for the controller identified by | 62 // Returns an iterator into |controllers_| for the controller identified by |
| 62 // (|crtc|, |connector|). | 63 // (|crtc|, |connector|). |
| 63 HardwareDisplayControllerMap::iterator FindDisplayController( | 64 HardwareDisplayControllerMap::iterator FindDisplayController( |
| 64 uint32_t crtc, uint32_t connector); | 65 uint32_t crtc, uint32_t connector); |
| 65 | 66 |
| 66 // On non CrOS builds there is no display configurator to look-up available | 67 // On non CrOS builds there is no display configurator to look-up available |
| 67 // displays and initialize the HDCs. In such cases this is called internally | 68 // displays and initialize the HDCs. In such cases this is called internally |
| 68 // to initialize a display. | 69 // to initialize a display. |
| 69 virtual void ForceInitializationOfPrimaryDisplay(); | 70 virtual void ForceInitializationOfPrimaryDisplay(); |
| 70 | 71 |
| 71 virtual DriSurface* CreateSurface(const gfx::Size& size); | |
| 72 | |
| 73 DriWrapper* dri_; // Not owned. | 72 DriWrapper* dri_; // Not owned. |
| 73 ScanoutSurfaceGenerator* surface_generator_; // Not owned. |
| 74 // Mapping between an accelerated widget and an active display. | 74 // Mapping between an accelerated widget and an active display. |
| 75 HardwareDisplayControllerMap controllers_; | 75 HardwareDisplayControllerMap controllers_; |
| 76 gfx::AcceleratedWidget last_added_widget_; | 76 gfx::AcceleratedWidget last_added_widget_; |
| 77 | 77 |
| 78 DISALLOW_COPY_AND_ASSIGN(ScreenManager); | 78 DISALLOW_COPY_AND_ASSIGN(ScreenManager); |
| 79 }; | 79 }; |
| 80 | 80 |
| 81 } // namespace ui | 81 } // namespace ui |
| 82 | 82 |
| 83 #endif // UI_OZONE_PLATFORM_DRI_SCREEN_MANAGER_H_ | 83 #endif // UI_OZONE_PLATFORM_DRI_SCREEN_MANAGER_H_ |
| OLD | NEW |