зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1321412 - Change the return type of ShouldPrerenderTransformedContent() to an enum. r=mattwoodrow
MozReview-Commit-ID: EMTdW46D8cM --HG-- extra : rebase_source : 1ecd8fd39a1d3bc74200dbe4f53dd78eda57987e
This commit is contained in:
Родитель
2fb2455dce
Коммит
52f894c5d8
|
@ -2208,11 +2208,14 @@ nsIFrame::BuildDisplayListForStackingContext(nsDisplayListBuilder* aBuilder,
|
|||
bool allowAsyncAnimation = false;
|
||||
if (isTransformed) {
|
||||
const nsRect overflow = GetVisualOverflowRectRelativeToSelf();
|
||||
if (nsDisplayTransform::ShouldPrerenderTransformedContent(aBuilder,
|
||||
this)) {
|
||||
nsDisplayTransform::PrerenderDecision decision =
|
||||
nsDisplayTransform::ShouldPrerenderTransformedContent(aBuilder, this);
|
||||
switch (decision) {
|
||||
case nsDisplayTransform::FullPrerender:
|
||||
dirtyRect = overflow;
|
||||
allowAsyncAnimation = true;
|
||||
} else {
|
||||
break;
|
||||
case nsDisplayTransform::NoPrerender:
|
||||
if (overflow.IsEmpty() && !extend3DContext) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -6226,9 +6226,9 @@ nsDisplayTransform::CanUseAsyncAnimations(nsDisplayListBuilder* aBuilder)
|
|||
return mAllowAsyncAnimation;
|
||||
}
|
||||
|
||||
/* static */ bool
|
||||
/* static */ auto
|
||||
nsDisplayTransform::ShouldPrerenderTransformedContent(nsDisplayListBuilder* aBuilder,
|
||||
nsIFrame* aFrame)
|
||||
nsIFrame* aFrame) -> PrerenderDecision
|
||||
{
|
||||
// Elements whose transform has been modified recently, or which
|
||||
// have a compositor-animated transform, can be prerendered. An element
|
||||
|
@ -6242,7 +6242,7 @@ nsDisplayTransform::ShouldPrerenderTransformedContent(nsDisplayListBuilder* aBui
|
|||
AnimationPerformanceWarning(
|
||||
AnimationPerformanceWarning::Type::TransformFrameInactive));
|
||||
|
||||
return false;
|
||||
return NoPrerender;
|
||||
}
|
||||
|
||||
nsSize refSize = aBuilder->RootReferenceFrame()->GetSize();
|
||||
|
@ -6258,7 +6258,7 @@ nsDisplayTransform::ShouldPrerenderTransformedContent(nsDisplayListBuilder* aBui
|
|||
if (frameSize <= refSize) {
|
||||
maxInAppUnits = aFrame->PresContext()->DevPixelsToAppUnits(4096);
|
||||
if (frameSize <= nsSize(maxInAppUnits, maxInAppUnits)) {
|
||||
return true;
|
||||
return FullPrerender;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6278,7 +6278,7 @@ nsDisplayTransform::ShouldPrerenderTransformedContent(nsDisplayListBuilder* aBui
|
|||
nsPresContext::AppUnitsToIntCSSPixels(visual.height),
|
||||
nsPresContext::AppUnitsToIntCSSPixels(maxInAppUnits)
|
||||
}));
|
||||
return false;
|
||||
return NoPrerender;
|
||||
}
|
||||
|
||||
/* If the matrix is singular, or a hidden backface is shown, the frame won't be visible or hit. */
|
||||
|
|
|
@ -4063,6 +4063,11 @@ class nsDisplayTransform: public nsDisplayItem
|
|||
};
|
||||
|
||||
public:
|
||||
enum PrerenderDecision {
|
||||
NoPrerender,
|
||||
FullPrerender
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns a matrix (in pixels) for the current frame. The matrix should be relative to
|
||||
* the current frame's coordinate space.
|
||||
|
@ -4276,11 +4281,11 @@ public:
|
|||
uint32_t aFlags,
|
||||
const nsRect* aBoundsOverride = nullptr);
|
||||
/**
|
||||
* Return true when we should try to prerender the entire contents of the
|
||||
* Return FullPrerender when we should try to prerender the entire contents of the
|
||||
* transformed frame even when it's not completely visible (yet).
|
||||
*/
|
||||
static bool ShouldPrerenderTransformedContent(nsDisplayListBuilder* aBuilder,
|
||||
nsIFrame* aFrame);
|
||||
static PrerenderDecision ShouldPrerenderTransformedContent(nsDisplayListBuilder* aBuilder,
|
||||
nsIFrame* aFrame);
|
||||
bool CanUseAsyncAnimations(nsDisplayListBuilder* aBuilder) override;
|
||||
|
||||
bool MayBeAnimated(nsDisplayListBuilder* aBuilder);
|
||||
|
|
Загрузка…
Ссылка в новой задаче