mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 784846 - The ShouldPrerender check for async animations is wrong r=mattwoodrow
This commit is contained in:
parent
5371efd533
commit
b099208605
@ -345,7 +345,7 @@ AddAnimationsAndTransitionsToLayer(Layer* aLayer, nsDisplayListBuilder* aBuilder
|
||||
|
||||
// If the frame is not prerendered, bail out. Layout will still perform the
|
||||
// animation.
|
||||
if (!nsDisplayTransform::ShouldPrerenderTransformedContent(aBuilder, frame)) {
|
||||
if (!aItem->CanUseAsyncAnimations(aBuilder)) {
|
||||
if (nsLayoutUtils::IsAnimationLoggingEnabled()) {
|
||||
printf_stderr("Performance warning: Async animation disabled because the frame for element '%s'",
|
||||
nsAtomCString(aContent->Tag()).get());
|
||||
|
@ -910,13 +910,20 @@ public:
|
||||
*/
|
||||
virtual void DisableComponentAlpha() {}
|
||||
|
||||
/**
|
||||
* Check if we can add async animations to the layer for this display item.
|
||||
*/
|
||||
virtual bool CanUseAsyncAnimations(nsDisplayListBuilder* aBuilder) {
|
||||
return false;
|
||||
}
|
||||
|
||||
protected:
|
||||
friend class nsDisplayList;
|
||||
|
||||
|
||||
nsDisplayItem() {
|
||||
mAbove = nullptr;
|
||||
}
|
||||
|
||||
|
||||
nsIFrame* mFrame;
|
||||
// Result of ToReferenceFrame(mFrame), if mFrame is non-null
|
||||
nsPoint mToReferenceFrame;
|
||||
@ -1873,7 +1880,7 @@ public:
|
||||
protected:
|
||||
nsDisplayWrapper() {}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* The standard display item to paint a stacking context with translucency
|
||||
* set by the stacking context root frame's 'opacity' style.
|
||||
@ -1885,7 +1892,7 @@ public:
|
||||
#ifdef NS_BUILD_REFCNT_LOGGING
|
||||
virtual ~nsDisplayOpacity();
|
||||
#endif
|
||||
|
||||
|
||||
virtual nsRegion GetOpaqueRegion(nsDisplayListBuilder* aBuilder,
|
||||
bool* aSnap);
|
||||
virtual already_AddRefed<Layer> BuildLayer(nsDisplayListBuilder* aBuilder,
|
||||
@ -1899,6 +1906,10 @@ public:
|
||||
const nsRect& aAllowVisibleRegionExpansion);
|
||||
virtual bool TryMerge(nsDisplayListBuilder* aBuilder, nsDisplayItem* aItem);
|
||||
NS_DISPLAY_DECL_NAME("Opacity", TYPE_OPACITY)
|
||||
|
||||
bool CanUseAsyncAnimations(nsDisplayListBuilder* aBuilder) {
|
||||
return GetUnderlyingFrame()->AreLayersMarkedActive(nsChangeHint_UpdateOpacityLayer);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
@ -2410,6 +2421,10 @@ public:
|
||||
*/
|
||||
static bool ShouldPrerenderTransformedContent(nsDisplayListBuilder* aBuilder,
|
||||
nsIFrame* aFrame);
|
||||
bool CanUseAsyncAnimations(nsDisplayListBuilder* aBuilder) {
|
||||
return nsDisplayTransform::ShouldPrerenderTransformedContent(aBuilder,
|
||||
GetUnderlyingFrame());
|
||||
}
|
||||
|
||||
private:
|
||||
nsDisplayWrapList mStoredList;
|
||||
|
Loading…
Reference in New Issue
Block a user