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

Side by Side Diff: ui/display/manager/managed_display_info.cc

Issue 2521393002: Prepare ManagedDisplayInfo to store touch calibration associated data (Closed)
Patch Set: Resolve Comments Created 4 years 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 unified diff | Download patch
OLDNEW
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 "ui/display/manager/managed_display_info.h" 5 #include "ui/display/manager/managed_display_info.h"
6 6
7 #include <stdio.h> 7 #include <stdio.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <string> 10 #include <string>
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 if (size_a_dip.GetArea() == size_b_dip.GetArea()) 68 if (size_a_dip.GetArea() == size_b_dip.GetArea())
69 return (a->refresh_rate() > b->refresh_rate()); 69 return (a->refresh_rate() > b->refresh_rate());
70 return (size_a_dip.GetArea() < size_b_dip.GetArea()); 70 return (size_a_dip.GetArea() < size_b_dip.GetArea());
71 } 71 }
72 72
73 bool is_internal; 73 bool is_internal;
74 }; 74 };
75 75
76 } // namespace 76 } // namespace
77 77
78 TouchCalibrationData::TouchCalibrationData() {}
79
80 TouchCalibrationData::TouchCalibrationData(
81 const TouchCalibrationData::CalibrationPointPairQuad& point_pairs,
82 const gfx::Size& bounds) : point_pairs(point_pairs),
83 bounds(bounds) {}
84
85 TouchCalibrationData::TouchCalibrationData(
86 const TouchCalibrationData& calibration_data)
87 : point_pairs(calibration_data.point_pairs),
88 bounds(calibration_data.bounds) {}
89
78 ManagedDisplayMode::ManagedDisplayMode() 90 ManagedDisplayMode::ManagedDisplayMode()
79 : refresh_rate_(0.0f), 91 : refresh_rate_(0.0f),
80 is_interlaced_(false), 92 is_interlaced_(false),
81 native_(false), 93 native_(false),
82 ui_scale_(1.0f), 94 ui_scale_(1.0f),
83 device_scale_factor_(1.0f) {} 95 device_scale_factor_(1.0f) {}
84 96
85 ManagedDisplayMode::ManagedDisplayMode(const gfx::Size& size) 97 ManagedDisplayMode::ManagedDisplayMode(const gfx::Size& size)
86 : size_(size), 98 : size_(size),
87 refresh_rate_(0.0f), 99 refresh_rate_(0.0f),
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 // static 284 // static
273 void ManagedDisplayInfo::SetUse125DSFForUIScalingForTest(bool enable) { 285 void ManagedDisplayInfo::SetUse125DSFForUIScalingForTest(bool enable) {
274 use_125_dsf_for_ui_scaling = enable; 286 use_125_dsf_for_ui_scaling = enable;
275 } 287 }
276 288
277 ManagedDisplayInfo::ManagedDisplayInfo() 289 ManagedDisplayInfo::ManagedDisplayInfo()
278 : id_(kInvalidDisplayId), 290 : id_(kInvalidDisplayId),
279 has_overscan_(false), 291 has_overscan_(false),
280 active_rotation_source_(Display::ROTATION_SOURCE_UNKNOWN), 292 active_rotation_source_(Display::ROTATION_SOURCE_UNKNOWN),
281 touch_support_(Display::TOUCH_SUPPORT_UNKNOWN), 293 touch_support_(Display::TOUCH_SUPPORT_UNKNOWN),
294 has_touch_calibration_data_(false),
282 device_scale_factor_(1.0f), 295 device_scale_factor_(1.0f),
283 device_dpi_(kDpi96), 296 device_dpi_(kDpi96),
284 overscan_insets_in_dip_(0, 0, 0, 0), 297 overscan_insets_in_dip_(0, 0, 0, 0),
285 configured_ui_scale_(1.0f), 298 configured_ui_scale_(1.0f),
286 native_(false), 299 native_(false),
287 is_aspect_preserving_scaling_(false), 300 is_aspect_preserving_scaling_(false),
288 clear_overscan_insets_(false), 301 clear_overscan_insets_(false),
289 color_profile_(ui::COLOR_PROFILE_STANDARD) {} 302 color_profile_(ui::COLOR_PROFILE_STANDARD) {}
290 303
291 ManagedDisplayInfo::ManagedDisplayInfo(int64_t id, 304 ManagedDisplayInfo::ManagedDisplayInfo(int64_t id,
292 const std::string& name, 305 const std::string& name,
293 bool has_overscan) 306 bool has_overscan)
294 : id_(id), 307 : id_(id),
295 name_(name), 308 name_(name),
296 has_overscan_(has_overscan), 309 has_overscan_(has_overscan),
297 active_rotation_source_(Display::ROTATION_SOURCE_UNKNOWN), 310 active_rotation_source_(Display::ROTATION_SOURCE_UNKNOWN),
298 touch_support_(Display::TOUCH_SUPPORT_UNKNOWN), 311 touch_support_(Display::TOUCH_SUPPORT_UNKNOWN),
312 has_touch_calibration_data_(false),
299 device_scale_factor_(1.0f), 313 device_scale_factor_(1.0f),
300 device_dpi_(kDpi96), 314 device_dpi_(kDpi96),
301 overscan_insets_in_dip_(0, 0, 0, 0), 315 overscan_insets_in_dip_(0, 0, 0, 0),
302 configured_ui_scale_(1.0f), 316 configured_ui_scale_(1.0f),
303 native_(false), 317 native_(false),
304 is_aspect_preserving_scaling_(false), 318 is_aspect_preserving_scaling_(false),
305 clear_overscan_insets_(false), 319 clear_overscan_insets_(false),
306 color_profile_(ui::COLOR_PROFILE_STANDARD) {} 320 color_profile_(ui::COLOR_PROFILE_STANDARD) {}
307 321
308 ManagedDisplayInfo::ManagedDisplayInfo(const ManagedDisplayInfo& other) = 322 ManagedDisplayInfo::ManagedDisplayInfo(const ManagedDisplayInfo& other) =
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 // or unit tests. Don't copy if this native_info came from 364 // or unit tests. Don't copy if this native_info came from
351 // DisplayChangeObserver. 365 // DisplayChangeObserver.
352 if (!native_info.native()) { 366 if (!native_info.native()) {
353 // Update the overscan_insets_in_dip_ either if the inset should be 367 // Update the overscan_insets_in_dip_ either if the inset should be
354 // cleared, or has non empty insts. 368 // cleared, or has non empty insts.
355 if (native_info.clear_overscan_insets()) 369 if (native_info.clear_overscan_insets())
356 overscan_insets_in_dip_.Set(0, 0, 0, 0); 370 overscan_insets_in_dip_.Set(0, 0, 0, 0);
357 else if (!native_info.overscan_insets_in_dip_.IsEmpty()) 371 else if (!native_info.overscan_insets_in_dip_.IsEmpty())
358 overscan_insets_in_dip_ = native_info.overscan_insets_in_dip_; 372 overscan_insets_in_dip_ = native_info.overscan_insets_in_dip_;
359 373
374 has_touch_calibration_data_ = native_info.has_touch_calibration_data_;
375 if (has_touch_calibration_data_)
376 touch_calibration_data_ = native_info.touch_calibration_data_;
377
360 rotations_ = native_info.rotations_; 378 rotations_ = native_info.rotations_;
361 configured_ui_scale_ = native_info.configured_ui_scale_; 379 configured_ui_scale_ = native_info.configured_ui_scale_;
362 color_profile_ = native_info.color_profile(); 380 color_profile_ = native_info.color_profile();
363 } 381 }
364 } 382 }
365 383
366 void ManagedDisplayInfo::SetBounds(const gfx::Rect& new_bounds_in_native) { 384 void ManagedDisplayInfo::SetBounds(const gfx::Rect& new_bounds_in_native) {
367 bounds_in_native_ = new_bounds_in_native; 385 bounds_in_native_ = new_bounds_in_native;
368 size_in_pixel_ = new_bounds_in_native.size(); 386 size_in_pixel_ = new_bounds_in_native.size();
369 UpdateDisplaySize(); 387 UpdateDisplaySize();
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
490 } 508 }
491 509
492 void ManagedDisplayInfo::ClearInputDevices() { 510 void ManagedDisplayInfo::ClearInputDevices() {
493 input_devices_.clear(); 511 input_devices_.clear();
494 } 512 }
495 513
496 void ResetDisplayIdForTest() { 514 void ResetDisplayIdForTest() {
497 synthesized_display_id = kSynthesizedDisplayIdStart; 515 synthesized_display_id = kSynthesizedDisplayIdStart;
498 } 516 }
499 517
518 void ManagedDisplayInfo::SetTouchCalibrationData(
519 const TouchCalibrationData& touch_calibration_data) {
520 has_touch_calibration_data_ = true;
521 touch_calibration_data_ = touch_calibration_data;
522 }
523
500 } // namespace display 524 } // namespace display
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698