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/drm/gpu/screen_manager.h" | 5 #include "ui/ozone/platform/drm/gpu/screen_manager.h" |
6 | 6 |
7 #include <xf86drmMode.h> | 7 #include <xf86drmMode.h> |
8 | 8 |
9 #include "third_party/skia/include/core/SkCanvas.h" | 9 #include "third_party/skia/include/core/SkCanvas.h" |
10 #include "ui/gfx/geometry/point.h" | 10 #include "ui/gfx/geometry/point.h" |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 scoped_ptr<CrtcController>(new CrtcController(drm, crtc, connector)))); | 92 scoped_ptr<CrtcController>(new CrtcController(drm, crtc, connector)))); |
93 } | 93 } |
94 | 94 |
95 void ScreenManager::RemoveDisplayController(const scoped_refptr<DrmDevice>& drm, | 95 void ScreenManager::RemoveDisplayController(const scoped_refptr<DrmDevice>& drm, |
96 uint32_t crtc) { | 96 uint32_t crtc) { |
97 HardwareDisplayControllers::iterator it = FindDisplayController(drm, crtc); | 97 HardwareDisplayControllers::iterator it = FindDisplayController(drm, crtc); |
98 if (it != controllers_.end()) { | 98 if (it != controllers_.end()) { |
99 bool is_mirrored = (*it)->IsMirrored(); | 99 bool is_mirrored = (*it)->IsMirrored(); |
100 (*it)->RemoveCrtc(drm, crtc); | 100 (*it)->RemoveCrtc(drm, crtc); |
101 if (!is_mirrored) { | 101 if (!is_mirrored) { |
| 102 controllers_.erase(it); |
102 UpdateControllerToWindowMapping(); | 103 UpdateControllerToWindowMapping(); |
103 controllers_.erase(it); | |
104 } | 104 } |
105 } | 105 } |
106 } | 106 } |
107 | 107 |
108 bool ScreenManager::ConfigureDisplayController( | 108 bool ScreenManager::ConfigureDisplayController( |
109 const scoped_refptr<DrmDevice>& drm, | 109 const scoped_refptr<DrmDevice>& drm, |
110 uint32_t crtc, | 110 uint32_t crtc, |
111 uint32_t connector, | 111 uint32_t connector, |
112 const gfx::Point& origin, | 112 const gfx::Point& origin, |
113 const drmModeModeInfo& mode) { | 113 const drmModeModeInfo& mode) { |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 DrmWindow* ScreenManager::FindWindowAt(const gfx::Rect& bounds) const { | 327 DrmWindow* ScreenManager::FindWindowAt(const gfx::Rect& bounds) const { |
328 for (auto pair : window_map_) { | 328 for (auto pair : window_map_) { |
329 if (pair.second->bounds() == bounds) | 329 if (pair.second->bounds() == bounds) |
330 return pair.second; | 330 return pair.second; |
331 } | 331 } |
332 | 332 |
333 return nullptr; | 333 return nullptr; |
334 } | 334 } |
335 | 335 |
336 } // namespace ui | 336 } // namespace ui |
OLD | NEW |