From 768fe580ee3338059c62c9dde95ec75d80a27277 Mon Sep 17 00:00:00 2001 From: Robert O'Callahan Date: Mon, 8 Oct 2012 23:36:06 +1300 Subject: [PATCH] Bug 798607. Ensure GetContentsScaleFactor is 1.0 on all non-Mac platforms. r=smichaud,a=akeybl --- dom/plugins/base/nsPluginInstanceOwner.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dom/plugins/base/nsPluginInstanceOwner.cpp b/dom/plugins/base/nsPluginInstanceOwner.cpp index 114bbe95ac66..3117946c23eb 100644 --- a/dom/plugins/base/nsPluginInstanceOwner.cpp +++ b/dom/plugins/base/nsPluginInstanceOwner.cpp @@ -3727,6 +3727,10 @@ nsPluginInstanceOwner::GetContentsScaleFactor(double *result) { NS_ENSURE_ARG_POINTER(result); double scaleFactor = 1.0; + // On Mac, device pixels need to be translated to (and from) "display pixels" + // for plugins. On other platforms, plugin coordinates are always in device + // pixels. +#if defined(XP_MACOSX) if (mWidget) { scaleFactor = mWidget->GetDefaultScale(); } else { @@ -3746,6 +3750,7 @@ nsPluginInstanceOwner::GetContentsScaleFactor(double *result) } } } +#endif *result = scaleFactor; return NS_OK; }