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/chromeos/native_display_delegate_dri.h" | 5 #include "ui/ozone/platform/dri/chromeos/native_display_delegate_dri.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "third_party/skia/include/core/SkCanvas.h" | 8 #include "third_party/skia/include/core/SkCanvas.h" |
9 #include "ui/display/types/chromeos/native_display_observer.h" | 9 #include "ui/display/types/chromeos/native_display_observer.h" |
10 #include "ui/events/ozone/device/device_event.h" | 10 #include "ui/events/ozone/device/device_event.h" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 | 71 |
72 } // namespace | 72 } // namespace |
73 | 73 |
74 NativeDisplayDelegateDri::NativeDisplayDelegateDri( | 74 NativeDisplayDelegateDri::NativeDisplayDelegateDri( |
75 DriWrapper* dri, | 75 DriWrapper* dri, |
76 ScreenManager* screen_manager, | 76 ScreenManager* screen_manager, |
77 DeviceManager* device_manager) | 77 DeviceManager* device_manager) |
78 : dri_(dri), | 78 : dri_(dri), |
79 screen_manager_(screen_manager), | 79 screen_manager_(screen_manager), |
80 device_manager_(device_manager) { | 80 device_manager_(device_manager) { |
| 81 // TODO(dnicoara): Remove when async display configuration is supported. |
| 82 screen_manager_->ForceInitializationOfPrimaryDisplay(); |
81 } | 83 } |
82 | 84 |
83 NativeDisplayDelegateDri::~NativeDisplayDelegateDri() { | 85 NativeDisplayDelegateDri::~NativeDisplayDelegateDri() { |
84 if (device_manager_) | 86 if (device_manager_) |
85 device_manager_->RemoveObserver(this); | 87 device_manager_->RemoveObserver(this); |
86 } | 88 } |
87 | 89 |
88 DisplaySnapshot* NativeDisplayDelegateDri::FindDisplaySnapshot(int64_t id) { | 90 DisplaySnapshot* NativeDisplayDelegateDri::FindDisplaySnapshot(int64_t id) { |
89 for (size_t i = 0; i < cached_displays_.size(); ++i) | 91 for (size_t i = 0; i < cached_displays_.size(); ++i) |
90 if (cached_displays_[i]->display_id() == id) | 92 if (cached_displays_[i]->display_id() == id) |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 old_displays.end(), | 322 old_displays.end(), |
321 DisplaySnapshotComparator(new_displays[i])); | 323 DisplaySnapshotComparator(new_displays[i])); |
322 | 324 |
323 if (it == old_displays.end()) | 325 if (it == old_displays.end()) |
324 screen_manager_->AddDisplayController(new_displays[i]->crtc(), | 326 screen_manager_->AddDisplayController(new_displays[i]->crtc(), |
325 new_displays[i]->connector()); | 327 new_displays[i]->connector()); |
326 } | 328 } |
327 } | 329 } |
328 | 330 |
329 } // namespace ui | 331 } // namespace ui |
OLD | NEW |