Commit Graph

3264 Commits

Author SHA1 Message Date
Emilio Cobos Álvarez
c25b3b246f Bug 1862061 - Remove -moz-font-smoothing-background-color. r=gfx-reviewers,desktop-theme-reviewers,devtools-reviewers,dao,gw
See comments in the bug for reasoning. macOS hasn't used subpixel AA for
quite a while.

Emulating this macOS AA on vibrant backgrounds was the only point of
this feature.

This allows to simplify the WebRender code quite a bit, too.

Differential Revision: https://phabricator.services.mozilla.com/D192311
2023-11-01 09:14:29 +00:00
Timothy Nikkel
11d085b63c Bug 1860763. Expand workaround for d2d arcs that are full circles slightly. r=gfx-reviewers,lsalzman
The other check for (close to) full circle arcs lower down in this function

https://searchfox.org/mozilla-central/rev/01a0d864a9442d0fe2dbd4beee5c88b9b46e96bd/gfx/2d/PathD2D.cpp#221

does not catch the testcase from this bug: the start and end points are just barely far enough away.

It only makes sense that if we are changing all arcs >= 2*Pi to 1.9999*Pi that we should also change arcs between 1.9999*Pi and 2*Pi, and that fixes this bug.

I also added some instructions to the wpt canvas tests gentest.py file, which I didn't find anywhere else.

Differential Revision: https://phabricator.services.mozilla.com/D192414
2023-11-01 04:05:29 +00:00
Boris Chiou
f57dc3a741 Bug 1855756 - Fix the edge cases when the angle is 0deg (or 90deg) for ray(). r=hiro
It looks like our formula doesn't work well for 0deg and 90deg because
it's not a triangle when theta is 0deg or 90deg. So we handle them
separately.

Differential Revision: https://phabricator.services.mozilla.com/D191495
2023-10-20 03:41:10 +00:00
Sylvestre Ledru
1e776756dd Bug 1856795 - ride along: use = default; on some recently modified files r=emilio
More on:
https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-equals-default.html

Command:
L=$(hg export -r tip|grep +++|cut -d/ -f2-)
./mach static-analysis check --checks="-*, modernize-use-equals-default" --fix $L

Differential Revision: https://phabricator.services.mozilla.com/D191016
2023-10-15 15:29:03 +00:00
Sylvestre Ledru
d0f6c7fc66 Bug 1856795 - Remove redundant member init r=emilio
Done with:
./mach static-analysis check --checks="-*, readability-redundant-member-init" --fix .

https://clang.llvm.org/extra/clang-tidy/checks/readability/redundant-member-init.html

Differential Revision: https://phabricator.services.mozilla.com/D190002
2023-10-15 15:29:02 +00:00
Cristina Horotan
6a90f5eded Backed out 2 changesets (bug 1856795) for causing build bustage at BasicEvents.h CLOSED TREE
Backed out changeset 1d98b028923a (bug 1856795)
Backed out changeset eae2ac93e17c (bug 1856795)
2023-10-14 21:42:14 +03:00
Sylvestre Ledru
c164bd9937 Bug 1856795 - ride along: use = default; on some recently modified files r=emilio
More on:
https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-equals-default.html

Command:
L=$(hg export -r tip|grep +++|cut -d/ -f2-)
./mach static-analysis check --checks="-*, modernize-use-equals-default" --fix $L

Differential Revision: https://phabricator.services.mozilla.com/D191016
2023-10-14 17:34:27 +00:00
Sylvestre Ledru
cc8a0ee742 Bug 1856795 - Remove redundant member init r=emilio
Done with:
./mach static-analysis check --checks="-*, readability-redundant-member-init" --fix .

https://clang.llvm.org/extra/clang-tidy/checks/readability/redundant-member-init.html

Differential Revision: https://phabricator.services.mozilla.com/D190002
2023-10-14 17:34:26 +00:00
Jonathan Kew
b521628b5f Bug 1803406 - Backout 2 changesets (6a82f1f120aa, 87d83c56fbe5) due to regression reported in bug 1858869.
Differential Revision: https://phabricator.services.mozilla.com/D190908
2023-10-13 08:32:56 +00:00
Jonathan Kew
5032f4321e Bug 1803406 - Ensure consistent font lists across macOS processes, and use the kCTFontOptionsPreferSystemFont option when instantiating Core Text fonts. r=gfx-reviewers,lsalzman
This aims to avoid conflicts with user-installed fonts that shadow system fonts,
where there is a risk that different processes end up using different, incompatible
versions of "the same" font (i.e. they resolve the same font descriptor to different
resources).

