| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 <stdio.h> | 5 #include <stdio.h> |
| 6 #include <string> | 6 #include <string> |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "ash/display/display_info.h" | 9 #include "ash/display/display_info.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 321 } | 321 } |
| 322 | 322 |
| 323 void DisplayInfo::SetOverscanInsets(const gfx::Insets& insets_in_dip) { | 323 void DisplayInfo::SetOverscanInsets(const gfx::Insets& insets_in_dip) { |
| 324 overscan_insets_in_dip_ = insets_in_dip; | 324 overscan_insets_in_dip_ = insets_in_dip; |
| 325 } | 325 } |
| 326 | 326 |
| 327 gfx::Insets DisplayInfo::GetOverscanInsetsInPixel() const { | 327 gfx::Insets DisplayInfo::GetOverscanInsetsInPixel() const { |
| 328 return overscan_insets_in_dip_.Scale(device_scale_factor_); | 328 return overscan_insets_in_dip_.Scale(device_scale_factor_); |
| 329 } | 329 } |
| 330 | 330 |
| 331 gfx::Size DisplayInfo::GetNativeModeSize() const { |
| 332 for (size_t i = 0; i < display_modes_.size(); ++i) { |
| 333 if (display_modes_[i].native) |
| 334 return display_modes_[i].size; |
| 335 } |
| 336 |
| 337 return gfx::Size(); |
| 338 } |
| 339 |
| 331 std::string DisplayInfo::ToString() const { | 340 std::string DisplayInfo::ToString() const { |
| 332 int rotation_degree = static_cast<int>(rotation_) * 90; | 341 int rotation_degree = static_cast<int>(rotation_) * 90; |
| 333 return base::StringPrintf( | 342 return base::StringPrintf( |
| 334 "DisplayInfo[%lld] native bounds=%s, size=%s, scale=%f, " | 343 "DisplayInfo[%lld] native bounds=%s, size=%s, scale=%f, " |
| 335 "overscan=%s, rotation=%d, ui-scale=%f, touchscreen=%s, " | 344 "overscan=%s, rotation=%d, ui-scale=%f, touchscreen=%s, " |
| 336 "touch-device-id=%d", | 345 "touch-device-id=%d", |
| 337 static_cast<long long int>(id_), | 346 static_cast<long long int>(id_), |
| 338 bounds_in_native_.ToString().c_str(), | 347 bounds_in_native_.ToString().c_str(), |
| 339 size_in_pixel_.ToString().c_str(), | 348 size_in_pixel_.ToString().c_str(), |
| 340 device_scale_factor_, | 349 device_scale_factor_, |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 } | 381 } |
| 373 | 382 |
| 374 bool DisplayInfo::IsColorProfileAvailable( | 383 bool DisplayInfo::IsColorProfileAvailable( |
| 375 ui::ColorCalibrationProfile profile) const { | 384 ui::ColorCalibrationProfile profile) const { |
| 376 return std::find(available_color_profiles_.begin(), | 385 return std::find(available_color_profiles_.begin(), |
| 377 available_color_profiles_.end(), | 386 available_color_profiles_.end(), |
| 378 profile) != available_color_profiles_.end(); | 387 profile) != available_color_profiles_.end(); |
| 379 } | 388 } |
| 380 | 389 |
| 381 } // namespace ash | 390 } // namespace ash |
| OLD | NEW |