Skip to content

WIP: Fontations glyph rasterization backend #4869

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

Closed
wants to merge 4,365 commits into from
Closed

WIP: Fontations glyph rasterization backend #4869

wants to merge 4,365 commits into from

Conversation

nicoburns
Copy link

This is a work-in-progress implementation of a wr_glyph_rasterizer backend that uses skrifa and vello_cpu for rasterization.

nical and others added 30 commits October 14, 2024 16:27
And make get_target_texture work with texture cache location.

Differential Revision: https://phabricator.services.mozilla.com/D225225
…lzman

This is necessary to export some Angle EGL extensions that are
used by the upcoming compositor changes.

Differential Revision: https://phabricator.services.mozilla.com/D227277
…s,gw

This patch moves the clearing code into its own function and attempts to make the logic a bit easier to understand and reason about.

Differential Revision: https://phabricator.services.mozilla.com/D226613
In the most common case (non-cached picture tasks) the specific rect will be skipped in favor of the global clear, however cached picture tasks need a specific clear rect.

Differential Revision: https://phabricator.services.mozilla.com/D226615
…lzman

This is necessary to export some Angle EGL extensions that are
used by the upcoming compositor changes.

Differential Revision: https://phabricator.services.mozilla.com/D227277
…x-reviewers,taskgraph-reviewers,jmaher,aosmond

Newer devices often only support aarch64 binaries, and we no longer
run on any 32bit devices in CI, so switch the default build
architecture. Developers will still be able to build arm7 binaries if
required for local testing.

Differential Revision: https://phabricator.services.mozilla.com/D227514
… Xclipse GPUs r=gfx-reviewers,aosmond

Xclipse GPUs appear render the diagonal linear gradient in this test
case at a slightly different scale than in its reference. This issue
is hardware-specific and unrelated to the bug that the test case is
designed to test.

This patch reworks the test case to use a horizontal linear gradient,
avoiding this issue. The underlying cause will be investigated and
fixed in bug 1928323.

Differential Revision: https://phabricator.services.mozilla.com/D227515
…=gfx-reviewers,aosmond

Currently we use glutin's GlRequest::GlThenGles when creating a GL
context. This first attempts to select bind the OpenGL API using
eglBindAPI, falling back to the OpenGL ES API if that fails.

Some Android devices (eg those with Xclipse GPUs) successfully allow
binding the OpenGL API, only for eglChooseConfig to subsequently
return zero available configs. This means using GlThenGles always
results in failure to create a GL context.

To avoid this, this patch makes us specifically request a GLES context
by default on Android. Note that this can still be overridden for
local testing using wrench's --renderer command line argument.

Differential Revision: https://phabricator.services.mozilla.com/D227516
…wers,aosmond

On Xclipse GPUs glGetDebugMessageLog() sometimes returns a larger
count that the count provided as its first argument. This results in
an index out of bounds panic inside gleam's get_debug_messages()
wrapper.

Differential Revision: https://phabricator.services.mozilla.com/D227517
… A55 and Pixel 6. r=gfx-reviewers,taskgraph-reviewers,jmaher,aosmond

Differential Revision: https://phabricator.services.mozilla.com/D227518
…lzman

This is necessary to export some Angle EGL extensions that are
used by the upcoming compositor changes.

Differential Revision: https://phabricator.services.mozilla.com/D227277
The logic is similar to the render task cache with important differences:
 - If the function is called the tasks are always rendered (no check
   whether a previous frame already produced the image).
 - Since we want to associate the TextureCacheHandle with an ImageKey,
   to render it via a image items, the handle is managed by the resource
   cache rather than the render task cache.

Differential Revision: https://phabricator.services.mozilla.com/D227370
… r=gfx-reviewers,gw

This is done in order to untangle a borrow-checker knot and make it possible to call it from the closure in ResourceCache::render_as_image.

Differential Revision: https://phabricator.services.mozilla.com/D227371
…OSED TREE

Backed out changeset d519011c078b (bug 1921980)
Backed out changeset 46b1ed75bb19 (bug 1921980)
Backed out changeset b14169d1c137 (bug 1921980)
Backed out changeset 877f329b665d (bug 1921980)
Backed out changeset bb7a2635293a (bug 1921980)
Backed out changeset 1fcd83380d56 (bug 1921980)
The logic is similar to the render task cache with important differences:
 - If the function is called the tasks are always rendered (no check
   whether a previous frame already produced the image).
 - Since we want to associate the TextureCacheHandle with an ImageKey,
   to render it via a image items, the handle is managed by the resource
   cache rather than the render task cache.

Differential Revision: https://phabricator.services.mozilla.com/D227370
… r=gfx-reviewers,gw

This is done in order to untangle a borrow-checker knot and make it possible to call it from the closure in ResourceCache::render_as_image.

