зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1494924. Set the visible area of the blob to GetBuildingRect. r=mattwoodrow
This lets us get some of the advantages of clipped blobs by drawing less of the fallback blob while still not needing to rerecord and redraw the blob completely during scrolling because of the changing clip rect. It drops the number of tiles requested on a reduced test case reduced from the Googled doc from 60 to a much more reasonable number. Differential Revision: https://phabricator.services.mozilla.com/D17180
This commit is contained in:
Родитель
4760725faa
Коммит
98ad049f2d
|
@ -2039,6 +2039,14 @@ WebRenderCommandBuilder::GenerateFallbackData(
|
|||
appUnitsPerDevPixel, residualOffset));
|
||||
auto dtSize = dtRect.Size();
|
||||
|
||||
auto visibleRect = LayerIntRect::FromUnknownRect(
|
||||
ScaleToOutsidePixelsOffset(
|
||||
aItem->GetBuildingRect(), scale.width,
|
||||
scale.height, appUnitsPerDevPixel, residualOffset))
|
||||
.Intersect(dtRect);
|
||||
// visibleRect is relative to the blob origin so adjust for that
|
||||
visibleRect -= dtRect.TopLeft();
|
||||
|
||||
if (dtSize.IsEmpty()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -2146,6 +2154,10 @@ WebRenderCommandBuilder::GenerateFallbackData(
|
|||
return nullptr;
|
||||
}
|
||||
}
|
||||
aResources.SetBlobImageVisibleArea(
|
||||
fallbackData->GetBlobImageKey().value(),
|
||||
ViewAs<ImagePixel>(visibleRect,
|
||||
PixelCastJustification::LayerIsImage));
|
||||
} else {
|
||||
fallbackData->CreateImageClientIfNeeded();
|
||||
RefPtr<ImageClient> imageClient = fallbackData->GetImageClient();
|
||||
|
|
Загрузка…
Ссылка в новой задаче