зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1767124 - Change the return type of nsLayoutUtils::GetTransformToAncestorScaleExcludingAnimated to MatrixScalesDouble. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D147100
This commit is contained in:
Родитель
2add5dfe81
Коммит
331a6fea02
|
@ -2144,15 +2144,15 @@ static Matrix4x4Flagged GetTransformToAncestorExcludingAnimated(
|
||||||
return ctm;
|
return ctm;
|
||||||
}
|
}
|
||||||
|
|
||||||
gfxSize nsLayoutUtils::GetTransformToAncestorScaleExcludingAnimated(
|
MatrixScalesDouble nsLayoutUtils::GetTransformToAncestorScaleExcludingAnimated(
|
||||||
nsIFrame* aFrame) {
|
nsIFrame* aFrame) {
|
||||||
Matrix4x4Flagged transform = GetTransformToAncestorExcludingAnimated(
|
Matrix4x4Flagged transform = GetTransformToAncestorExcludingAnimated(
|
||||||
aFrame, nsLayoutUtils::GetDisplayRootFrame(aFrame));
|
aFrame, nsLayoutUtils::GetDisplayRootFrame(aFrame));
|
||||||
Matrix transform2D;
|
Matrix transform2D;
|
||||||
if (transform.Is2D(&transform2D)) {
|
if (transform.Is2D(&transform2D)) {
|
||||||
return ThebesMatrix(transform2D).ScaleFactors().ToSize();
|
return ThebesMatrix(transform2D).ScaleFactors();
|
||||||
}
|
}
|
||||||
return gfxSize(1, 1);
|
return MatrixScalesDouble();
|
||||||
}
|
}
|
||||||
|
|
||||||
const nsIFrame* nsLayoutUtils::FindNearestCommonAncestorFrame(
|
const nsIFrame* nsLayoutUtils::FindNearestCommonAncestorFrame(
|
||||||
|
|
|
@ -955,7 +955,8 @@ class nsLayoutUtils {
|
||||||
* If some frame on the path from aFrame to the display root frame may have an
|
* If some frame on the path from aFrame to the display root frame may have an
|
||||||
* animated scale, returns the identity scale factors.
|
* animated scale, returns the identity scale factors.
|
||||||
*/
|
*/
|
||||||
static gfxSize GetTransformToAncestorScaleExcludingAnimated(nsIFrame* aFrame);
|
static MatrixScalesDouble GetTransformToAncestorScaleExcludingAnimated(
|
||||||
|
nsIFrame* aFrame);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets a scale that includes CSS transforms in this process as well as the
|
* Gets a scale that includes CSS transforms in this process as well as the
|
||||||
|
|
|
@ -1080,9 +1080,12 @@ void nsImageFrame::MaybeDecodeForPredictedSize() {
|
||||||
|
|
||||||
// OK, we're ready to decode. Compute the scale to the screen...
|
// OK, we're ready to decode. Compute the scale to the screen...
|
||||||
mozilla::PresShell* presShell = PresContext()->PresShell();
|
mozilla::PresShell* presShell = PresContext()->PresShell();
|
||||||
LayoutDeviceToScreenScale2D resolutionToScreen(
|
MatrixScalesDouble scale =
|
||||||
presShell->GetCumulativeResolution() *
|
ScaleFactor<UnknownUnits, UnknownUnits>(
|
||||||
nsLayoutUtils::GetTransformToAncestorScaleExcludingAnimated(this));
|
presShell->GetCumulativeResolution()) *
|
||||||
|
nsLayoutUtils::GetTransformToAncestorScaleExcludingAnimated(this);
|
||||||
|
auto resolutionToScreen =
|
||||||
|
ViewAs<LayoutDeviceToScreenScale2D>(scale.ConvertTo<float>());
|
||||||
|
|
||||||
// If we are in a remote browser, then apply scaling from ancestor browsers
|
// If we are in a remote browser, then apply scaling from ancestor browsers
|
||||||
if (BrowserChild* browserChild = BrowserChild::GetFrom(presShell)) {
|
if (BrowserChild* browserChild = BrowserChild::GetFrom(presShell)) {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче