servo / pathfinder

A fast, practical GPU rasterizer for fonts and vector graphics
Apache License 2.0
3.6k stars 201 forks source link

Make the fields of `TextMetrics` lazily calculated, and add an API that eliminates double layouts. #408

Closed pcwalton closed 4 years ago

pcwalton commented 4 years ago

This adds an extension to the HTML canvas API that allows you to pass the TextMetrics object returned by measure_text() to fill_text() and/or stroke_text() to draw the measured text without laying it out again. It improves performance on the canvas_nanovg demo.

pcwalton commented 4 years ago

@bors-servo: r+

bors-servo commented 4 years ago

:pushpin: Commit 75a9e5d has been approved by pcwalton

bors-servo commented 4 years ago

:hourglass: Testing commit 75a9e5da57a6cd1095b203989d34616e8c9d2a94 with merge 654dc99ad1a48452f88d3d6ea581aaa21e2c9329...

bors-servo commented 4 years ago

:broken_heart: Test failed - checks-travis

pcwalton commented 4 years ago

@bors-servo: r+

bors-servo commented 4 years ago

:pushpin: Commit d01bc5d has been approved by pcwalton

bors-servo commented 4 years ago

:hourglass: Testing commit d01bc5d002eafb3ccc7cc6209ac6f1f27fe1d4de with merge ca201ac0c88e0e84fd71d22e999e1d148445fe1f...

bors-servo commented 4 years ago

:sunny: Test successful - checks-travis Approved by: pcwalton Pushing ca201ac0c88e0e84fd71d22e999e1d148445fe1f to master...