Differential Revision: https://phabricator.services.mozilla.com/D170286
2023-10-12 11:54:08 +00:00
Jonathan Kew
bef8902ad1 Bug 1856035 - Rework the management of font variation settings across CoreGraphics and CoreText font instances, on macOS 13 and later only. r=gfx-reviewers,lsalzman
The new approach works on Ventura and Sonoma, but appears to regress behavior on some
earlier releases, so put it behind a runtime version check.

Once we no longer support pre-macOS 13 versions, we can simplify this.

Depends on D190501

Differential Revision: https://phabricator.services.mozilla.com/D190502
2023-10-10 08:21:42 +00:00
Jonathan Kew
39f2d60247 Bug 1856035 - Merge implementations of CreateCTFontFromCGFontWithVariations from gfxMacFont.cpp and 2d/ScaledFontMac.cpp (no change in behavior). r=gfx-reviewers,lsalzman
This should not change behavior, it just merges the two versions of
CreateCTFontFromCGFontWithVariations to simplify maintenance.

Depends on D190500

Differential Revision: https://phabricator.services.mozilla.com/D190501
2023-10-10 08:21:42 +00:00
Jonathan Kew
21e094be9a Bug 1856035 - Backed out changeset 57fec34232bd for regression behavior on macOS 11 and 12.
Not sure why the new implementation doesn't work on older OS versions,
but these APIs are inadequately documented and liable to change behavior
between releases. So just go with what works, as shown by testing.

Differential Revision: https://phabricator.services.mozilla.com/D190500
2023-10-09 18:53:01 +00:00
Jonathan Kew
ff399246f1 Bug 1856035 - Rework the management of font variation settings across CoreGraphics and CoreText font instances. r=gfx-reviewers,lsalzman
It appears that when a Core Text font is instantiated from a CGFont or from a font descriptor,
its optical-size setting now always gets assigned according to the font size being created,
overriding any 'opsz' variation that was already specified on the CGFont or the CTFontDescriptor.
(This seems to be a behavior change compared to older macOS versions.)

To get the desired 'opsz' setting on the Core Text font, it seems to be necessary to use
CTFontCreateCopyWithAttributes to get a modified copy of an already-existing CTFont.

Differential Revision: https://phabricator.services.mozilla.com/D190389
2023-10-08 11:56:49 +00:00
Butkovits Atila
dc4f0dd2a4 Backed out 3 changesets (bug 1803406) for causing WR bustages. CLOSED TREE
Backed out changeset 91f12411aff1 (bug 1803406)
Backed out changeset edb458dfa8b8 (bug 1803406)
Backed out changeset 9c4a875ec67d (bug 1803406)
2023-09-29 21:33:03 +03:00
Jonathan Kew
d7baedb599 Bug 1803406 - Ensure consistent font lists across macOS processes, and use the kCTFontOptionsPreferSystemFont option when instantiating Core Text fonts. r=gfx-reviewers,lsalzman
This aims to avoid conflicts with user-installed fonts that shadow system fonts,
where there is a risk that different processes end up using different, incompatible
versions of "the same" font (i.e. they resolve the same font descriptor to different
resources).

Differential Revision: https://phabricator.services.mozilla.com/D170286
2023-09-29 17:58:17 +00:00
Bob Owen
324c055150 Bug 1850983: Add check for correct format in DrawTarget::IntoLuminanceSource. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D187561
2023-09-15 17:48:14 +00:00
Bob Owen
033ddf773e Bug 1850180: Release assert on too many PopLayers in DrawTargetSkia and DrawTargetCairo. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D187470
2023-09-15 17:47:30 +00:00
Masatoshi Kimura
0f09dfdb3e Bug 1852806 - Remove macros for older Windows SDK from gfx/. r=gfx-reviewers,lsalzman
Depends on D188022

Differential Revision: https://phabricator.services.mozilla.com/D188023
2023-09-15 03:19:26 +00:00
Cosmin Sabou
f8c16a8f94 Backed out 15 changesets (bug 1852806) for causing mda failures on test_video_low_power_telemetry.html. CLOSED TREE
Backed out changeset faea1f4cb9a9 (bug 1852806)
Backed out changeset 4db93c374f9b (bug 1852806)
Backed out changeset 7e40e0e04921 (bug 1852806)
Backed out changeset b0a66c4269ce (bug 1852806)
Backed out changeset 4ff3545936f9 (bug 1852806)
Backed out changeset 02c0a8eb3fd6 (bug 1852806)
Backed out changeset ae2c7b33acfb (bug 1852806)
Backed out changeset 2b89ba254a1a (bug 1852806)
Backed out changeset dfa4f73fc548 (bug 1852806)
Backed out changeset daffcc4c1877 (bug 1852806)
Backed out changeset 33855bcdf15e (bug 1852806)
Backed out changeset 694f29707f3e (bug 1852806)
Backed out changeset 1891eda22a59 (bug 1852806)
Backed out changeset 1b854941389c (bug 1852806)
Backed out changeset 2f7cfe04be59 (bug 1852806)
2023-09-15 09:48:27 +03:00
Masatoshi Kimura
f9d563c0c9 Bug 1852806 - Remove macros for older Windows SDK from gfx/. r=gfx-reviewers,lsalzman
Depends on D188022

