Fix max texture size handling in displayport clamping. (bug 1135907 follow-up, r=kats)

--HG--
extra : rebase_source : 3225e248e7d870d41f74897ede54acb5c531a0c4
This commit is contained in:
David Anderson 2015-03-23 12:34:21 -07:00
Родитель 41763998ae
Коммит c7317dc748
1 изменённых файлов: 6 добавлений и 5 удалений

Просмотреть файл

@ -848,7 +848,10 @@ GetMaxDisplayPortSize(nsIContent* aContent)
}
nsPresContext* presContext = frame->PresContext();
uint32_t maxSizeInDevPixels = lm->GetMaxTextureSize();
int32_t maxSizeInDevPixels = lm->GetMaxTextureSize();
if (maxSizeInDevPixels < 0 || maxSizeInDevPixels == INT_MAX) {
return nscoord_MAX;
}
return presContext->DevPixelsToAppUnits(maxSizeInDevPixels);
}
@ -1053,11 +1056,9 @@ GetDisplayPortImpl(nsIContent* aContent, nsRect *aResult, float aMultiplier)
if (!gfxPrefs::LayersTilesEnabled()) {
// Either we should have gotten a valid rect directly from the displayport
// base, or we should have computed a valid rect from the margins.
NS_ASSERTION(GetMaxDisplayPortSize(aContent) <= 0 ||
result.width < GetMaxDisplayPortSize(aContent),
NS_ASSERTION(result.width <= GetMaxDisplayPortSize(aContent),
"Displayport must be a valid texture size");
NS_ASSERTION(GetMaxDisplayPortSize(aContent) <= 0 ||
result.height < GetMaxDisplayPortSize(aContent),
NS_ASSERTION(result.height <= GetMaxDisplayPortSize(aContent),
"Displayport must be a valid texture size");
}