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

Unified Diff: content/browser/renderer_host/dip_util.cc

Issue 15666007: Use correct device scale factors in Aura (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix botched resolve Created 7 years, 7 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 | « content/browser/renderer_host/dip_util.h ('k') | content/browser/renderer_host/render_widget_host_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/dip_util.cc
diff --git a/content/browser/renderer_host/dip_util.cc b/content/browser/renderer_host/dip_util.cc
index 575232c659b985d2fd9947f0f7fc66be7f8295f1..8ef2d6c4661ab8b1a423576c3573eb41870416a7 100644
--- a/content/browser/renderer_host/dip_util.cc
+++ b/content/browser/renderer_host/dip_util.cc
@@ -27,40 +27,40 @@ ui::ScaleFactor GetScaleFactorForView(const RenderWidgetHostView* view) {
return ui::GetScaleFactorForNativeView(view ? view->GetNativeView() : NULL);
}
-gfx::Point ConvertPointToDIP(const RenderWidgetHostView* view,
- const gfx::Point& point_in_pixel) {
+gfx::Point ConvertViewPointToDIP(const RenderWidgetHostView* view,
+ const gfx::Point& point_in_pixel) {
return gfx::ToFlooredPoint(
gfx::ScalePoint(point_in_pixel, 1.0f / GetScaleForView(view)));
}
-gfx::Size ConvertSizeToDIP(const RenderWidgetHostView* view,
- const gfx::Size& size_in_pixel) {
+gfx::Size ConvertViewSizeToPixel(const RenderWidgetHostView* view,
+ const gfx::Size& size_in_dip) {
return gfx::ToFlooredSize(
- gfx::ScaleSize(size_in_pixel, 1.0f / GetScaleForView(view)));
+ gfx::ScaleSize(size_in_dip, GetScaleForView(view)));
}
-gfx::Rect ConvertRectToDIP(const RenderWidgetHostView* view,
- const gfx::Rect& rect_in_pixel) {
- float scale = 1.0f / GetScaleForView(view);
- return gfx::ToFlooredRectDeprecated(gfx::ScaleRect(rect_in_pixel, scale));
+gfx::Rect ConvertViewRectToPixel(const RenderWidgetHostView* view,
+ const gfx::Rect& rect_in_dip) {
+ return ConvertRectToPixel(GetScaleForView(view), rect_in_dip);
}
-gfx::Point ConvertPointToPixel(const RenderWidgetHostView* view,
- const gfx::Point& point_in_dip) {
- return gfx::ToFlooredPoint(
- gfx::ScalePoint(point_in_dip, GetScaleForView(view)));
+gfx::Size ConvertSizeToDIP(float scale_factor,
+ const gfx::Size& size_in_pixel) {
+ return gfx::ToFlooredSize(
+ gfx::ScaleSize(size_in_pixel, 1.0f / scale_factor));
}
-gfx::Size ConvertSizeToPixel(const RenderWidgetHostView* view,
- const gfx::Size& size_in_dip) {
- return gfx::ToFlooredSize(
- gfx::ScaleSize(size_in_dip, GetScaleForView(view)));
+gfx::Rect ConvertRectToDIP(float scale_factor,
+ const gfx::Rect& rect_in_pixel) {
+ return gfx::ToFlooredRectDeprecated(
+ gfx::ScaleRect(rect_in_pixel, 1.0f / scale_factor));
}
-gfx::Rect ConvertRectToPixel(const RenderWidgetHostView* view,
+
+gfx::Rect ConvertRectToPixel(float scale_factor,
const gfx::Rect& rect_in_dip) {
- float scale = GetScaleForView(view);
- return gfx::ToFlooredRectDeprecated(gfx::ScaleRect(rect_in_dip, scale));
+ return gfx::ToFlooredRectDeprecated(
+ gfx::ScaleRect(rect_in_dip, scale_factor));
}
} // namespace content
« no previous file with comments | « content/browser/renderer_host/dip_util.h ('k') | content/browser/renderer_host/render_widget_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698