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

Unified Diff: ui/gfx/win/dpi.h

Issue 23498059: Remove last dependencies on ui/base from ui/gfx (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: last rebase Created 7 years, 3 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/gfx/vector3d_f.h ('k') | ui/gfx/win/dpi.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/win/dpi.h
diff --git a/ui/gfx/win/dpi.h b/ui/gfx/win/dpi.h
index a056f53266178b3d8b8c9d608a337cfe6faebc45..0193ac01b12a4b52fe3c3ebbda38695df94fb81d 100644
--- a/ui/gfx/win/dpi.h
+++ b/ui/gfx/win/dpi.h
@@ -12,37 +12,47 @@
namespace gfx {
-UI_EXPORT Size GetDPI();
+// Initialization of the scale factor that should be applied for rendering
+// in this process. Must be called before attempts to call any of the getter
+// methods below in this file, e.g. in the early toolkit/resource bundle setup.
+// This can be called multiple times during various tests, but subsequent calls
+// have no effect.
+GFX_EXPORT void InitDeviceScaleFactor(float scale);
+
+GFX_EXPORT Size GetDPI();
// Gets the scale factor of the display. For example, if the display DPI is
// 96 then the scale factor is 1.0.
-UI_EXPORT float GetDPIScale();
+GFX_EXPORT float GetDPIScale();
+
+// Tests to see if the command line flag "--high-dpi-support" is set.
+GFX_EXPORT bool IsHighDPIEnabled();
-UI_EXPORT bool IsInHighDPIMode();
+GFX_EXPORT bool IsInHighDPIMode();
-UI_EXPORT void EnableHighDPISupport();
+GFX_EXPORT void EnableHighDPISupport();
// TODO(kevers|girard): Move above methods into win namespace.
namespace win {
-UI_EXPORT float GetDeviceScaleFactor();
+GFX_EXPORT float GetDeviceScaleFactor();
-UI_EXPORT Point ScreenToDIPPoint(const Point& pixel_point);
+GFX_EXPORT Point ScreenToDIPPoint(const Point& pixel_point);
-UI_EXPORT Point DIPToScreenPoint(const Point& dip_point);
+GFX_EXPORT Point DIPToScreenPoint(const Point& dip_point);
-UI_EXPORT Rect ScreenToDIPRect(const Rect& pixel_bounds);
+GFX_EXPORT Rect ScreenToDIPRect(const Rect& pixel_bounds);
-UI_EXPORT Rect DIPToScreenRect(const Rect& dip_bounds);
+GFX_EXPORT Rect DIPToScreenRect(const Rect& dip_bounds);
-UI_EXPORT Size ScreenToDIPSize(const Size& size_in_pixels);
+GFX_EXPORT Size ScreenToDIPSize(const Size& size_in_pixels);
-UI_EXPORT Size DIPToScreenSize(const Size& dip_size);
+GFX_EXPORT Size DIPToScreenSize(const Size& dip_size);
// Win32's GetSystemMetrics uses pixel measures. This function calls
// GetSystemMetrics for the given |metric|, then converts the result to DIP.
-UI_EXPORT int GetSystemMetricsInDIP(int metric);
+GFX_EXPORT int GetSystemMetricsInDIP(int metric);
// Sometimes the OS secretly scales apps that are not DPIAware. This is not
// visible through standard OS calls like GetWindowPos(), or through
@@ -50,12 +60,12 @@ UI_EXPORT int GetSystemMetricsInDIP(int metric);
// Returns the scale factor of the display, where 96 DPI is 1.0.
// (Avoid this function... use GetDPIScale() instead.)
// TODO(girard): Remove this once DPIAware is enabled - http://crbug.com/149881
-UI_EXPORT double GetUndocumentedDPIScale();
+GFX_EXPORT double GetUndocumentedDPIScale();
// Win7 and Win8 send touch events scaled according to the current DPI
// scaling. Win8.1 corrects this, and sends touch events in DPI units.
// This function returns the appropriate scaling factor for touch events.
-UI_EXPORT double GetUndocumentedDPITouchScale();
+GFX_EXPORT double GetUndocumentedDPITouchScale();
} // namespace win
} // namespace gfx
« no previous file with comments | « ui/gfx/vector3d_f.h ('k') | ui/gfx/win/dpi.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698