3132 Commits

Author SHA1 Message Date
Lee Salzman
8986d2d483 Bug 1790450 - Avoid using SkTextBlob bounds. r=aosmond
The conservative bounds returned when using SkTextBlob::bounds() can sometimes
be erroneous. Skia currently does not have a way to force tight bounds computation
with that particular interface, so we work around this by querying the bounds
from SkFont explicitly like Skia's internal tight bounds computation would do
anyway.

Differential Revision: https://phabricator.services.mozilla.com/D157547
2022-09-16 18:26:05 +00:00
Kelsey Gilbert
a32dfd5297 Bug 1785925 - Add LUT and Colorspace support to GLBlitHelper. r=lsalzman,media-playback-reviewers,alwu
This code was originally developed in bug 1771374, but here we omit the
DCLayerTree changes for later.

Differential Revision: https://phabricator.services.mozilla.com/D155027
2022-09-13 17:40:43 +00:00
Marian-Vasile Laza
7ec7dec6f1 Backed out changeset f1e6746037f7 (bug 1785925) for causing reftest failures on DCLayerTree.cpp. CLOSED TREE 2022-09-06 23:35:51 +03:00
Kelsey Gilbert
24a9bc97bb Bug 1785925 - Add LUT and Colorspace support to GLBlitHelper. r=lsalzman,media-playback-reviewers,alwu
This code was originally developed in bug 1771374, but here we omit the
DCLayerTree changes for later.

Differential Revision: https://phabricator.services.mozilla.com/D155027
2022-09-06 18:36:34 +00:00
Jonathan Kew
d002b86978 Bug 1779202 - Disable use of CGLayer-backed cairo quartz surfaces to work around scaling bug affecting XObject images in pdf.js output. r=dholbert
This avoids the apparent Core Graphics bug whereby the PDF output it generates will mis-render
when subsequently processed again by Core Graphics (although it renders OK in Adobe products).
Unfortunately, this will regress bug 1772225, so that pdf.js documents will be rasterized when
printed or in Save to PDF output on macOS.

(Setting the pref gfx.cairo_quartz_cg_layer.enabled to true will restore "good" (vector-based)
output, but embedded XObject bitmap images may be mis-scaled.)

Differential Revision: https://phabricator.services.mozilla.com/D156570
2022-09-06 18:25:20 +00:00
Lee Salzman
775ea303b7 Bug 1773280 - Support complex clips in DrawTargetWebgl by using a mask texture. r=aosmond,gfx-reviewers
DrawTargetWebgl currently only supports aligned rectangular clips that can be approximated
with a scissor. However, many use-cases require complex clips like rounded rectangles or
not-aligned regions. We can support these cases more generally by using a mask texture that
modulates the shader color. The mask texture is generated by doing a solid fill in the Skia
target over a clear background, which is safe because the Skia target is not in use while
the WebGL target is being rendered to. This adds one unconditional texture lookup to the
shaders which shouldn't have a big performance impact. When no clip mask is needed, we just
default to using a 1x1 solid texture.

Depends on D156224

Differential Revision: https://phabricator.services.mozilla.com/D156225
2022-09-06 05:06:18 +00:00
Lee Salzman
bc35a2d000 Bug 1773280 - Extend DrawTargetWebgl's glyph cache to support stroked glyphs. r=aosmond,gfx-reviewers
Currently we only support filled glyphs in DrawTargetWebgl. PDF.js can often render PDFs
that have stroked glyphs, so support for stroked glyphs is useful to prevent fallbacks.
This just adds support for plumbing StrokeOptions through to GlyphCache.

Differential Revision: https://phabricator.services.mozilla.com/D156224
2022-09-06 05:06:17 +00:00
Cristian Tuns
3d56a1da28 Backed out changeset b14b975aa6d7 (bug 1785925) for causing build bustages on GLBlitHelper.cpp CLOSED TREE 2022-09-02 20:12:33 -04:00
Kelsey Gilbert
75cccdd5cb Bug 1785925 - Add LUT and Colorspace support to GLBlitHelper. r=lsalzman,media-playback-reviewers,alwu
This code was originally developed in bug 1771374, but here we omit the
DCLayerTree changes for later.

