Here's Pathfinder rendering a port of the NanoVG demo, showing off its new support for HTML canvas features: https://github.com/servo/pathfinder/blob/master/examples/canvas_nanovg/src/main.rs … (Most of the rendering time goes to Gaussian blurs which have to be spec compliant in Pathfinder, unfortunately…)pic.twitter.com/P8SAZTw55A
In a serious app you’d lay out the text up front so you don’t have to reflow every frame (which PF supports with a canvas extension), but I’m hesitant to do that because it adds noise to the code.
A per-word shape cache is another sol’n, but @raphlinus and I were a bit hesitant.
-
-
Text layout is definitely expensive. Caching buys you so much, at some point you want to retain the text layout object so you're not redoing it, but this pushes complexity into the app.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.