Differential Revision: https://phabricator.services.mozilla.com/D227371
Butkovits Atila and others added 28 commits April 15, 2025 19:16
…tributionDistribution.js. CLOSED TREE

Backed out changeset ab33904d0edb (bug 1955429)
Backed out changeset abdbe82d2cc1 (bug 1955429)
Backed out changeset eba2fd65a5cf (bug 1955429)
Backed out changeset e0aa301f9301 (bug 1955429)
…D TREE

Backed out changeset 8793ee7ac873 (bug 1955429)
Backed out changeset e1cf811b7274 (bug 1955429)
Backed out changeset 79bf1547f82b (bug 1955429)
Backed out changeset c451dfbfb59f (bug 1955429)
…'s parent clip. r=gw

Currently if all children of a picture share a clip, the clip is hoisted out of the children to be applied to the picture as a composite mode. This prevents the clip from being backed into the picture which snapshots rely on.
This patch works around this by enforcing that the clip root of a snapshotted picture is always the parent clip node of the picture's clip. The intent is to always discard parent clips when rendering the snapshot, while never hoisting child clips out of the snapshot.

Differential Revision: https://phabricator.services.mozilla.com/D245086
…es . CLOSED TREE

Backed out changeset c559fb92573e (bug 1957880)
Backed out changeset 79ae9de06c34 (bug 1957880)
Backed out changeset 18ffb81884ca (bug 1957880)
Backed out changeset 5561a18254dd (bug 1957880)
…ition r=jgilbert,gfx-reviewers,ahale

This also adds the plumbing for implementing the rounded compositor
clip in CoreAnimation and SWGL compositors, though they will be
implemented in follow up patches.

Differential Revision: https://phabricator.services.mozilla.com/D245166
…@ widget/tests/test_bug343416.xhtml CLOSED TREE

Backed out changeset 3fd7b7cba0ff (bug 1955429)
Backed out changeset d771f40c809c (bug 1955429)
Backed out changeset 98fe0042de25 (bug 1955429)
Backed out changeset f239ffd8098f (bug 1955429)
Backed out changeset a49202330c21 (bug 1955429)
…'s parent clip. r=gw

Currently if all children of a picture share a clip, the clip is hoisted out of the children to be applied to the picture as a composite mode. This prevents the clip from being backed into the picture which snapshots rely on.
This patch works around this by enforcing that the clip root of a snapshotted picture is always the parent clip node of the picture's clip. The intent is to always discard parent clips when rendering the snapshot, while never hoisting child clips out of the snapshot.

Differential Revision: https://phabricator.services.mozilla.com/D245086
…e-element-right-and-left-of-viewport-partially-onscreen-old.html CLOSED TREE
…'s parent clip. r=gw

Currently if all children of a picture share a clip, the clip is hoisted out of the children to be applied to the picture as a composite mode. This prevents the clip from being backed into the picture which snapshots rely on.
This patch works around this by enforcing that the clip root of a snapshotted picture is always the parent clip node of the picture's clip. The intent is to always discard parent clips when rendering the snapshot, while never hoisting child clips out of the snapshot.

Differential Revision: https://phabricator.services.mozilla.com/D245086
…iewers,gw

This patch is a preliminary refactoring to make it simpler to pass additional information to the C++ side and should not affect behavior.
In a followup patch the widget glue will have special handling for frames that need to be rendered but not presented.

Differential Revision: https://phabricator.services.mozilla.com/D245564
…endered immediately. r=gfx-reviewers,lsalzman

In addition, rename NotifyDidSceneBuild into ScheduleFrameAfterSceneBuild. Right now it is only used for that purpose but it would cause issues if we start relying on it to be called after all scene builds since with this patch we won't call it if we do not need a new frame.

Differential Revision: https://phabricator.services.mozilla.com/D245898
…SED TREE

Backed out changeset 272e5fda747a (bug 1961115)
Backed out changeset 9f795cb0c6ae (bug 1961115)
Backed out changeset 12836f4f3c36 (bug 1961115)
…iewers,gw

This patch is a preliminary refactoring to make it simpler to pass additional information to the C++ side and should not affect behavior.
In a followup patch the widget glue will have special handling for frames that need to be rendered but not presented.

Differential Revision: https://phabricator.services.mozilla.com/D245564
…endered immediately. r=gfx-reviewers,lsalzman

In addition, rename NotifyDidSceneBuild into ScheduleFrameAfterSceneBuild. Right now it is only used for that purpose but it would cause issues if we start relying on it to be called after all scene builds since with this patch we won't call it if we do not need a new frame.

Differential Revision: https://phabricator.services.mozilla.com/D245898
This is only run on Linux currently in Gecko, so we do the same
thing downstream.
These APIs are still used by Servo, so keep them around until Servo
can migrate off of them.
Also derive Deserialize and Serialize for serde, not just for the
capture and replay features.

Co-authored-by: Martin Robinson <[email protected]>
Signed-off-by: Oriol Brufau <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.