Differential Revision: https://phabricator.services.mozilla.com/D188023
2023-09-15 03:19:26 +00:00
Razvan Cojocaru
7904413197 Bug 1843954 - Have Coord * Primitive and Coord / Primitive return Coord. r=botond
While at it, improve the readability of the enable_if
IntCoordTyped constructor.

Differential Revision: https://phabricator.services.mozilla.com/D184573
2023-09-14 00:37:04 +00:00
Bob Owen
6cee752c49 Bug 1850072: Initialize RecordedDrawTargetCreation::mHasExistingData. r=jrmuizel
This also specializes ElementStreamFormat for bool.

Differential Revision: https://phabricator.services.mozilla.com/D187794
2023-09-12 11:51:11 +00:00
Brad Werth
bd88b9118f Bug 1851861 Part 2: Add a null-check at another callsite of CreateOffsetDrawTarget. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D187730
2023-09-08 15:14:45 +00:00
Chris Peterson
468401c1af Bug 1850883 - Remove always-true OnHighSierraOrLater() and OnCatalinaOrLater() version checks. r=gfx-reviewers,lsalzman
And stop including nsCocoaFeatures.h where it's no longer needed.

Firefox versions >= 116 only support macOS >= 10.15. High Sierra is macOS 10.13. Catalina is macOS 10.15.

Differential Revision: https://phabricator.services.mozilla.com/D187645
2023-09-07 23:07:57 +00:00
Brad Werth
fa097e4d1e Bug 1851861: Null-check more calls that attempt to create a DrawTarget. r=gfx-reviewers,lsalzman
Most of our calls that create a DrawTarget are null-checked. This patch
fixes up the few that were not already checked.

Differential Revision: https://phabricator.services.mozilla.com/D187586
2023-09-06 20:13:22 +00:00
Bob Owen
c1c73dc306 Bug 1846686: Remove DataSourceSurfaces when adding SourceSurfaces to CanvasTranslator. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D186171
2023-09-03 10:49:49 +00:00
Bob Owen
d3e6d914c9 Bug 1846685: Add PathOps::CheckedStreamToSink and use for event playback. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D186161
2023-09-02 16:13:30 +00:00
Bob Owen
06eb6baba2 Bug 1846683: Make assertions in FilterNodeD2D1::SetInput release assertions. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D186148
2023-09-02 12:22:22 +00:00
Markus Stange
e4ba2c2700 Bug 1850357 - Use nsTHashMap in DrawEventRecorder instead of unordered_map. r=jrmuizel
On Windows, unordered_map appears to allocate memory for empty sets.

Differential Revision: https://phabricator.services.mozilla.com/D186959
2023-08-28 23:11:04 +00:00
Markus Stange
2e9dce4692 Bug 1850357 - Use nsTHashSet in DrawEventRecorder instead of unordered_set. r=jrmuizel
On Windows, unordered_set appears to allocate memory for empty sets.

Differential Revision: https://phabricator.services.mozilla.com/D186958
2023-08-28 23:11:04 +00:00
Masatoshi Kimura
1791eb68d0 Bug 1850034 - Remove pre-Win10-specific codepath from gfx/. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D186809
2023-08-26 23:44:57 +00:00
Jeff Muizelaar
603d8416af Bug 1849458. Fix the order of beginPoint/currentPoint. r=gfx-reviewers,aosmond
I don't quite understand why this fixes the problem but it's
obviously more correct.

Differential Revision: https://phabricator.services.mozilla.com/D186869
2023-08-25 20:38:13 +00:00
Brad Werth
967de2ef02 Bug 1846694: Additional validation in RecordedSourceSurfaceCreation. r=gfx-reviewers,jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D185354
2023-08-10 18:37:08 +00:00
Bas Schouten
7b32e3d1ea Bug 1848050: Optimize individual line drawing in canvas recording backend. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D185870
2023-08-10 14:49:50 +00:00
Timothy Nikkel
1a15b46e51 Bug 1847149. Make PathBuilderD2D::Arc handle all start and end angles properly. r=lsalzman
This steals some code from ArcToBezier https://searchfox.org/mozilla-central/rev/fb43eb3bdf5b51000bc7dfe3474cbe56ca2ab63c/gfx/2d/PathHelpers.h#127 so that the start and end angle are within 2*Pi and so that they are in the correct numerical order depending if we are sweeping clockwise or anticlockwise. This makes calculations easier. Specifically it makes the determination of arc size (more or less than Pi) work below. This replaces some code which tried to do something similar but did not account for all cases.

