Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync changes from mozilla-central gfx/wr #4011

Merged
merged 4 commits into from Jul 11, 2020
Merged

Conversation

@moz-gfx
Copy link

moz-gfx commented Jul 11, 2020

No description provided.

jamienicol and others added 4 commits Jul 11, 2020
…batching. r=lsalzman

When adding a text run to a batch, we split the text run in to contiguous
runs of glyphs which can be batched together. For example, when a glyph is
encountered mid-run with a different glyph format or that is cached in a
different texture, then it must be batched separately than the preceeding
glyphs.

However, even though we are only batching sub-runs of glyphs together, we use
the entire text run's bounding rect as the bounds we pass to
`set_params_and_get_batch()`. This means that each sub-run of glyphs that are
batched together will be forced to create an entirely new batch rather than
reuse an existing one (because their bounds will definitely overlap.)

This can have catastrophic consequences on performance. When the texture cache
is full enough that we have allocated a second or greater texture array, then we
risk having text runs with glyphs fragmented over different textures. This can
easily lead to thousands of draw calls on simple but text-heavy pages.

The solution is to calculate the bounds of just the sub-run of glyphs that are
being batched together, and use that instead of the text run's bounds.

Differential Revision: https://phabricator.services.mozilla.com/D83070

[ghsync] From https://hg.mozilla.org/mozilla-central/rev/5cee93aa5199068b93a13eedd940bf1a3af57011
This should fix a crash caused by an unexpected pixel type.

Differential Revision: https://phabricator.services.mozilla.com/D83167

[ghsync] From https://hg.mozilla.org/mozilla-central/rev/b850773b54e129888b8fb2f1e3bc68f528aeccbf
@moz-gfx
Copy link
Author

moz-gfx commented Jul 11, 2020

@bors-servo r=auto

@bors-servo
Copy link
Contributor

bors-servo commented Jul 11, 2020

📌 Commit 097bcbb has been approved by auto

@bors-servo
Copy link
Contributor

bors-servo commented Jul 11, 2020

Testing commit 097bcbb with merge d1fbed7...

@bors-servo
Copy link
Contributor

bors-servo commented Jul 11, 2020

☀️ Test successful - status-taskcluster
Approved by: auto
Pushing d1fbed7 to master...

@bors-servo bors-servo merged commit d1fbed7 into servo:master Jul 11, 2020
2 checks passed
2 checks passed
Community-TC (pull_request) TaskGroup: success
Details
homu Test successful
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants
You can’t perform that action at this time.