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" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 bool DisableDisplayController(uint32_t crtc); | 48 bool DisableDisplayController(uint32_t crtc); |
49 | 49 |
50 // Returns a reference to the display controller associated with |widget|. | 50 // Returns a reference to the display controller associated with |widget|. |
51 // This returns a weak reference since the display controller may be destroyed | 51 // This returns a weak reference since the display controller may be destroyed |
52 // at any point in time, but the changes are propagated to the compositor much | 52 // at any point in time, but the changes are propagated to the compositor much |
53 // later (Compositor owns SurfaceOzone*, which is responsible for updating the | 53 // later (Compositor owns SurfaceOzone*, which is responsible for updating the |
54 // display surface). | 54 // display surface). |
55 base::WeakPtr<HardwareDisplayController> GetDisplayController( | 55 base::WeakPtr<HardwareDisplayController> GetDisplayController( |
56 gfx::AcceleratedWidget widget); | 56 gfx::AcceleratedWidget widget); |
57 | 57 |
| 58 // Returns a reference to the display controller configured to display within |
| 59 // |bounds|. |
| 60 // This returns a weak reference since the display controller may be destroyed |
| 61 // at any point in time, but the changes are propagated to the compositor much |
| 62 // later (Compositor owns SurfaceOzone*, which is responsible for updating the |
| 63 // display surface). |
| 64 base::WeakPtr<HardwareDisplayController> GetDisplayController( |
| 65 const gfx::Rect& bounds); |
| 66 |
58 private: | 67 private: |
59 typedef std::map<gfx::AcceleratedWidget, HardwareDisplayController*> | 68 typedef std::map<gfx::AcceleratedWidget, HardwareDisplayController*> |
60 HardwareDisplayControllerMap; | 69 HardwareDisplayControllerMap; |
61 | 70 |
62 // Returns an iterator into |controllers_| for the controller identified by | 71 // Returns an iterator into |controllers_| for the controller identified by |
63 // (|crtc|, |connector|). | 72 // (|crtc|, |connector|). |
64 HardwareDisplayControllerMap::iterator FindDisplayController( | 73 HardwareDisplayControllerMap::iterator FindDisplayController( |
65 uint32_t crtc); | 74 uint32_t crtc); |
66 | 75 |
67 // Returns an iterator into |controllers_| for the controller located at | 76 // Returns an iterator into |controllers_| for the controller located at |
68 // |origin|. | 77 // |origin|. |
69 HardwareDisplayControllerMap::iterator FindDisplayControllerByOrigin( | 78 HardwareDisplayControllerMap::iterator FindDisplayControllerByOrigin( |
70 const gfx::Point& origin); | 79 const gfx::Point& origin); |
71 | 80 |
| 81 // Returns an iterator into |controllers_| for the controller located within |
| 82 // |bounds|. |
| 83 HardwareDisplayControllerMap::iterator FindActiveDisplayControllerByLocation( |
| 84 const gfx::Rect& bounds); |
| 85 |
72 // Perform modesetting in |controller| using |origin| and |mode|. | 86 // Perform modesetting in |controller| using |origin| and |mode|. |
73 bool ModesetDisplayController(HardwareDisplayController* controller, | 87 bool ModesetDisplayController(HardwareDisplayController* controller, |
74 const gfx::Point& origin, | 88 const gfx::Point& origin, |
75 const drmModeModeInfo& mode); | 89 const drmModeModeInfo& mode); |
76 | 90 |
77 // Tries to set the controller identified by (|crtc|, |connector|) to mirror | 91 // Tries to set the controller identified by (|crtc|, |connector|) to mirror |
78 // those in |mirror|. |original| is an iterator to the HDC where the | 92 // those in |mirror|. |original| is an iterator to the HDC where the |
79 // controller is currently present. | 93 // controller is currently present. |
80 bool HandleMirrorMode( | 94 bool HandleMirrorMode( |
81 HardwareDisplayControllerMap::iterator original, | 95 HardwareDisplayControllerMap::iterator original, |
(...skipping 11 matching lines...) Expand all Loading... |
93 // Mapping between an accelerated widget and an active display. | 107 // Mapping between an accelerated widget and an active display. |
94 HardwareDisplayControllerMap controllers_; | 108 HardwareDisplayControllerMap controllers_; |
95 gfx::AcceleratedWidget last_added_widget_; | 109 gfx::AcceleratedWidget last_added_widget_; |
96 | 110 |
97 DISALLOW_COPY_AND_ASSIGN(ScreenManager); | 111 DISALLOW_COPY_AND_ASSIGN(ScreenManager); |
98 }; | 112 }; |
99 | 113 |
100 } // namespace ui | 114 } // namespace ui |
101 | 115 |
102 #endif // UI_OZONE_PLATFORM_DRI_SCREEN_MANAGER_H_ | 116 #endif // UI_OZONE_PLATFORM_DRI_SCREEN_MANAGER_H_ |
OLD | NEW |