Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@gw280
Copy link
Contributor

@gw280 gw280 commented Feb 19, 2022

It turns out that with drawTextBlob it's more important to consider the number of times it was called during a single frame rather than the number of glyphs in the drawTextBlob. This seems to be because drawTextBlob calls are deferred and batched if possible, thus we only pay the (high) upfront cost once or a few times instead of every time.

This tweaks the benchmark so that we are measuring the impact of multiple drawTextBlob calls, and also updates the calculators to use data gathered from the new benchmark instead. This also involved a minor refactoring to better cater to "batched complexities" like saveLayer and drawTextBlob.

There is more work to be done here, at a minimum we'd need to consider the following:

  • How is batching affected by other draw ops interspersed between the drawTextBlob calls?
  • Does the font matter? Note: if it is, this is not easily actionable right now as we have no way to determine the font being used at calculation time.
  • How does the glyph count vary things Note: as with the font, we have no way to determine glyph count either.

Pre-launch Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I read and followed the [Flutter Style Guide] and the [C++, Objective-C, Java style guides].
  • I listed at least one issue that this PR fixes in the description above.
  • I added new tests to check the change I am making or feature I am adding, or Hixie said the PR is test-exempt. See [testing the engine] for instructions on
    writing and running engine tests.
  • I updated/added relevant documentation (doc comments with ///).
  • I signed the [CLA].
  • All existing and new tests are passing.

@gw280 gw280 requested review from flar and zanderso February 19, 2022 01:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants