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

Unified Diff: content/browser/renderer_host/render_widget_host_view_mac.mm

Issue 2739113002: Simplify calls for scale factor (Closed)
Patch Set: nit Created 3 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 | « content/browser/renderer_host/render_widget_host_view_mac.h ('k') | ui/aura/mus/window_tree_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_widget_host_view_mac.mm
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm
index b7b6e741b5555a87b1855b7694a229053d5fa045..9a2cbca3fd1bd3333b986eab9bcd6609d90e4376 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
@@ -75,7 +75,6 @@
#include "ui/base/cocoa/cocoa_base_utils.h"
#import "ui/base/cocoa/fullscreen_window_manager.h"
#import "ui/base/cocoa/underlay_opengl_hosting_window.h"
-#include "ui/base/layout.h"
#include "ui/compositor/compositor.h"
#include "ui/compositor/layer.h"
#include "ui/display/display.h"
@@ -689,10 +688,6 @@ int RenderWidgetHostViewMac::window_number() const {
return [window windowNumber];
}
-float RenderWidgetHostViewMac::ViewScaleFactor() const {
- return ui::GetScaleFactorForNativeView(cocoa_view_);
-}
-
void RenderWidgetHostViewMac::UpdateDisplayLink() {
static bool is_vsync_disabled =
base::CommandLine::ForCurrentProcess()->HasSwitch(
@@ -1523,9 +1518,7 @@ cc::FrameSinkId RenderWidgetHostViewMac::FrameSinkIdAtPoint(
gfx::Point* transformed_point) {
// The surface hittest happens in device pixels, so we need to convert the
// |point| from DIPs to pixels before hittesting.
- float scale_factor = display::Screen::GetScreen()
- ->GetDisplayNearestWindow(cocoa_view_)
- .device_scale_factor();
+ float scale_factor = ui::GetScaleFactorForNativeView(cocoa_view_);
gfx::Point point_in_pixels = gfx::ConvertPointToPixel(scale_factor, point);
cc::SurfaceId id =
browser_compositor_->GetDelegatedFrameHost()->SurfaceIdAtPoint(
@@ -1580,9 +1573,7 @@ bool RenderWidgetHostViewMac::TransformPointToLocalCoordSpace(
gfx::Point* transformed_point) {
// Transformations use physical pixels rather than DIP, so conversion
// is necessary.
- float scale_factor = display::Screen::GetScreen()
- ->GetDisplayNearestWindow(cocoa_view_)
- .device_scale_factor();
+ float scale_factor = ui::GetScaleFactorForNativeView(cocoa_view_);
gfx::Point point_in_pixels = gfx::ConvertPointToPixel(scale_factor, point);
if (!browser_compositor_->GetDelegatedFrameHost()
->TransformPointToLocalCoordSpace(point_in_pixels, original_surface,
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_mac.h ('k') | ui/aura/mus/window_tree_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698