Differential Revision: https://phabricator.services.mozilla.com/D155027
2022-09-02 22:15:58 +00:00
Mike Hommey
c66fa55695 Bug 1787085 - Fix undefined behavior from cast from float to char. r=gfx-reviewers,lsalzman
Floating-point -> integral conversions rules are such that if the value
cannot fit into the destination type, the behavior is undefined. So when
casting a value between 0.0 and 255.0 to a char, it is not defined what
happens to values above 127 on platforms where char is signed. So far,
we've been lucky that the compiler made it work, but that's not true
anymore in clang 15, which ends up doing the equivalent of
`std::min((unsigned char)(255.0f * x), (unsigned char)127)`, which is
about as valid as anything else considering undefined behavior.

Differential Revision: https://phabricator.services.mozilla.com/D156256
2022-09-02 01:37:03 +00:00
Lee Salzman
3964d1b8ec Bug 1786136 - Make UserData thread-safe. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D155997
2022-09-01 05:29:14 +00:00
Fabrice Desré
c50cb528fc Bug 1761040 - Prefix thread safety macros with MOZ_ r=geckoview-reviewers,media-playback-reviewers,alwu,jesup,m_kato
Differential Revision: https://phabricator.services.mozilla.com/D152575
2022-08-03 16:39:41 +00:00
Andreea Pavel
3ccd75af8d Backed out changeset b9d2965591b9 (bug 1761040) for landing with wrong author CLOSED TREE DONTBUILD 2022-08-03 18:55:00 +03:00
Andreea Pavel
fdb7cb2ecd Bug 1761040 - Prefix thread safety macros with MOZ_ r=geckoview-reviewers,media-playback-reviewers,alwu,jesup,m_kato
Differential Revision: https://phabricator.services.mozilla.com/D152575
2022-08-03 15:27:43 +00:00
Andreea Pavel
89d63c91e6 Backed out changeset a907159a482f (bug 1761040) for causing build bustages on a CLOSED TREE 2022-08-02 04:59:08 +03:00
Fabrice Desré
0f4ac7ad97 Bug 1761040 - Prefix thread safety macros with MOZ_ r=geckoview-reviewers,media-playback-reviewers,alwu,jesup,m_kato
Differential Revision: https://phabricator.services.mozilla.com/D152575
2022-08-02 00:49:41 +00:00
Iulian Moraru
27d760c7c2 Backed out 9 changesets (bug 1771374) for causing mochitest-webgl failures. CLOSED TREE
Backed out changeset ded977dd1896 (bug 1771374)
Backed out changeset adeb8b7d48f9 (bug 1771374)
Backed out changeset 7767340872c5 (bug 1771374)
Backed out changeset 33282b4ffaae (bug 1771374)
Backed out changeset 75db498cd0e7 (bug 1771374)
Backed out changeset 70035903ea37 (bug 1771374)
Backed out changeset 7c7de0fb66e1 (bug 1771374)
Backed out changeset 615df05e016f (bug 1771374)
Backed out changeset ac3411d21928 (bug 1771374)
2022-08-02 03:38:09 +03:00
Kelsey Gilbert
5108ab70bf Bug 1771374 - Create swapchain with premult-alpha if hasAlpha. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D152445
2022-08-01 19:49:28 +00:00
Kelsey Gilbert
fa6e66aedd Bug 1771374 - Support display-p3 output via DirectComposition on Windows. r=sotaro,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D150275
2022-08-01 19:49:26 +00:00
Stephen A Pohl
a945096f93 Bug 1773752: Remove more workarounds for old macOS SDKs. r=mstange,media-playback-reviewers,padenot
Differential Revision: https://phabricator.services.mozilla.com/D151532
2022-07-18 17:08:59 +00:00
Lee Salzman
d4bf5cfa1b Bug 1779684 - Mark more surface types as IsDataSourceSurface. r=aosmond,gfx-reviewers
We spend a significant amount of time in profiles allocating DataSourceSurfaceWrapper
when GetDataSurface is called inside DrawTargetWebgl. We can mark some more surface
types as IsDataSurface to work around this fairly easily.

