Commit Graph

2877 Commits

Author SHA1 Message Date
Jonathan Kew
248af00296 Bug 1690235 - Don't use a font descriptor for variation fonts on systems before macOS 10.15. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D103916
2021-02-03 17:25:19 +00:00
Nika Layzell
f07fc1f61f Bug 1687391 - Avoid using a spinlock in ThreadSafeWeakReference, r=glandium,mccr8,Gankra,sg
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
2021-02-03 17:00:04 +00:00
Bogdan Tara
369c9ff89b Backed out changeset cf95a79e64f6 (bug 1687391) for bustges complaining about ThreadSafeWeakPtr CLOSED TREE 2021-02-03 18:39:22 +02:00
Nika Layzell
33d14ac4a6 Bug 1687391 - Avoid using a spinlock in ThreadSafeWeakReference, r=glandium,mccr8,Gankra,sg
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
2021-02-03 16:16:44 +00:00
Jeff Muizelaar
99178037ee Bug 1690124 - Use Skia instead of Cairo for FilterNodeSoftware. r=mstange
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
2021-02-01 22:14:55 +00:00
Jonathan Kew
0c3e079a73 Bug 1686559 - Add null-checks for API calls that may be fallible. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D101744
2021-01-14 13:57:00 +00:00
Lee Salzman
caa9cd4f4d Bug 1684050 - choose appropriate stroke res scale for PathSkia::StrokeContainsPoint. r=bobowen
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
2021-01-14 09:01:54 +00:00
longsonr
f518393a92 Bug 1518099 - Add support for lighter operator in feComposite r=jrmuizel,emilio
Spec: https://www.w3.org/TR/filter-effects-1/#attr-valuedef-operator-lighter

Lighter is defined in the compositing & blending spec as equivalent to porter-duff plus, https://www.w3.org/TR/compositing-1/#porterduffcompositingoperators_plus.

The 'lighter' composite mode already works in <canvas> (via globalCompositeOperation), and it's the same there.

Chrome implemented support in https://bugs.chromium.org/p/chromium/issues/detail?id=439037

Per https://github.com/w3c/svgwg/issues/424 we should expose the new value in webidl and Chrome uses 7 too (https://codereview.chromium.org/779963002/patch/120001/130009)

Differential Revision: https://phabricator.services.mozilla.com/D100605
2021-01-05 20:49:00 +00:00
Lee Salzman
43221d6fd5 Bug 1663703 - only allow PathD2D::ContainsPoint to proceed if transform is invertible. r=bobowen
Differential Revision: https://phabricator.services.mozilla.com/D99177
2020-12-09 12:03:11 +00:00
Lee Salzman
07faffeb7b Bug 1677301 - try to catch exceptions while reading font file data in ScaledFontDWrite. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D99179
2020-12-09 10:41:34 +00:00
Markus Stange
9f04a709db Bug 1677854 - Bail out early in EnsureValidPremultipliedData if the text is offscreen. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D98257
2020-11-30 23:15:15 +00:00
Emilio Cobos Alvarez
ab2154bd1b Bug 1679208 - Improve non-native theme with fractional scaling. r=heycam
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
2020-11-30 04:48:07 +00:00
Simon Giesecke
dd80614fa0 Bug 1678062 - Remove unnecessary includes. r=andi
Differential Revision: https://phabricator.services.mozilla.com/D97467

Depends on D96561
2020-11-23 16:12:02 +00:00
Simon Giesecke
971b645fe3 Bug 1660470 - Add missing include directives/forward declarations. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D87865
2020-11-23 16:21:38 +00:00
Brad Werth
71e1c9396d Bug 1678427: Use a more precise label for native-font-resource-mac fonts. r=jfkthame
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
2020-11-19 20:27:09 +00:00
Brad Werth
d25cb8d593 Bug 1625590 Part 3: Make UnscaledFontGDI::GetFontDescriptor unilaterally return false. r=jrmuizel
Depends on D96478

Differential Revision: https://phabricator.services.mozilla.com/D97619
2020-11-19 17:01:54 +00:00
Brad Werth
7bd4cba91e Bug 1625590 Part 2: Make ScaledFontDWrite::GetFontFileName include the null terminator in the returned file name. r=jrmuizel
This ensures that CreateFromFontDescriptor gets the null-terminated WCHAR
that it expects.

