Bug 845182 - Implement GetDefaultScaleInternal() on Gonk, r=roc

This commit is contained in:
Michael Wu 2013-05-01 16:04:56 -04:00
parent 8def247b2a
commit e8a2e1a574
2 changed files with 12 additions and 0 deletions

View File

@ -541,6 +541,17 @@ nsWindow::GetDPI()
return NativeWindow()->xdpi;
}
double
nsWindow::GetDefaultScaleInternal()
{
double rawscale = GetDPI() / 192.0;
if (rawscale < 1.25)
return 1;
else if (rawscale < 1.75)
return 1.5;
return 2;
}
LayerManager *
nsWindow::GetLayerManager(PLayerTransactionChild* aShadowManager,
LayersBackend aBackendHint,

View File

@ -93,6 +93,7 @@ public:
NS_IMETHOD MakeFullScreen(bool aFullScreen) /*MOZ_OVERRIDE*/;
virtual float GetDPI();
virtual double GetDefaultScaleInternal();
virtual mozilla::layers::LayerManager*
GetLayerManager(PLayerTransactionChild* aShadowManager = nullptr,
LayersBackend aBackendHint = mozilla::layers::LAYERS_NONE,