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

Unified Diff: ui/ozone/platform/dri/display_snapshot_dri.cc

Issue 642333002: [Ozone-DRI] Fix panel fitting lookup (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 6 years, 2 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/platform/dri/display_snapshot_dri.cc
diff --git a/ui/ozone/platform/dri/display_snapshot_dri.cc b/ui/ozone/platform/dri/display_snapshot_dri.cc
index fa7b6f90e10aaf738e5af1179bde75eab575c3be..0d0c55918befcce9d704236702067a2e1323f830 100644
--- a/ui/ozone/platform/dri/display_snapshot_dri.cc
+++ b/ui/ozone/platform/dri/display_snapshot_dri.cc
@@ -43,11 +43,16 @@ DisplayConnectionType GetDisplayType(drmModeConnector* connector) {
bool IsAspectPreserving(DriWrapper* drm, drmModeConnector* connector) {
ScopedDrmPropertyPtr property(drm->GetProperty(connector, "scaling mode"));
- if (property) {
- for (int j = 0; j < property->count_enums; ++j) {
- if (property->enums[j].value ==
- connector->prop_values[property->prop_id] &&
- strcmp(property->enums[j].name, "Full aspect") == 0)
+ if (!property)
+ return false;
+
+ for (int props_i = 0; props_i < connector->count_props; ++props_i) {
+ if (connector->props[props_i] != property->prop_id)
+ continue;
+
+ for (int enums_i = 0; enums_i < property->count_enums; ++enums_i) {
+ if (property->enums[enums_i].value == connector->prop_values[props_i] &&
+ strcmp(property->enums[enums_i].name, "Full aspect") == 0)
return true;
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698