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

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

Issue 2426103004: Specify a default display UI scale to reset the zoom to (Closed)
Patch Set: Clean up, simplify Created 4 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 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 72
73 bool is_internal; 73 bool is_internal;
74 }; 74 };
75 75
76 } // namespace 76 } // namespace
77 77
78 ManagedDisplayMode::ManagedDisplayMode() 78 ManagedDisplayMode::ManagedDisplayMode()
79 : refresh_rate_(0.0f), 79 : refresh_rate_(0.0f),
80 is_interlaced_(false), 80 is_interlaced_(false),
81 native_(false), 81 native_(false),
82 is_default_(false),
oshima 2016/10/19 21:04:06 just initialize it in line because it's always fal
afakhry 2016/10/24 20:21:46 Done.
82 ui_scale_(1.0f), 83 ui_scale_(1.0f),
83 device_scale_factor_(1.0f) {} 84 device_scale_factor_(1.0f) {}
84 85
85 ManagedDisplayMode::ManagedDisplayMode(const gfx::Size& size) 86 ManagedDisplayMode::ManagedDisplayMode(const gfx::Size& size)
86 : size_(size), 87 : size_(size),
87 refresh_rate_(0.0f), 88 refresh_rate_(0.0f),
88 is_interlaced_(false), 89 is_interlaced_(false),
89 native_(false), 90 native_(false),
91 is_default_(false),
90 ui_scale_(1.0f), 92 ui_scale_(1.0f),
91 device_scale_factor_(1.0f) {} 93 device_scale_factor_(1.0f) {}
92 94
93 ManagedDisplayMode::ManagedDisplayMode(const gfx::Size& size, 95 ManagedDisplayMode::ManagedDisplayMode(const gfx::Size& size,
94 float refresh_rate, 96 float refresh_rate,
95 bool is_interlaced, 97 bool is_interlaced,
96 bool native) 98 bool native)
97 : size_(size), 99 : size_(size),
98 refresh_rate_(refresh_rate), 100 refresh_rate_(refresh_rate),
99 is_interlaced_(is_interlaced), 101 is_interlaced_(is_interlaced),
100 native_(native), 102 native_(native),
103 is_default_(false),
101 ui_scale_(1.0f), 104 ui_scale_(1.0f),
102 device_scale_factor_(1.0f) {} 105 device_scale_factor_(1.0f) {}
103 106
104 ManagedDisplayMode::~ManagedDisplayMode(){}; 107 ManagedDisplayMode::~ManagedDisplayMode(){};
105 108
106 ManagedDisplayMode::ManagedDisplayMode(const gfx::Size& size, 109 ManagedDisplayMode::ManagedDisplayMode(const gfx::Size& size,
107 float refresh_rate, 110 float refresh_rate,
108 bool is_interlaced, 111 bool is_interlaced,
109 bool native, 112 bool native,
110 float ui_scale, 113 float ui_scale,
111 float device_scale_factor) 114 float device_scale_factor)
112 : size_(size), 115 : size_(size),
113 refresh_rate_(refresh_rate), 116 refresh_rate_(refresh_rate),
114 is_interlaced_(is_interlaced), 117 is_interlaced_(is_interlaced),
115 native_(native), 118 native_(native),
119 is_default_(false),
116 ui_scale_(ui_scale), 120 ui_scale_(ui_scale),
117 device_scale_factor_(device_scale_factor) {} 121 device_scale_factor_(device_scale_factor) {}
118 122
119 gfx::Size ManagedDisplayMode::GetSizeInDIP(bool is_internal) const { 123 gfx::Size ManagedDisplayMode::GetSizeInDIP(bool is_internal) const {
120 gfx::SizeF size_dip(size_); 124 gfx::SizeF size_dip(size_);
121 size_dip.Scale(ui_scale_); 125 size_dip.Scale(ui_scale_);
122 // DSF=1.25 is special on internal display. The screen is drawn with DSF=1.25 126 // DSF=1.25 is special on internal display. The screen is drawn with DSF=1.25
123 // but it doesn't affect the screen size computation. 127 // but it doesn't affect the screen size computation.
124 if (use_125_dsf_for_ui_scaling && is_internal && 128 if (use_125_dsf_for_ui_scaling && is_internal &&
125 device_scale_factor_ == 1.25f) 129 device_scale_factor_ == 1.25f)
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
494 498
495 void ManagedDisplayInfo::ClearInputDevices() { 499 void ManagedDisplayInfo::ClearInputDevices() {
496 input_devices_.clear(); 500 input_devices_.clear();
497 } 501 }
498 502
499 void ResetDisplayIdForTest() { 503 void ResetDisplayIdForTest() {
500 synthesized_display_id = kSynthesizedDisplayIdStart; 504 synthesized_display_id = kSynthesizedDisplayIdStart;
501 } 505 }
502 506
503 } // namespace display 507 } // namespace display
OLDNEW
« ash/display/display_manager.cc ('K') | « ui/display/manager/managed_display_info.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698