Backed out changeset 94302209286e (bug 1321412)

This commit is contained in:
Sebastian Hengst 2016-12-09 22:26:54 +01:00
Родитель fe2223eaca
Коммит 9717b63320
3 изменённых файлов: 7 добавлений и 10 удалений

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

@ -2209,9 +2209,10 @@ nsIFrame::BuildDisplayListForStackingContext(nsDisplayListBuilder* aBuilder,
if (isTransformed) { if (isTransformed) {
const nsRect overflow = GetVisualOverflowRectRelativeToSelf(); const nsRect overflow = GetVisualOverflowRectRelativeToSelf();
nsDisplayTransform::PrerenderDecision decision = nsDisplayTransform::PrerenderDecision decision =
nsDisplayTransform::ShouldPrerenderTransformedContent(aBuilder, this, &dirtyRect); nsDisplayTransform::ShouldPrerenderTransformedContent(aBuilder, this);
switch (decision) { switch (decision) {
case nsDisplayTransform::FullPrerender: case nsDisplayTransform::FullPrerender:
dirtyRect = overflow;
allowAsyncAnimation = true; allowAsyncAnimation = true;
break; break;
case nsDisplayTransform::NoPrerender: case nsDisplayTransform::NoPrerender:

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

@ -6228,8 +6228,7 @@ nsDisplayTransform::CanUseAsyncAnimations(nsDisplayListBuilder* aBuilder)
/* static */ auto /* static */ auto
nsDisplayTransform::ShouldPrerenderTransformedContent(nsDisplayListBuilder* aBuilder, nsDisplayTransform::ShouldPrerenderTransformedContent(nsDisplayListBuilder* aBuilder,
nsIFrame* aFrame, nsIFrame* aFrame) -> PrerenderDecision
nsRect* aDirtyRect) -> PrerenderDecision
{ {
// Elements whose transform has been modified recently, or which // Elements whose transform has been modified recently, or which
// have a compositor-animated transform, can be prerendered. An element // have a compositor-animated transform, can be prerendered. An element
@ -6252,14 +6251,13 @@ nsDisplayTransform::ShouldPrerenderTransformedContent(nsDisplayListBuilder* aBui
// for shadows, borders, etc. // for shadows, borders, etc.
refSize += nsSize(refSize.width / 8, refSize.height / 8); refSize += nsSize(refSize.width / 8, refSize.height / 8);
gfxSize scale = nsLayoutUtils::GetTransformToAncestorScale(aFrame); gfxSize scale = nsLayoutUtils::GetTransformToAncestorScale(aFrame);
nsRect overflow = aFrame->GetVisualOverflowRectRelativeToSelf(); nsSize frameSize = nsSize(
nsSize frameSize = nsSize(overflow.Size().width * scale.width, aFrame->GetVisualOverflowRectRelativeToSelf().Size().width * scale.width,
overflow.Size().height * scale.height); aFrame->GetVisualOverflowRectRelativeToSelf().Size().height * scale.height);
nscoord maxInAppUnits = nscoord_MAX; nscoord maxInAppUnits = nscoord_MAX;
if (frameSize <= refSize) { if (frameSize <= refSize) {
maxInAppUnits = aFrame->PresContext()->DevPixelsToAppUnits(4096); maxInAppUnits = aFrame->PresContext()->DevPixelsToAppUnits(4096);
if (frameSize <= nsSize(maxInAppUnits, maxInAppUnits)) { if (frameSize <= nsSize(maxInAppUnits, maxInAppUnits)) {
*aDirtyRect = overflow;
return FullPrerender; return FullPrerender;
} }
} }

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

@ -4283,11 +4283,9 @@ public:
/** /**
* Return FullPrerender 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). * transformed frame even when it's not completely visible (yet).
* |aDirtyRect| is updated to the area that should be prerendered.
*/ */
static PrerenderDecision ShouldPrerenderTransformedContent(nsDisplayListBuilder* aBuilder, static PrerenderDecision ShouldPrerenderTransformedContent(nsDisplayListBuilder* aBuilder,
nsIFrame* aFrame, nsIFrame* aFrame);
nsRect* aDirtyRect);
bool CanUseAsyncAnimations(nsDisplayListBuilder* aBuilder) override; bool CanUseAsyncAnimations(nsDisplayListBuilder* aBuilder) override;
bool MayBeAnimated(nsDisplayListBuilder* aBuilder); bool MayBeAnimated(nsDisplayListBuilder* aBuilder);