Bug 1263083 - Use single-tile layer when less than half the tile size in either dimension; r=mstange

MozReview-Commit-ID: 8yYXVl36AHK

--HG--
extra : transplant_source : %81%F9%DB%1D%F2%B9%A2vY%5D%04m%A0%1A%B7%EB%92%224P
This commit is contained in:
Jamie Nicol 2016-06-24 12:52:17 +01:00
Родитель 69c18bd6cc
Коммит f19a9e2f30
1 изменённых файлов: 8 добавлений и 1 удалений

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

@ -425,9 +425,16 @@ ClientTiledPaintedLayer::RenderLayer()
IntSize layerSize = mVisibleRegion.ToUnknownRegion().GetBounds().Size();
IntSize tileSize(gfxPlatform::GetPlatform()->GetTileWidth(),
gfxPlatform::GetPlatform()->GetTileHeight());
bool isHalfTileWidthOrHeight = layerSize.width <= tileSize.width / 2 ||
layerSize.height <= tileSize.height / 2;
// Use single tile when layer is not scrollable, is smaller than one
// tile, or when more than half of the tiles' pixels in either
// dimension would be wasted.
bool wantSingleTiledContentClient =
(mCreationHint == LayerManager::NONE || layerSize <= tileSize) &&
(mCreationHint == LayerManager::NONE ||
layerSize <= tileSize ||
isHalfTileWidthOrHeight) &&
SingleTiledContentClient::ClientSupportsLayerSize(layerSize, ClientManager()) &&
gfxPrefs::LayersSingleTileEnabled();