Don't optimize group opacity into SVG fill/stroke paint opacity if we want to handle it on the compositor thread

ASSIGNED
Assigned to

Status

()

Core
Layout
P3
normal
ASSIGNED
2 years ago
3 months ago

People

(Reporter: jwatt, Assigned: jwatt)

Tracking

({perf})

Trunk
Points:
---

Firefox Tracking Flags

(firefox50 affected)

Details

Attachments

(3 attachments)

+++ This bug was initially created as a clone of Bug #1263829 +++

Spinning this off from bug 1263829 to try and implement the approach I outlined in bug 1263829 comment 13 - 15.
Created attachment 8761263 [details] [diff] [review]
Make CanOptimizeOpacity return false if UsingEffectsForFrame returns true

(see the comment added to CanOptimizeOpacity in the attached patch)
Created attachment 8761266 [details] [diff] [review]
pass opacity (for reference)
Created attachment 8761267 [details] [diff] [review]
pass opacity 2 (for reference)
Just attaching these patches since I'm not going to have time to work on this until after the all-hands. The rough idea, which may or may not work, would be:

 * Backout part 2 from bug 1263829.

 * Apply the patch Make CanOptimizeOpacity return false if
   UsingEffectsForFrame returns true (see the comment added in
   CanOptimizeOpacity).

 * Rename CanOptimizeOpacity to CanOptimizeStaticOpacity and document
   that even if it returns true it may not be possible to optimize the
   opacity into the fill/stroke opacity if async animations are
   happening.

 * Do something like the 'pass opacity' plus 'pass opacity 2' patches,
   but instead of passing opacity use the nsDisplayOpacity::NeedsActiveLayer
   method added in bug 1263829 to pass an aOpacityIsAnimating argument
   from nsDisplaySVGPathGeometry through to nsSVGUtils::MakeFillPatternFor/
   MakeStrokePatternFor, then account for that at the same time as the
   CanOptimizeStaticOpacity checks there.
FWIW after bug 1263829 lands I think the only time that we don't create an nsDisplayOpacity when we would want to create one no animate opacity on the compositor thread is when opacity is animated on a geometry element (<path>, say) and nsSVGUtils::CanOptimizeOpacity returns true. That's not a hugely common case I expect, so this bug isn't particularly urgent.
(Assignee)

Updated

2 years ago
Keywords: perf
(Assignee)

Updated

2 years ago
No longer blocks: 1141468
Status: NEW → ASSIGNED
Priority: -- → P3
(Assignee)

Updated

3 months ago
See Also: → bug 1400035
You need to log in before you can comment on or make changes to this bug.