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

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

Issue 293563002: GetScaleFactorForNativeView should return scale factor in float (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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_view_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 a41c4d1f9323c63b9dff0c0e5452b0741f7d0c67..30490158a3ce0e0ccad4c99515bb6ebb0059b2f9 100644
--- a/content/browser/renderer_host/dip_util.cc
+++ b/content/browser/renderer_host/dip_util.cc
@@ -5,6 +5,7 @@
#include "content/browser/renderer_host/dip_util.h"
#include "content/public/browser/render_widget_host_view.h"
+#include "ui/base/layout.h"
#include "ui/gfx/display.h"
#include "ui/gfx/point.h"
#include "ui/gfx/point_conversions.h"
@@ -15,32 +16,25 @@
#include "ui/gfx/size_conversions.h"
namespace content {
-namespace {
-float GetScaleForView(const RenderWidgetHostView* view) {
- return ui::GetImageScale(GetScaleFactorForView(view));
-}
-
-} // namespace
-
-ui::ScaleFactor GetScaleFactorForView(const RenderWidgetHostView* view) {
+float GetScaleFactorForView(const RenderWidgetHostView* view) {
return ui::GetScaleFactorForNativeView(view ? view->GetNativeView() : NULL);
}
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::ScalePoint(point_in_pixel, 1.0f / GetScaleFactorForView(view)));
}
gfx::Size ConvertViewSizeToPixel(const RenderWidgetHostView* view,
const gfx::Size& size_in_dip) {
- return ConvertSizeToPixel(GetScaleForView(view), size_in_dip);
+ return ConvertSizeToPixel(GetScaleFactorForView(view), size_in_dip);
}
gfx::Rect ConvertViewRectToPixel(const RenderWidgetHostView* view,
const gfx::Rect& rect_in_dip) {
- return ConvertRectToPixel(GetScaleForView(view), rect_in_dip);
+ return ConvertRectToPixel(GetScaleFactorForView(view), rect_in_dip);
}
gfx::Size ConvertSizeToDIP(float scale_factor,
« no previous file with comments | « content/browser/renderer_host/dip_util.h ('k') | content/browser/renderer_host/render_view_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698