Differential Revision: https://phabricator.services.mozilla.com/D96478
2020-11-19 16:59:31 +00:00
Brad Werth
295b2ec8d4 Bug 1625590 Part 1: Make DrawTargetRecording::FillGlyphs prefer sending font description over font data. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D96274
2020-11-19 00:45:46 +00:00
coderboncuk
c8b12f5aa2 Bug 1676299 - Removed the xMajor parameter from BaseMatrix::ScaleFactors() r=botond
Differential Revision: https://phabricator.services.mozilla.com/D97449
2020-11-18 18:53:01 +00:00
Sylvestre Ledru
bebb9f9181 Bug 1519636 - Reformat with clang-format-11 to the Google coding style r=andi,sg,geckoview-reviewers,snorp
It is bringing some minor changes

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D90795
2020-11-18 09:05:59 +00:00
Jonathan Kew
f053766b81 Bug 1617520 - Check for failure when creating default dwrite rendering params. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D97005
2020-11-13 20:04:52 +00:00
Lee Salzman
375f1764b4 Bug 1676257 - make SourceSurfaceSkia's draw target pointer atomic. r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D96780
2020-11-12 02:30:53 +00:00
Brad Werth
a68bdd9d7c Bug 1676255 Part 1: Make NativeFontResourceMacReporter::CollectReports match the user-fonts report. r=jrmuizel
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
2020-11-10 22:31:34 +00:00
Brad Werth
d1844db20a Bug 1675854 Part 2: Use AutoRelease in ScaledFontMac::GetFontDescriptor. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D96456
2020-11-09 20:38:11 +00:00
Ting-Yu Lin
b371960b3f Bug 1675852 Part 1 - Mark more methods 'constexpr' in BaseCoord and nsSize. r=emilio
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
2020-11-06 22:22:02 +00:00
Jeff Muizelaar
72068a66b2 Bug 1675906 - Add more crashes when we don't find a Factory. r=jfkthame
Unlikely, but we might as well keep narrowing this down.

Differential Revision: https://phabricator.services.mozilla.com/D96303
2020-11-09 11:57:30 +00:00
Brad Werth
5d00ad647a Bug 1675854: Make ScaledFontMac::GetFontDescriptor release the psname reference before returning. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D96260
2020-11-06 21:36:08 +00:00
Brad Werth
d95911267d Bug 1674868 Part 3: Make NativeFontResourceMacReporter report each native font by name. r=jrmuizel
If there is no font name stored, this reports "Unknown(#)" with the index of
the font in the map.

Depends on D96122

Differential Revision: https://phabricator.services.mozilla.com/D96123
2020-11-06 18:53:07 +00:00
Brad Werth
f0623db64c Bug 1674868 Part 2: Make NativeFontResourceMac store native font names alongside raw font data. r=jrmuizel
This moves from unordered_set to unordered_map to accommodate storing the font
name alongside the font data.

Differential Revision: https://phabricator.services.mozilla.com/D96122
2020-11-06 18:52:58 +00:00
Brad Werth
e052665280 Bug 1674868 Part 1: Prevent memory leaks in NativeFontResourceMac::Create when font creation fails. r=jrmuizel
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
2020-11-06 16:27:32 +00:00
Sylvestre Ledru
9bfd4073b2 Bug 1519636 - Reformat recent changes to the Google coding style r=andi
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D95434
2020-11-04 18:46:00 +00:00
Ting-Yu Lin
8cd9090bc6 Bug 1674863 Part 2 - Use strong types to define fallback intrinsic width, height, and size. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D95578
2020-11-03 19:54:44 +00:00
Matt Woodrow
31bb79f3a4 Bug 1660236 - Hold mutex while accessing shared SkImage data. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D93442
2020-10-29 17:19:52 +00:00
tobar2018
d7a64d8211 Bug 1673051 - Remove OnYosemiteOrLater(), OnElCapitanOrLater(), and OnSierraOrLater(). r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D95304
2020-11-02 16:25:18 +00:00
Jeff Muizelaar
9678494ff8 Bug 1674175 - Add a memory reporter for memory allocated in NativeFontResourceMac::Create. r=mstange
It's very hard for us to encourage the system to free this memory so we
should make sure we report it.

