Bug 1350643 - Part 7: Remove sync GetDPI/DefaultScale/WidgetRounding. Use primary screen's value until RecvShow. r=kanru

MozReview-Commit-ID: GlDMNecWp3j
This commit is contained in:
Samael Wang
2017-05-19 18:20:18 +08:00
parent 589fb2d54c
commit 8db97683d9
10 changed files with 37 additions and 156 deletions

View File

@@ -88,7 +88,7 @@ PuppetWidget::PuppetWidget(TabChild* aTabChild)
: mTabChild(aTabChild)
, mMemoryPressureObserver(nullptr)
, mDPI(-1)
, mRounding(-1)
, mRounding(1)
, mDefaultScale(-1)
, mCursorHotspotX(0)
, mCursorHotspotY(0)
@@ -1152,42 +1152,18 @@ PuppetWidget::NeedsPaint()
float
PuppetWidget::GetDPI()
{
if (mDPI < 0) {
if (mTabChild) {
mTabChild->GetDPI(&mDPI);
} else {
mDPI = 96.0;
}
}
return mDPI;
}
double
PuppetWidget::GetDefaultScaleInternal()
{
if (mDefaultScale < 0) {
if (mTabChild) {
mTabChild->GetDefaultScale(&mDefaultScale);
} else {
mDefaultScale = 1;
}
}
return mDefaultScale;
}
int32_t
PuppetWidget::RoundsWidgetCoordinatesTo()
{
if (mRounding < 0) {
if (mTabChild) {
mTabChild->GetWidgetRounding(&mRounding);
} else {
mRounding = 1;
}
}
return mRounding;
}