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

Unified Diff: ash/display/display_manager.cc

Issue 408353002: Add virtual resolutions for 1.25 DSF (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/display/display_info.cc ('k') | ash/display/display_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/display/display_manager.cc
diff --git a/ash/display/display_manager.cc b/ash/display/display_manager.cc
index 1a981a4be74df711a16912a66710c5275c2b4ecc..07d44155fa6ccdd1ad4a6e89b7d7939a69455f5e 100644
--- a/ash/display/display_manager.cc
+++ b/ash/display/display_manager.cc
@@ -65,6 +65,7 @@ const int kMinimumOverlapForInvalidOffset = 100;
// for the full list of resolutions.
const float kUIScalesFor2x[] =
{0.5f, 0.625f, 0.8f, 1.0f, 1.125f, 1.25f, 1.5f, 2.0f};
+const float kUIScalesFor1_25x[] = {0.5f, 0.625f, 0.8f, 1.0f, 1.25f };
const float kUIScalesFor1280[] = {0.5f, 0.625f, 0.8f, 1.0f, 1.125f };
const float kUIScalesFor1366[] = {0.5f, 0.6f, 0.75f, 1.0f, 1.125f };
@@ -183,23 +184,26 @@ DisplayManager::~DisplayManager() {
// static
std::vector<float> DisplayManager::GetScalesForDisplay(
const DisplayInfo& info) {
+
+#define ASSIGN_ARRAY(v, a) v.assign(a, a + arraysize(a))
+
std::vector<float> ret;
if (info.device_scale_factor() == 2.0f) {
- ret.assign(kUIScalesFor2x, kUIScalesFor2x + arraysize(kUIScalesFor2x));
+ ASSIGN_ARRAY(ret, kUIScalesFor2x);
+ return ret;
+ } else if (info.device_scale_factor() == 1.25f) {
+ ASSIGN_ARRAY(ret, kUIScalesFor1_25x);
return ret;
}
switch (info.bounds_in_native().width()) {
case 1280:
- ret.assign(kUIScalesFor1280,
- kUIScalesFor1280 + arraysize(kUIScalesFor1280));
+ ASSIGN_ARRAY(ret, kUIScalesFor1280);
break;
case 1366:
- ret.assign(kUIScalesFor1366,
- kUIScalesFor1366 + arraysize(kUIScalesFor1366));
+ ASSIGN_ARRAY(ret, kUIScalesFor1366);
break;
default:
- ret.assign(kUIScalesFor1280,
- kUIScalesFor1280 + arraysize(kUIScalesFor1280));
+ ASSIGN_ARRAY(ret, kUIScalesFor1280);
#if defined(OS_CHROMEOS)
if (base::SysInfo::IsRunningOnChromeOS())
NOTREACHED() << "Unknown resolution:" << info.ToString();
« no previous file with comments | « ash/display/display_info.cc ('k') | ash/display/display_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698