mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-27 21:00:50 +00:00
Bug 1166500 - Part 3: Add KeyframeEffectReadOnly::CanIgnoreIfNotVisible(). r=dbaron
This commit is contained in:
parent
caa5bb7b54
commit
eec4931934
@ -1329,6 +1329,15 @@ KeyframeEffectReadOnly::CalculateCumulativeChangeHint()
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
KeyframeEffectReadOnly::CanIgnoreIfNotVisible() const
|
||||
{
|
||||
// FIXME: For further sophisticated optimization we need to check
|
||||
// change hint on the segment corresponding to computedTiming.progress.
|
||||
return NS_IsHintSubset(
|
||||
mCumulativeChangeHint, nsChangeHint_Hints_CanIgnoreIfNotVisible);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------
|
||||
//
|
||||
// KeyframeEffect
|
||||
|
@ -345,6 +345,12 @@ public:
|
||||
// This is used for deciding the animation is paint-only.
|
||||
void CalculateCumulativeChangeHint();
|
||||
|
||||
// Returns true if all of animation properties' change hints
|
||||
// can ignore painting if the animation is not visible.
|
||||
// See nsChangeHint_Hints_CanIgnoreIfNotVisible in nsChangeHint.h
|
||||
// in detail which change hint can be ignored.
|
||||
bool CanIgnoreIfNotVisible() const;
|
||||
|
||||
protected:
|
||||
KeyframeEffectReadOnly(nsIDocument* aDocument,
|
||||
const Maybe<OwningAnimationTarget>& aTarget,
|
||||
|
@ -359,6 +359,13 @@ inline nsChangeHint NS_HintsNotHandledForDescendantsIn(nsChangeHint aChangeHint)
|
||||
#define NS_STYLE_HINT_FRAMECHANGE \
|
||||
nsChangeHint(NS_STYLE_HINT_REFLOW | nsChangeHint_ReconstructFrame)
|
||||
|
||||
#define nsChangeHint_Hints_CanIgnoreIfNotVisible \
|
||||
nsChangeHint(NS_STYLE_HINT_VISUAL | \
|
||||
nsChangeHint_NeutralChange | \
|
||||
nsChangeHint_UpdateOpacityLayer | \
|
||||
nsChangeHint_UpdateTransformLayer | \
|
||||
nsChangeHint_UpdateUsesOpacity)
|
||||
|
||||
/**
|
||||
* |nsRestyleHint| is a bitfield for the result of
|
||||
* |HasStateDependentStyle| and |HasAttributeDependentStyle|. When no
|
||||
|
Loading…
x
Reference in New Issue
Block a user