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 class ScanoutBufferGenerator; |
27 | 27 |
28 // Responsible for keeping track of active displays and configuring them. | 28 // Responsible for keeping track of active displays and configuring them. |
29 class ScreenManager { | 29 class ScreenManager { |
30 public: | 30 public: |
31 ScreenManager(DriWrapper* dri, ScanoutSurfaceGenerator* surface_generator); | 31 ScreenManager(DriWrapper* dri, ScanoutBufferGenerator* surface_generator); |
32 virtual ~ScreenManager(); | 32 virtual ~ScreenManager(); |
33 | 33 |
34 // Remove a display controller from the list of active controllers. The | 34 // Remove a display controller from the list of active controllers. The |
35 // controller is removed since it was disconnected. | 35 // controller is removed since it was disconnected. |
36 void RemoveDisplayController(uint32_t crtc, uint32_t connector); | 36 void RemoveDisplayController(uint32_t crtc, uint32_t connector); |
37 | 37 |
38 // Configure (and add if not present) a display controller. The display | 38 // Configure (and add if not present) a display controller. The display |
39 // controller is identified by (|crtc|, |connector|) and the controller is | 39 // controller is identified by (|crtc|, |connector|) and the controller is |
40 // modeset using |mode|. | 40 // modeset using |mode|. |
41 bool ConfigureDisplayController(uint32_t crtc, | 41 bool ConfigureDisplayController(uint32_t crtc, |
(...skipping 21 matching lines...) Expand all Loading... |
63 // (|crtc|, |connector|). | 63 // (|crtc|, |connector|). |
64 HardwareDisplayControllerMap::iterator FindDisplayController( | 64 HardwareDisplayControllerMap::iterator FindDisplayController( |
65 uint32_t crtc, uint32_t connector); | 65 uint32_t crtc, uint32_t connector); |
66 | 66 |
67 // 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 |
68 // 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 |
69 // to initialize a display. | 69 // to initialize a display. |
70 virtual void ForceInitializationOfPrimaryDisplay(); | 70 virtual void ForceInitializationOfPrimaryDisplay(); |
71 | 71 |
72 DriWrapper* dri_; // Not owned. | 72 DriWrapper* dri_; // Not owned. |
73 ScanoutSurfaceGenerator* surface_generator_; // Not owned. | 73 ScanoutBufferGenerator* buffer_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 |