| 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/screen_manager.h" | 5 #include "ui/ozone/platform/dri/screen_manager.h" |
| 6 | 6 |
| 7 #include <xf86drmMode.h> | 7 #include <xf86drmMode.h> |
| 8 | 8 |
| 9 #include "ui/gfx/geometry/point.h" | 9 #include "ui/gfx/geometry/point.h" |
| 10 #include "ui/gfx/geometry/rect.h" | 10 #include "ui/gfx/geometry/rect.h" |
| 11 #include "ui/gfx/geometry/size.h" | 11 #include "ui/gfx/geometry/size.h" |
| 12 #include "ui/ozone/platform/dri/dri_util.h" | 12 #include "ui/ozone/platform/dri/dri_util.h" |
| 13 #include "ui/ozone/platform/dri/hardware_display_controller.h" | 13 #include "ui/ozone/platform/dri/hardware_display_controller.h" |
| 14 #include "ui/ozone/platform/dri/scanout_surface.h" | 14 #include "ui/ozone/platform/dri/scanout_surface.h" |
| 15 | 15 |
| 16 namespace ui { | 16 namespace ui { |
| 17 | 17 |
| 18 ScreenManager::ScreenManager( | 18 ScreenManager::ScreenManager( |
| 19 DriWrapper* dri, ScanoutSurfaceGenerator* surface_generator) | 19 DriWrapper* dri, ScanoutSurfaceGenerator* surface_generator) |
| 20 : dri_(dri), surface_generator_(surface_generator), last_added_widget_(0) { | 20 : dri_(dri), surface_generator_(surface_generator), last_added_widget_(0) { |
| 21 } | 21 } |
| 22 | 22 |
| 23 ScreenManager::~ScreenManager() { | 23 ScreenManager::~ScreenManager() { |
| 24 STLDeleteContainerPairSecondPointers( |
| 25 controllers_.begin(), controllers_.end()); |
| 24 } | 26 } |
| 25 | 27 |
| 26 void ScreenManager::RemoveDisplayController(uint32_t crtc, uint32_t connector) { | 28 void ScreenManager::RemoveDisplayController(uint32_t crtc, uint32_t connector) { |
| 27 HardwareDisplayControllerMap::iterator it = | 29 HardwareDisplayControllerMap::iterator it = |
| 28 FindDisplayController(crtc, connector); | 30 FindDisplayController(crtc, connector); |
| 29 if (it != controllers_.end()) { | 31 if (it != controllers_.end()) { |
| 30 delete it->second; | 32 delete it->second; |
| 31 controllers_.erase(it); | 33 controllers_.erase(it); |
| 32 } | 34 } |
| 33 } | 35 } |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 dri_->SetProperty(displays[0]->connector()->connector_id, | 128 dri_->SetProperty(displays[0]->connector()->connector_id, |
| 127 dpms->prop_id, | 129 dpms->prop_id, |
| 128 DRM_MODE_DPMS_ON); | 130 DRM_MODE_DPMS_ON); |
| 129 | 131 |
| 130 ConfigureDisplayController(displays[0]->crtc()->crtc_id, | 132 ConfigureDisplayController(displays[0]->crtc()->crtc_id, |
| 131 displays[0]->connector()->connector_id, | 133 displays[0]->connector()->connector_id, |
| 132 displays[0]->connector()->modes[0]); | 134 displays[0]->connector()->modes[0]); |
| 133 } | 135 } |
| 134 | 136 |
| 135 } // namespace ui | 137 } // namespace ui |
| OLD | NEW |