Skip to content

[WebParagraph] Improve WebParagraph's handling of CTM (current transform matrix) #188025

Description

@mdebbar

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: typographyText rendering, possibly libtxtengineflutter/engine related. See also e: labels.platform-webWeb applications specificallyteam-webOwned by Web platform teamtriaged-webTriaged by Web platform team

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions