Bug 1254273 - Align the displayport to a max of 256 pixels even if the layer is larger. r=BenWa, a=ritu

MozReview-Commit-ID: CLghUMWkJU8
This commit is contained in:
Kartikaya Gupta 2016-03-14 15:02:43 -04:00
parent 6c539ebfaa
commit 76c3cd8735

View File

@ -950,8 +950,11 @@ GetDisplayPortFromMarginsData(nsIContent* aContent,
if (APZCCallbackHelper::IsDisplayportSuppressed()) {
alignment = ScreenSize(1, 1);
} else if (gfxPrefs::LayersTilesEnabled()) {
alignment = ScreenSize(gfxPlatform::GetPlatform()->GetTileWidth(),
gfxPlatform::GetPlatform()->GetTileHeight());
// Don't align to tiles if they are too large, because we could expand
// the displayport by a lot which can take more paint time. It's a tradeoff
// though because if we don't align to tiles we have more waste on upload.
alignment = ScreenSize(std::min(256, gfxPlatform::GetPlatform()->GetTileWidth()),
std::min(256, gfxPlatform::GetPlatform()->GetTileHeight()));
} else {
// If we're not drawing with tiles then we need to be careful about not
// hitting the max texture size and we only need 1 draw call per layer