Differential Revision: https://phabricator.services.mozilla.com/D151898
2022-07-15 02:27:58 +00:00
Narcis Beleuzu
a9e7761934 Backed out 4 changesets (bug 1771374) for causing Google docs and maps rendering regressions. a=backout
Backed out changeset 9c65411d1843 (bug 1771374)
Backed out changeset 9f5cf953fcc8 (bug 1771374)
Backed out changeset 8b39f60971e4 (bug 1771374)
Backed out changeset ef52a6c462b6 (bug 1771374)
2022-07-14 00:43:56 +03:00
Kelsey Gilbert
8eb05ff04b Bug 1771374 - Support display-p3 output via DirectComposition on Windows. r=sotaro,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D150275
2022-07-12 23:55:50 +00:00
Jeff Muizelaar
8d06dee79d Bug 1769429. Revert 1719215. r=lsalzman
This fixes subimage drawing with Cairo.

Differential Revision: https://phabricator.services.mozilla.com/D151152
2022-07-12 17:48:41 +00:00
Jonathan Kew
2f7b62ff61 Bug 1777209 - Use DrawSurface rather than FillRect to paint <canvas>, and don't use EXTEND_PAD when writing to PDF. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D150601
2022-07-05 07:55:56 +00:00
Csoregi Natalia
da06c30fac Backed out changeset 1b43d3f38946 (bug 1777209) for causing reftest failures e.g. 602200-4.html. CLOSED TREE 2022-07-04 19:27:42 +03:00
Jonathan Kew
c94cf2c2a7 Bug 1777209 - Use DrawSurface rather than FillRect to paint <canvas>, and don't use EXTEND_PAD when writing to PDF. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D150601
2022-07-04 14:08:16 +00:00
smolnar
3fa084ce2f Backed out 3 changesets (bug 1771374) for causing build bustage in gfx/gl/gtest/TestColorspaces.cpp CLOSED TREE
Backed out changeset 4d01f260c43a (bug 1771374)
Backed out changeset fc62679f0a6c (bug 1771374)
Backed out changeset f4f12470f8b7 (bug 1771374)
2022-06-30 21:19:17 +03:00
Kelsey Gilbert
bb48a57a8a Bug 1771374 - Support display-p3 output via DirectComposition on Windows. r=sotaro,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D150275
2022-06-30 17:56:26 +00:00
criss
d5ece910a9 Backed out 3 changesets (bug 1771374) for causing bustages on Colorspaces.h. CLOSED TREE
Backed out changeset 498c27656dc3 (bug 1771374)
Backed out changeset 6f97bc39643f (bug 1771374)
Backed out changeset b4fdb70808b6 (bug 1771374)
2022-06-30 05:28:11 +03:00
Kelsey Gilbert
c4f86e2e33 Bug 1771374 - Support display-p3 output via DirectComposition on Windows. r=sotaro,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D150275
2022-06-29 23:38:22 +00:00
criss
efb5f18b59 Backed out 3 changesets (bug 1771374) for causing build bustages on GLBlitHelper.cpp. CLOSED TREE
Backed out changeset 71d40a0a3c9c (bug 1771374)
Backed out changeset 6a42df6834fe (bug 1771374)
Backed out changeset be888d0fd0bf (bug 1771374)
2022-06-30 01:12:46 +03:00
Kelsey Gilbert
bad5d9146c Bug 1771374 - Support display-p3 output via DirectComposition on Windows. r=sotaro,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D150275
2022-06-29 21:48:52 +00:00
Jonathan Kew
782d6c08e7 Bug 1772225 - Implement a CGLayer-backed version of cairo_quartz_surface, to improve print/PDF output quality for pdf.js documents. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D150128
2022-06-27 17:14:21 +00:00
Emilio Cobos Álvarez
cbb5b58f4d Bug 1772555 - Use style interpolation code for gradients. r=nical
This ensures they're clamped on Animated -> sRGB conversion, and in the
future we'll have to implement different color spaces so we'll need to
use it anyways.

Differential Revision: https://phabricator.services.mozilla.com/D149792
2022-06-22 23:02:34 +00:00
Iulian Moraru
0ebda972c1 Backed out changeset 003cad9bbcc6 (bug 1772555) for causing reftest failures on bugs/1315113-1.html. 2022-06-22 22:00:53 +03:00
Emilio Cobos Álvarez
827fe3a33e Bug 1772555 - Use style interpolation code for gradients. r=nical
This ensures they're clamped on Animated -> sRGB conversion, and in the
future we'll have to implement different color spaces so we'll need to
use it anyways.