Differential Revision: https://phabricator.services.mozilla.com/D95233
2020-10-30 00:29:55 +00:00
Ricky Stewart
02a7b4ebdf Bug 1654103: Standardize on Black for Python code in mozilla-central.
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
2020-10-26 18:34:53 +00:00
Bogdan Tara
da1098d4aa Backed out 10 changesets (bug 1654103, bug 1672023, bug 1518999) for PanZoomControllerTest.touchEventForResult gv-junit failures CLOSED TREE
Backed out changeset ff3fb0b4a512 (bug 1672023)
Backed out changeset e7834b600201 (bug 1654103)
Backed out changeset 807893ca8069 (bug 1518999)
Backed out changeset 13e6b92440e9 (bug 1518999)
Backed out changeset 8b2ac5a6c98a (bug 1518999)
Backed out changeset 575748295752 (bug 1518999)
Backed out changeset 65f07ce7b39b (bug 1518999)
Backed out changeset 4bb80556158d (bug 1518999)
Backed out changeset 8ac8461d7bd7 (bug 1518999)
Backed out changeset e8ba13ee17f5 (bug 1518999)
2020-10-24 03:36:18 +03:00
Markus Stange
3eaf2c04d4 Bug 1346601 - Set surfaceRect to empty when surface becomes null. r=bas
Differential Revision: https://phabricator.services.mozilla.com/D94600
2020-10-23 22:33:14 +00:00
Ricky Stewart
c0cea3b0fa Bug 1654103: Standardize on Black for Python code in mozilla-central. r=remote-protocol-reviewers,marionette-reviewers,webdriver-reviewers,perftest-reviewers,devtools-backward-compat-reviewers,jgilbert,preferences-reviewers,sylvestre,maja_zf,webcompat-reviewers,denschub,ntim,whimboo,sparky
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
2020-10-23 20:40:42 +00:00
Dorel Luca
1ff59cb7a3 Backed out changeset 7558c8821a07 (bug 1654103) for multiple failures. CLOSED TREE 2020-10-22 03:51:06 +03:00
Ricky Stewart
50762dacab Bug 1654103: Standardize on Black for Python code in mozilla-central. r=remote-protocol-reviewers,marionette-reviewers,webdriver-reviewers,perftest-reviewers,devtools-backward-compat-reviewers,jgilbert,preferences-reviewers,sylvestre,maja_zf,webcompat-reviewers,denschub,ntim,whimboo,sparky
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
2020-10-21 21:27:27 +00:00
Jeff Muizelaar
7c1391669a Bug 1669740 - Cleanup some WrapAndRecord usage. r=aosmond
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
2020-10-21 15:09:22 +00:00
Jeff Muizelaar
ab92c3225f Bug 1672088. Avoid creating CTFonts from CGFonts when using NativeFontResourceMac. r=lsalzman
This has the same motivation as bug 1672088.

Differential Revision: https://phabricator.services.mozilla.com/D94062
2020-10-20 15:48:26 +00:00
Matt Woodrow
b9ceca1cff Bug 1671061 - Pad IOSurface allocations for SWGL since it reads in chunks of 4 pixels. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D93612
2020-10-20 01:22:09 +00:00
Matt Woodrow
4f5c20e117 Bug 1671061 - Set BGRA format on IOSurfaces. r=mstange
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
2020-10-19 22:27:23 +00:00
Matt Woodrow
9762081463 Bug 1671061 - Refactor IOSurface creation code to use shared helpers. r=mstange
This shouldn't have any behaviour changes, just removes some code duplication.

Differential Revision: https://phabricator.services.mozilla.com/D93610
2020-10-19 22:27:22 +00:00
Jeff Muizelaar
2909b283eb Bug 1671967 - Rely on mCTFont being set. r=lsalzman
Now that we always use CTFontDrawGlyphs we can just
rely on having a CTFont.

Differential Revision: https://phabricator.services.mozilla.com/D94032
2020-10-19 16:29:47 +00:00
Jeff Muizelaar
0440c26f3d Bug 1671963 - Always use CTFontDrawGlyphs. r=lsalzman
CTFontDrawGlyphs has been around since 10.7

Differential Revision: https://phabricator.services.mozilla.com/D94029
2020-10-19 15:59:02 +00:00
Cameron McCormack
0534c6ad1a Bug 1670853 - Support scrollbar-color and scrollbar-width on cross-platform and Linux non-native theme. r=spohl
Differential Revision: https://phabricator.services.mozilla.com/D93307
2020-10-15 04:54:41 +00:00
Razvan Maries
8d3a29c27b Backed out 4 changesets (bug 1670694, bug 1670853, bug 1669368, bug 1670145) for build bustages on nsNativeBasicTheme.h. CLOSED TREE
Backed out changeset fcb1b57645e0 (bug 1669368)
Backed out changeset 6ac5b674c3b6 (bug 1670853)
Backed out changeset 913fd041e5dd (bug 1670145)
Backed out changeset 89504c0fb0cd (bug 1670694)
2020-10-15 07:45:35 +03:00