Differential Revision: https://phabricator.services.mozilla.com/D185517
2023-08-07 02:05:30 +00:00
Jonathan Kew
bee329b01d Bug 1845813 - Null-check the variation tag dictionary before trying to apply it to the font. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D185268
2023-08-03 13:29:32 +00:00
Jeff Muizelaar
eb40f86c43 Bug 1846613. Use ArcToBezier for D2D until the D2D Arc bugs are fixed. r=ahale
This should roughly approximate the behaviour we had prior to bug 1839470

Differential Revision: https://phabricator.services.mozilla.com/D185217
2023-08-02 22:06:26 +00:00
Chris Peterson
29300d010e Bug 1846113 - Remove some always-true macOS version checks now that Firefox only supports macOS >= 10.15. r=gfx-reviewers,jgilbert
Also remove mNeedsFakeNoStencil_UserFBs code in WebGLContext.h/cpp that was only needed on Intel macOS <= 10.11.

Differential Revision: https://phabricator.services.mozilla.com/D184880
2023-08-01 05:05:48 +00:00
Lee Salzman
b2d67698b9 Bug 1846079 - Ensure pruned point begins first sub-path if necessary. r=aosmond
The Canvas2D specification says that if a path has no active sub-paths, and a
primitive is drawn, that the first point of that primitive becomes the start of
the newly created sub-path that will be created for it.

So if we prune a point when a path has no active sub-paths, and then a new
primitive comes in that does not start with that same point, we risk not
installing the pruned point as the start of that new sub-path.

To solve this, we need to detect if a path has no active sub-paths while
we are building it. This adds PathBuilder::IsActive() to help with that.
Then before we go to add a primitive, we check if there is a pruned point
on a path that is not active yet, and if so, install the correct start
point with a MoveTo.

This also makes IsActive and IsEmpty required so to ensure all our path
implementations behave consistently rather than having any surprising
unimplemented behavior.

Differential Revision: https://phabricator.services.mozilla.com/D184891
2023-07-30 14:31:09 +00:00
Razvan Cojocaru
89781782f2 Bug 1844406 - Remove struct CommonType and use automatic return type deduction in Coord.h. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D184026
2023-07-21 02:17:43 +00:00
Razvan Cojocaru
d198960808 Bug 1841729 - Change the return type of BaseMargin::{LeftRight,TopBottom}() to Coord. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D183570
2023-07-17 21:18:17 +00:00
Razvan Cojocaru
90f7a9440b Bug 1841728 - Change the parameter types of BaseMargin::SizeTo() to Coord. r=dlrobertson
Differential Revision: https://phabricator.services.mozilla.com/D183185
2023-07-13 14:24:05 +00:00
Razvan Cojocaru
679740122d No bug - Remove unreachable return in BasePoint::IsFinite(). r=dlrobertson
Differential Revision: https://phabricator.services.mozilla.com/D183113
2023-07-13 14:23:35 +00:00
Razvan Cojocaru
23aa72ebf6 Bug 1841478 - Use strongly-typed coordinates in the BaseSize constructor. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D182654
2023-07-10 02:59:01 +00:00
Razvan Cojocaru
74639ffcbe Bug 1842072 - Prevent IntCoordTyped's constructor from accepting non-integral parameters. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D182936
2023-07-08 07:45:44 +00:00
Markus Stange
47e01cd2cc Bug 1842271 - Remove unused files QuartzSupport.h/mm. These were used for plug-in rendering. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D183036
2023-07-07 19:07:37 +00:00
Botond Ballo
9ac8419b70 Bug 1841731 - Remove obsolete comment from description of BaseMatrix::ScaleFactors(). r=rzvncj
Differential Revision: https://phabricator.services.mozilla.com/D182756
2023-07-05 05:57:47 +00:00
Razvan Cojocaru
51f6032d4d Bug 1840485 - Change the type of BaseMargin::{top,right,bottom,left} to Coord. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D182328
2023-07-01 02:23:21 +00:00
Jeff Muizelaar
429e6a1c2d Bug 1840756 - PathRecording: Detect open and closed circles. r=lsalzman
This lets us detect open circles and fast path filling them while falling
back to regular stroking

Differential Revision: https://phabricator.services.mozilla.com/D182292
2023-06-29 15:55:05 +00:00