Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(863)

Unified Diff: ui/ozone/platform/dri/chromeos/native_display_delegate_dri.cc

Issue 548613002: Revert of [Ozone-GBM] Handle GPU crashes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/ozone/platform/dri/chromeos/native_display_delegate_dri.cc
diff --git a/ui/ozone/platform/dri/chromeos/native_display_delegate_dri.cc b/ui/ozone/platform/dri/chromeos/native_display_delegate_dri.cc
index 02817f9d7d79f5458dc97828a2fa5536317607cd..17f582ce013455e12ea840f4e4bb41d668cd8a38 100644
--- a/ui/ozone/platform/dri/chromeos/native_display_delegate_dri.cc
+++ b/ui/ozone/platform/dri/chromeos/native_display_delegate_dri.cc
@@ -51,23 +51,6 @@
NOTREACHED();
return 0;
}
-
-class DisplaySnapshotComparator {
- public:
- DisplaySnapshotComparator(const DisplaySnapshotDri* snapshot)
- : snapshot_(snapshot) {}
-
- bool operator()(const DisplaySnapshotDri* other) const {
- if (snapshot_->connector() == other->connector() &&
- snapshot_->crtc() == other->crtc())
- return true;
-
- return false;
- }
-
- private:
- const DisplaySnapshotDri* snapshot_;
-};
} // namespace
@@ -305,25 +288,18 @@
const std::vector<DisplaySnapshotDri*>& new_displays,
const std::vector<DisplaySnapshotDri*>& old_displays) const {
for (size_t i = 0; i < old_displays.size(); ++i) {
- const std::vector<DisplaySnapshotDri*>::const_iterator it =
- std::find_if(new_displays.begin(),
- new_displays.end(),
- DisplaySnapshotComparator(old_displays[i]));
-
- if (it == new_displays.end())
+ bool found = false;
+ for (size_t j = 0; j < new_displays.size(); ++j) {
+ if (old_displays[i]->connector() == new_displays[j]->connector() &&
+ old_displays[i]->crtc() == new_displays[j]->crtc()) {
+ found = true;
+ break;
+ }
+ }
+
+ if (!found)
screen_manager_->RemoveDisplayController(old_displays[i]->crtc());
}
-
- for (size_t i = 0; i < new_displays.size(); ++i) {
- const std::vector<DisplaySnapshotDri*>::const_iterator it =
- std::find_if(old_displays.begin(),
- old_displays.end(),
- DisplaySnapshotComparator(new_displays[i]));
-
- if (it == old_displays.end())
- screen_manager_->AddDisplayController(new_displays[i]->crtc(),
- new_displays[i]->connector());
- }
}
} // namespace ui

Powered by Google App Engine
This is Rietveld 408576698