Issue #2364 - Limit the growth of scaling for animated nsDisplayTransform in the fallback case.

This ensures we don't scale the underlying size of the layer beyond what
is close to the current display size. When box shadows get much larger
than this, they start taking so much time to render that successive
frames grow in scale too fast for any inter-frame reuse to be possible.

With this, we avoid that and no longer get crushed by re-rendering
gigantic box shadows every single frame.

See BZ 1383825
This commit is contained in:
Moonchild 2023-10-30 16:43:13 +01:00 • committed by roytam1
commit 0db18745f4
3 changed files with 42 additions and 21 deletions

View file

@ -128,9 +128,10 @@ public:
/**
* Return the smallest power of kScaleResolution (2) greater than or equal to
* aVal.
* aVal. If aRoundDown is specified, the power of 2 will be less than
* or equal to aVal.
*/
static gfxFloat ClampToScaleFactor(gfxFloat aVal);
static gfxFloat ClampToScaleFactor(gfxFloat aVal, bool aRoundDown = false);
/**
* Clears surface to aColor (which defaults to transparent black).