merge_pr_48654
Remove TextCluster caching in TextMetrics
In a previous CL, the getTextClusters() API was implemented with a cache
for the created TextCluster objects. This API may include as a parameter
a dictionary with text align and baseline options. Since the cache is
used if it was already calculated, subsequent calls with different
options return clusters in the wrong positions.
This CL removes this cache to guarantee that the results are always
calculated from scratch taking into account the current options passed
Tests were added using the CanvasTest font to check that the positions
are coherent with the options passed.
A future CL with reincorporate this cache in a way that allows
offsetting the stored clusters following the current align and
baseline options passed.
Bug: 341213359
Change-Id: I4cabdb62d05a9c8763300c0d268d7794ca9f160b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5933690
Reviewed-by: Jean-Philippe Gravel [email protected]
Commit-Queue: Andres Ricardo Perez [email protected]
Cr-Commit-Position: refs/heads/main@{#1369650}