This new approach to weak references is roughly modeled after the approach used
by Rust's Arc<T>, and uses an atomic compare-and-swap loop to perform weak to
strong reference upgrades. This approach ends up moving the strong reference
count out of the tracked object and into the weak reference object, as the
strong reference count atomic needs to outlife the object itself.
Rust's Arc Weak::upgrade implementation:
d98d2f57d9/library/alloc/src/sync.rs (L1806-L1837)
Differential Revision: https://phabricator.services.mozilla.com/D102245
This new approach to weak references is roughly modeled after the approach used
by Rust's Arc<T>, and uses an atomic compare-and-swap loop to perform weak to
strong reference upgrades. This approach ends up moving the strong reference
count out of the tracked object and into the weak reference object, as the
strong reference count atomic needs to outlife the object itself.
Rust's Arc Weak::upgrade implementation:
d98d2f57d9/library/alloc/src/sync.rs (L1806-L1837)
Differential Revision: https://phabricator.services.mozilla.com/D102245
It doesn't matter that much which backend we choose
here but the rest of the content is likely using Skia
so we might as well be consistent.
Differential Revision: https://phabricator.services.mozilla.com/D103719
This uses SkDraw::ComputeResScaleForStroking to ensure we exactly match the resolution scale
that is chosen for drawing the stroked path inside the guts of Skia. This should ensure these
two don't get out of sync.
This also cleans out the old overscale code in ComputeResScaleForStroking that was necessary
during an ancient Skia porting effort but has now bitrotted into irrelevance.
Differential Revision: https://phabricator.services.mozilla.com/D101686
This greatly improves non-native theme on Windows in presence of fractional DPI
(see bug 1657191).
This matches what the Windows native theme does, to my knowledge, see
ScaleForFrameDPI in nsNativeThemeWin.h.
However I think the right fix is to not make these LayoutDeviceInt* things but
LayoutDevice*.
That's a bigger fix, and fits well as a follow-up to this bug, so let's land
this in the meantime.
Differential Revision: https://phabricator.services.mozilla.com/D97937
The listed fonts are individual faces, not font families. Since the face name
comes from a PostScript name, we'll use the label "psname".
Differential Revision: https://phabricator.services.mozilla.com/D97664
We don't cache the url, but we do report the "family=" preface, and we respect
the anonymizer flag in the same way that user-fonts are reported.
Differential Revision: https://phabricator.services.mozilla.com/D96643
This is a preparation of the next part.
Technically, we only need the nsSize's two-argument constructor and
BaseCoord's operator* to be 'constexpr', but for the sake of
completeness, I also make all other BaseCoord's methods 'constexpr'.
Differential Revision: https://phabricator.services.mozilla.com/D96257
Any CT "Create" method returns an owned object. This ensures that owned
objects are deallocated when the font fails to be crated. It also prevents
unused font data from being entered into the font data set (where it would
never be deallocated).
Differential Revision: https://phabricator.services.mozilla.com/D96121
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.
To produce this patch I did all of the following:
1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.
2. Run ./mach lint --linter black --fix
3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.
4. Make some ad-hoc manual updates to `testing/marionette/client/setup.py`, `testing/marionette/harness/setup.py`, and `testing/firefox-ui/harness/setup.py`, which have hard-coded regexes that break after the reformat.
5. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).
# ignore-this-changeset
Differential Revision: https://phabricator.services.mozilla.com/D94045
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.
To produce this patch I did all of the following:
1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.
2. Run ./mach lint --linter black --fix
3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.
4. Make some ad-hoc manual updates to `testing/marionette/client/setup.py`, `testing/marionette/harness/setup.py`, and `testing/firefox-ui/harness/setup.py`, which have hard-coded regexes that break after the reformat.
5. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).
# ignore-this-changeset
Differential Revision: https://phabricator.services.mozilla.com/D94045
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.
To produce this patch I did all of the following:
1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.
2. Run ./mach lint --linter black --fix
3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.
4. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).
# ignore-this-changeset
Differential Revision: https://phabricator.services.mozilla.com/D94045
This is a follow up from bug 1668377. It changes
some function names, comments and removes the factory
method.
The WrapAndRecord target is still used by the global recording
stuff so I've kept it for now.
Differential Revision: https://phabricator.services.mozilla.com/D92777
Previously we weren't setting any format on these surfaces (despite the inputs being BGRA), and GetFormat was hitting the default: case to return RGBA.
CGLTexImageIOSurface2D binds these with a format of GL_BGRA, but an internal format of GL_RGBA, which is why returning RGBA from GetFormat was sometimes useful.
We return a format of RGBA as an outparam when binding to a texture, so this changes the callers that really want the GL internal format to use that rather than GetFormat.
Depends on D93610
Differential Revision: https://phabricator.services.mozilla.com/D93611