Backed out changeset f8c14563b37d (bug 1364221) for m(c1) failures in test_animation_performance_warning.html a=backout

MozReview-Commit-ID: 9vwi69eAZ5r

--HG--
extra : rebase_source : 5cba4d42b12447f6734b4cf1c1f4d9956bc1ace3
This commit is contained in:
Wes Kocher 2017-05-19 14:01:47 -07:00
parent 0760ea179b
commit f8ee017832
4 changed files with 19 additions and 45 deletions

View File

@ -35,18 +35,11 @@ AnimationPerformanceWarning::ToLocalizedString(
switch (mType) {
case Type::ContentTooLarge:
MOZ_ASSERT(mParams && mParams->Length() == 6,
"Parameter's length should be 6 for ContentTooLargeDimensions");
"Parameter's length should be 6 for ContentTooLarge");
return NS_SUCCEEDED(
ToLocalizedStringWithIntParams<7>(
"CompositorAnimationWarningContentTooLargeDimensions", aLocalizedString));
case Type::ContentTooLargeArea:
MOZ_ASSERT(mParams && mParams->Length() == 2,
"Parameter's length should be 2 for ContentTooLargeArea");
return NS_SUCCEEDED(
ToLocalizedStringWithIntParams<3>(
"CompositorAnimationWarningContentTooLargeArea", aLocalizedString));
"CompositorAnimationWarningContentTooLarge2", aLocalizedString));
case Type::TransformBackfaceVisibilityHidden:
key = "CompositorAnimationWarningTransformBackfaceVisibilityHidden";
break;

View File

@ -21,7 +21,6 @@ struct AnimationPerformanceWarning
{
enum class Type : uint8_t {
ContentTooLarge,
ContentTooLargeArea,
TransformBackfaceVisibilityHidden,
TransformPreserve3D,
TransformSVG,

View File

@ -11,15 +11,11 @@ ImageMapPolyOddNumberOfCoords=The “coords” attribute of the <area shape="pol
TablePartRelPosWarning=Relative positioning of table rows and row groups is now supported. This site may need to be updated because it may depend on this feature having no effect.
ScrollLinkedEffectFound2=This site appears to use a scroll-linked positioning effect. This may not work well with asynchronous panning; see https://developer.mozilla.org/docs/Mozilla/Performance/ScrollLinkedEffects for further details and to join the discussion on related tools and features!
## LOCALIZATION NOTE(CompositorAnimationWarningContentTooLargeArea):
## %1$S is an integer value of the area of the frame size
## %2$S is an integer value of the area of a limit based on the viewport size
CompositorAnimationWarningContentTooLargeArea=Animation cannot be run on the compositor because the area of the frame size (%1$S) is too large relative to the viewport (larger than %2$S)
## LOCALIZATION NOTE(CompositorAnimationWarningContentTooLargeDimensions):
## LOCALIZATION NOTE(CompositorAnimationWarningContentTooLarge2):
## (%1$S, %2$S) is a pair of integer values of the frame size
## (%3$S, %4$S) is a pair of integer values of a limit based on the viewport size
## (%5$S, %6$S) is a pair of integer values of an absolute limit
CompositorAnimationWarningContentTooLargeDimensions=Animation cannot be run on the compositor because the frame size (%1$S, %2$S) is too large relative to the viewport (larger than (%3$S, %4$S)) or larger than the maximum allowed value (%5$S, %6$S)
CompositorAnimationWarningContentTooLarge2=Animation cannot be run on the compositor because the frame size (%1$S, %2$S) is too large relative to the viewport (larger than (%3$S, %4$S)) or larger than the maximum allowed value (%5$S, %6$S)
## LOCALIZATION NOTE(CompositorAnimationWarningTransformBackfaceVisibilityHidden):
## 'backface-visibility: hidden' is a CSS property, don't translate it.
CompositorAnimationWarningTransformBackfaceVisibilityHidden=Animations of backface-visibility: hidden transforms cannot be run on the compositor

View File

@ -7382,11 +7382,9 @@ nsDisplayTransform::ShouldPrerenderTransformedContent(nsDisplayListBuilder* aBui
aFrame->PresContext()->DevPixelsToAppUnits(absoluteLimitY));
nsSize maxSize = Min(relativeLimit, absoluteLimit);
gfxSize scale = nsLayoutUtils::GetTransformToAncestorScale(aFrame);
nsSize frameSize(overflow.Size().width * scale.width,
overflow.Size().height * scale.height);
uint64_t maxLimitArea = uint64_t(maxSize.width) * maxSize.height;
uint64_t frameArea = uint64_t(frameSize.width) * frameSize.height;
if (frameArea <= maxLimitArea && frameSize <= absoluteLimit) {
nsSize frameSize = nsSize(overflow.Size().width * scale.width,
overflow.Size().height * scale.height);
if (frameSize <= maxSize) {
*aDirtyRect = overflow;
return FullPrerender;
} else if (gfxPrefs::PartiallyPrerenderAnimatedContent()) {
@ -7394,30 +7392,18 @@ nsDisplayTransform::ShouldPrerenderTransformedContent(nsDisplayListBuilder* aBui
return PartialPrerender;
}
if (frameArea > maxLimitArea) {
EffectCompositor::SetPerformanceWarning(
aFrame, eCSSProperty_transform,
AnimationPerformanceWarning(
AnimationPerformanceWarning::Type::ContentTooLargeArea,
{
nsPresContext::AppUnitsToIntCSSPixels(frameArea),
nsPresContext::AppUnitsToIntCSSPixels(maxLimitArea),
}));
} else {
EffectCompositor::SetPerformanceWarning(
aFrame, eCSSProperty_transform,
AnimationPerformanceWarning(
AnimationPerformanceWarning::Type::ContentTooLarge,
{
nsPresContext::AppUnitsToIntCSSPixels(frameSize.width),
nsPresContext::AppUnitsToIntCSSPixels(frameSize.height),
nsPresContext::AppUnitsToIntCSSPixels(relativeLimit.width),
nsPresContext::AppUnitsToIntCSSPixels(relativeLimit.height),
nsPresContext::AppUnitsToIntCSSPixels(absoluteLimit.width),
nsPresContext::AppUnitsToIntCSSPixels(absoluteLimit.height),
}));
}
EffectCompositor::SetPerformanceWarning(
aFrame, eCSSProperty_transform,
AnimationPerformanceWarning(
AnimationPerformanceWarning::Type::ContentTooLarge,
{
nsPresContext::AppUnitsToIntCSSPixels(frameSize.width),
nsPresContext::AppUnitsToIntCSSPixels(frameSize.height),
nsPresContext::AppUnitsToIntCSSPixels(relativeLimit.width),
nsPresContext::AppUnitsToIntCSSPixels(relativeLimit.height),
nsPresContext::AppUnitsToIntCSSPixels(absoluteLimit.width),
nsPresContext::AppUnitsToIntCSSPixels(absoluteLimit.height),
}));
return NoPrerender;
}