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

Unified Diff: ui/base/layout.cc

Issue 211493009: Ensure that extension resources are loaded with the correct scaling applied on Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed unnecessary include Created 6 years, 9 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 | « ui/base/layout.h ('k') | ui/base/resource/resource_bundle.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/layout.cc
diff --git a/ui/base/layout.cc b/ui/base/layout.cc
index 2c1fb51a3952706e1f6d77a0b2f29a46c2508124..10a0421f2d5f509a4b0e28cbf0e274e86cafdf01 100644
--- a/ui/base/layout.cc
+++ b/ui/base/layout.cc
@@ -20,6 +20,7 @@
#if defined(OS_WIN)
#include "base/win/metro.h"
+#include "ui/gfx/win/dpi.h"
#include <Windows.h>
#endif // defined(OS_WIN)
@@ -90,7 +91,7 @@ void SetSupportedScaleFactors(
for (std::vector<ScaleFactor>::const_iterator it =
g_supported_scale_factors->begin();
it != g_supported_scale_factors->end(); ++it) {
- scales.push_back(GetImageScale(*it));
+ scales.push_back(GetImageScaleForScaleFactor(*it));
}
gfx::ImageSkia::SetSupportedScales(scales);
}
@@ -116,10 +117,18 @@ ScaleFactor GetSupportedScaleFactor(float scale) {
return closest_match;
}
-float GetImageScale(ScaleFactor scale_factor) {
+float GetImageScaleForScaleFactor(ScaleFactor scale_factor) {
return kScaleFactorScales[scale_factor];
sky 2014/03/26 20:43:27 Is it possible to make this private too? It's conf
ananta 2014/03/26 21:49:27 As per our discussion, moved the kScaleFactorScale
}
+float GetImageScale(ScaleFactor scale_factor) {
+#if defined(OS_WIN)
+ if (gfx::IsHighDPIEnabled())
+ return gfx::win::GetDeviceScaleFactor();
+#endif
+ return GetImageScaleForScaleFactor(scale_factor);
+}
+
bool IsScaleFactorSupported(ScaleFactor scale_factor) {
DCHECK(g_supported_scale_factors != NULL);
return std::find(g_supported_scale_factors->begin(),
« no previous file with comments | « ui/base/layout.h ('k') | ui/base/resource/resource_bundle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698