Because WebParagraph uses (and caches) an image to render the paragraph, there are a few issues with regards to CTM that need to be addressed:
1. New image when CTM changes
Currently, WebParagraph.paint creates a new image only when the paragraph was re-laid out or the device pixel ratio is different.
We need to do the same when CTM is different. See this comment for how the native engine does it.
2. Listen to CTM changes and trigger a paragraph paint
As of #186968, paragraphs on the web are repainted every time the device pixel ratio changes. This ensures the paragraph produces a new image at the new DPR.
But we aren't listening to CTM changes, which means a paragraph may not have the opportunity to re-create the image when CTM has changed. See this comment for an idea on how to use composition callbacks to achieve this.
Because WebParagraph uses (and caches) an image to render the paragraph, there are a few issues with regards to CTM that need to be addressed:
1. New image when CTM changes
Currently,
WebParagraph.paintcreates a new image only when the paragraph was re-laid out or the device pixel ratio is different.We need to do the same when CTM is different. See this comment for how the native engine does it.
2. Listen to CTM changes and trigger a paragraph paint
As of #186968, paragraphs on the web are repainted every time the device pixel ratio changes. This ensures the paragraph produces a new image at the new DPR.
But we aren't listening to CTM changes, which means a paragraph may not have the opportunity to re-create the image when CTM has changed. See this comment for an idea on how to use composition callbacks to achieve this.