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

Side by Side Diff: chrome/browser/chromeos/display/display_preferences.cc

Issue 138903025: Read compositor VSync information from platform, when possible (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 287efe04 Rebase, oshima@ nits. Created 6 years, 10 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/chromeos/display/display_preferences.h" 5 #include "chrome/browser/chromeos/display/display_preferences.h"
6 6
7 #include "ash/display/display_layout_store.h" 7 #include "ash/display/display_layout_store.h"
8 #include "ash/display/display_manager.h" 8 #include "ash/display/display_manager.h"
9 #include "ash/display/display_pref_util.h" 9 #include "ash/display/display_pref_util.h"
10 #include "ash/display/resolution_notification_controller.h" 10 #include "ash/display/resolution_notification_controller.h"
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 const gfx::Display& display = display_manager->GetDisplayAt(i); 192 const gfx::Display& display = display_manager->GetDisplayAt(i);
193 int64 id = display.id(); 193 int64 id = display.id();
194 ash::internal::DisplayInfo info = display_manager->GetDisplayInfo(id); 194 ash::internal::DisplayInfo info = display_manager->GetDisplayInfo(id);
195 195
196 scoped_ptr<base::DictionaryValue> property_value( 196 scoped_ptr<base::DictionaryValue> property_value(
197 new base::DictionaryValue()); 197 new base::DictionaryValue());
198 property_value->SetInteger("rotation", static_cast<int>(info.rotation())); 198 property_value->SetInteger("rotation", static_cast<int>(info.rotation()));
199 property_value->SetInteger( 199 property_value->SetInteger(
200 "ui-scale", 200 "ui-scale",
201 static_cast<int>(info.configured_ui_scale() * 1000)); 201 static_cast<int>(info.configured_ui_scale() * 1000));
202 gfx::Size resolution; 202 ash::internal::DisplayMode mode;
203 if (!display.IsInternal() && 203 if (!display.IsInternal() &&
204 display_manager->GetSelectedResolutionForDisplayId(id, &resolution)) { 204 display_manager->GetSelectedModeForDisplayId(id, &mode) &&
205 property_value->SetInteger("width", resolution.width()); 205 !mode.native) {
206 property_value->SetInteger("height", resolution.height()); 206 property_value->SetInteger("width", mode.size.width());
207 property_value->SetInteger("height", mode.size.height());
207 } 208 }
208 209
209 if (!info.overscan_insets_in_dip().empty()) 210 if (!info.overscan_insets_in_dip().empty())
210 InsetsToValue(info.overscan_insets_in_dip(), property_value.get()); 211 InsetsToValue(info.overscan_insets_in_dip(), property_value.get());
211 pref_data->Set(base::Int64ToString(id), property_value.release()); 212 pref_data->Set(base::Int64ToString(id), property_value.release());
212 } 213 }
213 } 214 }
214 215
215 typedef std::map<chromeos::DisplayPowerState, std::string> 216 typedef std::map<chromeos::DisplayPowerState, std::string>
216 DisplayPowerStateToStringMap; 217 DisplayPowerStateToStringMap;
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 const ash::DisplayLayout& layout) { 301 const ash::DisplayLayout& layout) {
301 StoreDisplayLayoutPref(std::make_pair(id1, id2), layout); 302 StoreDisplayLayoutPref(std::make_pair(id1, id2), layout);
302 } 303 }
303 304
304 // Stores the given |power_state|. 305 // Stores the given |power_state|.
305 void StoreDisplayPowerStateForTest(DisplayPowerState power_state) { 306 void StoreDisplayPowerStateForTest(DisplayPowerState power_state) {
306 StoreDisplayPowerState(power_state); 307 StoreDisplayPowerState(power_state);
307 } 308 }
308 309
309 } // namespace chromeos 310 } // namespace chromeos
OLDNEW
« no previous file with comments | « cc/output/output_surface_unittest.cc ('k') | chrome/browser/chromeos/display/display_preferences_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698