Bug 1616411 - Part 4a: Make SurfaceCache aware that native image sizes can be affected by orientation. r=tnikkel

Differential Revision: https://phabricator.services.mozilla.com/D70983

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Cameron McCormack 2020-04-16 00:34:39 +00:00
parent 808783c5aa
commit 54fca42d06

View File

@ -562,6 +562,10 @@ class ImageSurfaceCache {
MOZ_ASSERT_UNREACHABLE("Expected valid native size!");
return aSize;
}
if (image->GetOrientation().SwapsWidthAndHeight() &&
image->HandledOrientation()) {
std::swap(factorSize.width, factorSize.height);
}
if (mIsVectorImage) {
// Ensure the aspect ratio matches the native size before forcing the