| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 devices[i].d3d_device()->GetFeatureLevel(); | 175 devices[i].d3d_device()->GetFeatureLevel(); |
| 176 if (d3d_info_.max_feature_level == 0 || | 176 if (d3d_info_.max_feature_level == 0 || |
| 177 feature_level > d3d_info_.max_feature_level) { | 177 feature_level > d3d_info_.max_feature_level) { |
| 178 d3d_info_.max_feature_level = feature_level; | 178 d3d_info_.max_feature_level = feature_level; |
| 179 } | 179 } |
| 180 if (d3d_info_.min_feature_level == 0 || | 180 if (d3d_info_.min_feature_level == 0 || |
| 181 feature_level < d3d_info_.min_feature_level) { | 181 feature_level < d3d_info_.min_feature_level) { |
| 182 d3d_info_.min_feature_level = feature_level; | 182 d3d_info_.min_feature_level = feature_level; |
| 183 } | 183 } |
| 184 | 184 |
| 185 if (desktop_rect_.is_empty()) { | 185 desktop_rect_.UnionWith(duplicators_.back().desktop_rect()); |
| 186 desktop_rect_ = duplicators_.back().desktop_rect(); | |
| 187 } else { | |
| 188 const DesktopRect& left = desktop_rect_; | |
| 189 const DesktopRect& right = duplicators_.back().desktop_rect(); | |
| 190 desktop_rect_ = | |
| 191 DesktopRect::MakeLTRB(std::min(left.left(), right.left()), | |
| 192 std::min(left.top(), right.top()), | |
| 193 std::max(left.right(), right.right()), | |
| 194 std::max(left.bottom(), right.bottom())); | |
| 195 } | |
| 196 } | 186 } |
| 197 TranslateRect(); | 187 TranslateRect(); |
| 198 | 188 |
| 199 HDC hdc = GetDC(nullptr); | 189 HDC hdc = GetDC(nullptr); |
| 200 // Use old DPI value if failed. | 190 // Use old DPI value if failed. |
| 201 if (hdc) { | 191 if (hdc) { |
| 202 dpi_.set(GetDeviceCaps(hdc, LOGPIXELSX), GetDeviceCaps(hdc, LOGPIXELSY)); | 192 dpi_.set(GetDeviceCaps(hdc, LOGPIXELSX), GetDeviceCaps(hdc, LOGPIXELSY)); |
| 203 ReleaseDC(nullptr, hdc); | 193 ReleaseDC(nullptr, hdc); |
| 204 } | 194 } |
| 205 | 195 |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 void DxgiDuplicatorController::TranslateRect() { | 372 void DxgiDuplicatorController::TranslateRect() { |
| 383 const DesktopVector position = | 373 const DesktopVector position = |
| 384 DesktopVector().subtract(desktop_rect_.top_left()); | 374 DesktopVector().subtract(desktop_rect_.top_left()); |
| 385 desktop_rect_.Translate(position); | 375 desktop_rect_.Translate(position); |
| 386 for (auto& duplicator : duplicators_) { | 376 for (auto& duplicator : duplicators_) { |
| 387 duplicator.TranslateRect(position); | 377 duplicator.TranslateRect(position); |
| 388 } | 378 } |
| 389 } | 379 } |
| 390 | 380 |
| 391 } // namespace webrtc | 381 } // namespace webrtc |
| OLD | NEW |