Bug 798607. Ensure GetContentsScaleFactor is 1.0 on all non-Mac platforms. r=smichaud

This commit is contained in:
Robert O'Callahan 2012-10-08 23:36:06 +13:00
parent 217dfe2093
commit a08f9690e9

View File

@ -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;
}