Differential Revision: https://phabricator.services.mozilla.com/D149792
2022-06-22 17:00:56 +00:00
serge-sans-paille
5b0ab0f5a6 Bug 1775340 - Cleanup gfx/ includes r=sylvestre
This one is a bit messy so I was very conservative on the changes.

Differential Revision: https://phabricator.services.mozilla.com/D149922
2022-06-22 09:50:52 +00:00
Jonathan Kew
c3f962f2b2 Bug 1775125 - Avoid duplicate call to hypotf() in FlattenedPath::ComputePointAtLength. r=gfx-reviewers,jrmuizel,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D149788
2022-06-20 17:32:45 +00:00
Botond Ballo
5d687c962b Bug 1771503 - Disable the 'two layers that scroll together' assertion for matrices with Inf or NaN elements. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D149466
2022-06-17 23:50:49 +00:00
Lee Salzman
4963ce29fb Bug 1773936 - Apply Skia-equivalent subpixel rounding in DrawTargetWebgl. r=aosmond,gfx-reviewers
Depending on the current transform, Skia applies either subpixel rounding or integer
rounding to different coordinate axes of the transformed glyph position. If we don't
correctly predict which of these are applied, we may have aliased cache entries that
round to the same value in DrawTargetWebgl but for which Skia under the hood rounds
in entirely different directions. When this happens, glyphs can get hinted to the
wrong direction. To fix this, we need to ensure that we appropriately apply either
subpixel rounding or integer rounding in the same manner as Skia.

Differential Revision: https://phabricator.services.mozilla.com/D149350
2022-06-16 21:39:07 +00:00
Razvan Cojocaru
92f59ee7ac Bug 1773382 - Change the return type of GetPaintedLayerScaleForFrame() to MatrixScales. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D148764
2022-06-14 21:54:55 +00:00
Emilio Cobos Álvarez
9fc2aa47fc Bug 1773558 - Move fixed-point font types to Rust. r=layout-reviewers,jfkthame
Now that cbindgen and rust support const generics, it seems more simple.

This centralizes all the relevant font constants etc in rust and avoids
conversions when going from rust to C++ and vice versa.

Differential Revision: https://phabricator.services.mozilla.com/D148847
2022-06-13 00:59:23 +00:00
Noemi Erli
841e350bc4 Backed out changeset 7585591a9bad (bug 1773558) for causing failures in system-fonts.html 2022-06-12 19:02:33 +03:00
Emilio Cobos Álvarez
e441089ca0 Bug 1773558 - Move fixed-point font types to Rust. r=layout-reviewers,jfkthame
Now that cbindgen and rust support const generics, it seems more simple.

This centralizes all the relevant font constants etc in rust and avoids
conversions when going from rust to C++ and vice versa.

Differential Revision: https://phabricator.services.mozilla.com/D148847
2022-06-12 10:48:58 +00:00
criss
ed1236630c Backed out 2 changesets (bug 1773752, bug 1696513) for causing build bustages. CLOSED TREE
Backed out changeset 6628f146ad0b (bug 1773752)
Backed out changeset f636b7e35d0c (bug 1696513)
2022-06-11 02:35:43 +03:00
Stephen A Pohl
1faf32bda8 Bug 1773752: Remove workarounds for old macOS SDKs and update documentation. r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D148944
2022-06-10 23:08:35 +00:00
Nicolas Silva
a45bacf0d2 Bug 1746356 - Null-check the result of CreateSimilarDrawTarget. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D148512
2022-06-08 07:28:04 +00:00
Sylvestre Ledru
42f6811d95 Bug 1519636 - Reformat recent changes to the Google coding style r=andi,media-playback-reviewers,necko-reviewers,padenot,dragana
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D148375
2022-06-07 12:32:55 +00:00
Razvan Cojocaru
f0ceea18e4 Bug 1767127 - Change the types of FilterInstance::m[UserSpaceToFilter|FilterSpaceToUser]SpaceScale to MatrixScalesDouble. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D148138
2022-06-03 19:55:30 +00:00