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/display_snapshot_dri.h" | 5 #include "ui/ozone/platform/dri/display_snapshot_dri.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 #include <stdlib.h> | 8 #include <stdlib.h> |
9 #include <xf86drmMode.h> | 9 #include <xf86drmMode.h> |
10 | 10 |
(...skipping 25 matching lines...) Expand all Loading... | |
36 case DRM_MODE_CONNECTOR_HDMIA: | 36 case DRM_MODE_CONNECTOR_HDMIA: |
37 case DRM_MODE_CONNECTOR_HDMIB: | 37 case DRM_MODE_CONNECTOR_HDMIB: |
38 return DISPLAY_CONNECTION_TYPE_HDMI; | 38 return DISPLAY_CONNECTION_TYPE_HDMI; |
39 default: | 39 default: |
40 return DISPLAY_CONNECTION_TYPE_UNKNOWN; | 40 return DISPLAY_CONNECTION_TYPE_UNKNOWN; |
41 } | 41 } |
42 } | 42 } |
43 | 43 |
44 bool IsAspectPreserving(DriWrapper* drm, drmModeConnector* connector) { | 44 bool IsAspectPreserving(DriWrapper* drm, drmModeConnector* connector) { |
45 ScopedDrmPropertyPtr property(drm->GetProperty(connector, "scaling mode")); | 45 ScopedDrmPropertyPtr property(drm->GetProperty(connector, "scaling mode")); |
46 if (property) { | 46 if (!property) |
47 return false; | |
48 | |
49 for (int i = 0; i < connector->count_props; ++i) { | |
50 if (connector->props[i] != property->prop_id) | |
alexst (slow to review)
2014/10/10 15:00:08
I found my mind wondering looking at i and j here
dnicoara
2014/10/10 15:07:14
Done.
| |
51 continue; | |
52 | |
47 for (int j = 0; j < property->count_enums; ++j) { | 53 for (int j = 0; j < property->count_enums; ++j) { |
48 if (property->enums[j].value == | 54 if (property->enums[j].value == connector->prop_values[i] && |
49 connector->prop_values[property->prop_id] && | |
50 strcmp(property->enums[j].name, "Full aspect") == 0) | 55 strcmp(property->enums[j].name, "Full aspect") == 0) |
51 return true; | 56 return true; |
52 } | 57 } |
53 } | 58 } |
54 | 59 |
55 return false; | 60 return false; |
56 } | 61 } |
57 | 62 |
58 } // namespace | 63 } // namespace |
59 | 64 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
118 return base::StringPrintf( | 123 return base::StringPrintf( |
119 "[type=%d, connector=%" PRIu32 ", crtc=%" PRIu32 ", mode=%s, dim=%s]", | 124 "[type=%d, connector=%" PRIu32 ", crtc=%" PRIu32 ", mode=%s, dim=%s]", |
120 type_, | 125 type_, |
121 connector_, | 126 connector_, |
122 crtc_, | 127 crtc_, |
123 current_mode_ ? current_mode_->ToString().c_str() : "NULL", | 128 current_mode_ ? current_mode_->ToString().c_str() : "NULL", |
124 physical_size_.ToString().c_str()); | 129 physical_size_.ToString().c_str()); |
125 } | 130 } |
126 | 131 |
127 } // namespace ui | 132 } // namespace ui |
OLD | NEW |