When you download a file in Firefox on macOS, we draw a progress bar in the application dock icon. The API we use to do that drawing is slightly inefficient: We create a new NSImage with the combined icon + progress bar drawing, and set that as our application icon.
There's a more efficient API: We can set our own NSView instance as the application dock tile's content view and draw into that NSView. This is also a more modern API and lets us remove another
lockFocus call from the code base.
Another thing that drained CPU as part of dock drawing was the progress bar animation: On 10.9 and below, the native progress bar had a wavy pattern that was animated. So we triggered a redraw of the dock icon 8 times per second while the progress bar was visible. Starting on 10.10, the style is different and there is no more wavy pattern, but we were still triggering the redraws unnecessarily.
This patch reimplements the drawing using manual strokes and fills that look similar to the 10.12 progress bar style, and removes the animated redraws.