Commit Graph

2745 Commits

Author SHA1 Message Date
André Bargull
2712714d84 Bug 1625138 - Part 35: Replace mozilla::TrueType with std::true_type. r=froydnj,jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D68554

--HG--
extra : moz-landing-system : lando
2020-03-28 13:57:20 +00:00
André Bargull
1be056677a Bug 1625138 - Part 26: Replace mozilla::Conditional with std::conditional. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D68381

--HG--
extra : moz-landing-system : lando
2020-03-28 13:57:18 +00:00
Jeff Muizelaar
b5242e1d14 Bug 1617708. Make ClippedDrawTarget use destination DT.
By using the destination DT we will use the correct offset
during playback instead of the offset of the reference target.

Differential Revision: https://phabricator.services.mozilla.com/D68495

--HG--
extra : moz-landing-system : lando
2020-03-27 03:15:05 +00:00
Chris Peterson
b994ab8896 Bug 1624789 - Replace MOZ_MUST_USE with [[nodiscard]] in gfx. r=gfx-reviewers,nical
Also move MOZ_MUST_USE before function declarations' specifiers and return type. While clang and gcc's __attribute__((warn_unused_result)) can appear before, between, or after function specifiers and return types, the [[nodiscard]] attribute must precede the function specifiers.

Differential Revision: https://phabricator.services.mozilla.com/D68152

--HG--
extra : moz-landing-system : lando
2020-03-25 10:35:04 +00:00
Lee Salzman
e7163f076c Bug 1611467 - unify UnscaledFont::GetFontDescriptor and GetWRFontDescriptor implementations. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D68284

--HG--
extra : moz-landing-system : lando
2020-03-26 16:11:00 +00:00
Botond Ballo
6a4407c26e Bug 1621803 - Fix additional bugs in Matrix4x4Flagged::operator*(Matrix4x4). r=bas
Differential Revision: https://phabricator.services.mozilla.com/D66505

--HG--
extra : moz-landing-system : lando
2020-03-25 15:22:14 +00:00
Emilio Cobos Álvarez
575d8d016a Bug 1622113 - Ensure the skip rect end is aligned to a 4-byte boundary. r=mstange
So that accesses that use mSkipRect.XMost() - 4 or - 16 are aligned to a 4-byte
boundary. Not doing so would crash on some architectures due to a SIGBUS.

Differential Revision: https://phabricator.services.mozilla.com/D66748

--HG--
extra : moz-landing-system : lando
2020-03-21 00:19:23 +00:00
sotaro
b7a705dcef Bug 1623254 - Re-create DrawTarget of CanvasRenderingContext2D when the DrawTarget becomes invalid r=nical
Differential Revision: https://phabricator.services.mozilla.com/D67274

--HG--
extra : moz-landing-system : lando
2020-03-18 10:38:32 +00:00
Mihai Alexandru Michis
b0060ff6a8 Backed out changeset 70b7dcfea394 (bug 1622220) for causing failures in gfx/2d/Swizzle.cpp
CLOSED TREE
2020-03-13 15:07:13 +02:00
Andrew Osmond
acdd6810d2 Bug 1622220 - Add UnpremultiplyRow and extend SwizzleRow. r=lsalzman
UnpremultiplyRow will be used in the image encoders to reverse
premultiplication. SwizzleRow needs to support copying (no swizzling)
and swapping RGB/BGR.

Differential Revision: https://phabricator.services.mozilla.com/D66743

--HG--
extra : moz-landing-system : lando
2020-03-13 11:35:12 +00:00
Andrew Osmond
91b071ed14 Bug 1618345 - Enforce proper color management by splitting gfx::Color into sRGBColor and DeviceColor types. r=jrmuizel
gfx::Color is currently misused in many places. The DrawTargets expect
the color space to be in device space, e.g. what we are actually going
to draw using. Everything sitting above generally deals with sRGB, as
specified in CSS. Sometimes we missed the conversion from sRGB to device
space when issuing draw calls, and similarly sometimes we converted the
color to device space twice.

This patch splits the type in two. sRGBColor and DeviceColor now
represent sRGB and device color spaces respectively. DrawTarget only
accepts DeviceColor, and one can get a DeviceColor from an sRGBColor via
the ToDeviceColor helper API. The reftests now pass with color
management enabled for everything (e.g. CSS) instead of just tagged
raster images.

There will be a follow up patch to enable color management everywhere by
default on all supported platforms.

Differential Revision: https://phabricator.services.mozilla.com/D64771

--HG--
extra : moz-landing-system : lando
2020-03-09 14:16:17 +00:00
Tim Nguyen
6cec94d9be Bug 1620328 - Set conic-gradient angle range on Skia. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D65910

--HG--
extra : moz-landing-system : lando
2020-03-08 21:46:06 +00:00
Andrew Osmond
4831a6bd0e Bug 1616030 - Fix SwizzleRow for big endian systems. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D65797

--HG--
extra : moz-landing-system : lando
2020-03-06 20:04:18 +00:00
Jeff Muizelaar
c7fe1a2838 Bug 1619978. Crash sometimes if we fail to get the SystemFontCollection. r=jfkthame
WebRender won't support GDI fonts so we need to figure out what to do
with the users that are currently using them. This should help give us
better diagnostics on what's going wrong.

gfxCriticalError only crashes on Nightly and Beta builds

Differential Revision: https://phabricator.services.mozilla.com/D65342

--HG--
extra : moz-landing-system : lando
2020-03-04 17:47:23 +00:00
Simon Giesecke
487e61434c Bug 1613985 - Fix bustage on PathHelpers.h. r=fix CLOSED TREE
--HG--
extra : amend_source : 8f3038ca698c65ee17a9780172d6b2a8fb699c50
2020-03-04 18:36:20 +02:00
Simon Giesecke
dce1e48caf Bug 1613985 - Use default for equivalent-to-default constructors/destructors in gfx. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D65288

--HG--
extra : moz-landing-system : lando
2020-03-04 15:39:20 +00:00
Tim Nguyen
d980575700 Bug 1619006 - Fix max value in ReadElementConstrained call in RecordedEvent::ReadPatternData. r=gfx-reviewers,nical
Differential Revision: https://phabricator.services.mozilla.com/D64826

--HG--
extra : moz-landing-system : lando
2020-03-02 10:20:57 +00:00
Andrew McCreight
4babb2b5ab Bug 1609815 - Remove Web Replay C++ implementation. r=jgilbert,jandem,gbrown
Patch by bhackett and jlaster. Also reviewed by mccr8.

Differential Revision: https://phabricator.services.mozilla.com/D60197

--HG--
extra : moz-landing-system : lando
2020-02-27 17:39:15 +00:00
Ciure Andrei
00dd87f6f4 Backed out changeset d407a28318e6 (bug 1609815) for causing windows ming bustages CLOSED TREE
--HG--
extra : histedit_source : b2c748e31e0f6ba8fcf9960a336e0bbd361b07e6
2020-02-27 07:05:19 +02:00
Andrew McCreight
b197e1f783 Bug 1609815 - Remove Web Replay C++ implementation. r=jgilbert,jandem,gbrown
Patch by bhackett and jlaster. Also reviewed by mccr8.

Differential Revision: https://phabricator.services.mozilla.com/D60197

--HG--
extra : moz-landing-system : lando
2020-02-27 04:43:48 +00:00
Simon Giesecke
aaf6cb4e75 Bug 1617628 - Hide nsBaseHashtable Put overloads in nsRefPtrHashtable subclass. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D63899

--HG--
extra : moz-landing-system : lando
2020-02-25 17:03:36 +00:00
Andrew Osmond
fbaa72bc71 Bug 1617493 - Rasterize SVG patterns in content process into a shared surface for WebRender. r=jrmuizel
In DrawTargetRecording::CreateSimilarDrawTarget, we would originally
create a new DrawTargetRecording. For resources that are shared, such as
SVG patterns, we would do the same work for each blob image tile. This
can get expensive if the pattern is large. Now we check a size
threshold, and if passed, we create a DrawTargetSkia backed by a
SourceSurfaceSharedData. When we want a snapshot, we now try to get the
shared surface instead if available. The recording infrastructure
already knows how to handle the lifetimes and use of external IDs for
shared surfaces, so now we rasterize the pattern once for all the blob
tiles. In an ideal world we would do this in the compositor process
once, but that requires more changes, and this is useful as a stopgap in
the meantime.

Differential Revision: https://phabricator.services.mozilla.com/D63903

--HG--
extra : moz-landing-system : lando
2020-02-25 13:56:23 +00:00
Bob Owen
d8ee8af896 Bug 1598585 Part 2: Make playback of Moz2D recorded events more robust. r=jrmuizel
This is generally around object creation failures and their subsequent lookup,
which can happen, for example, during device reset.

Differential Revision: https://phabricator.services.mozilla.com/D60888

--HG--
extra : moz-landing-system : lando
2020-02-24 10:49:36 +00:00
Tim Nguyen
08ab9ceb1e Bug 1616587 - Implement conic-gradient for Skia graphics backend. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D63415

--HG--
extra : moz-landing-system : lando
2020-02-21 00:12:47 +00:00
Csoregi Natalia
ff5e1dafb1 Backed out changeset bf981458da0c (bug 1616587) for bustage on DrawTargetCairo.cpp. CLOSED TREE 2020-02-21 02:07:11 +02:00
Tim Nguyen
edf9be08c3 Bug 1616587 - Implement conic-gradient for Skia graphics backend. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D63415

--HG--
extra : moz-landing-system : lando
2020-02-20 23:50:06 +00:00
Csoregi Natalia
30fc2949d8 Backed out changeset 2d804daeaccb (bug 1616587) for bustages on DrawTargetCairo.cpp. CLOSED TREE 2020-02-21 01:19:36 +02:00
Tim Nguyen
41df136301 Bug 1616587 - Implement conic-gradient for Skia graphics backend. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D63415

--HG--
extra : moz-landing-system : lando
2020-02-20 22:58:59 +00:00
Nicolas Silva
b41ff8b834 Bug 1581475 - Check that the D2D DrawTarget always has a layer. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D63484

--HG--
extra : moz-landing-system : lando
2020-02-20 17:26:21 +00:00
Tim Nguyen
0afd3695fa Bug 1616803 - Fix copy-paste error in DrawTargetRecording.cpp. r=gfx-reviewers,jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D63489

--HG--
extra : moz-landing-system : lando
2020-02-20 16:02:13 +00:00
Imanol Fernandez
a980785958 Bug 1616386 - Fix Quaternion copy constructor r=lsalzman
Fix Quaternion copy constructor

Differential Revision: https://phabricator.services.mozilla.com/D63255

--HG--
extra : moz-landing-system : lando
2020-02-18 21:37:21 +00:00
Nicolas Silva
1ff2e87bb4 Bug 1581475 - Add missing null-check in CreateBrudhForPattern. r=jrmuizel
The crash reports all have allocation failures in their gfx critical log indicating that the best we can do is bail out without crashing and hope that enough memory will be freed before we run into an infallible allocation.

Differential Revision: https://phabricator.services.mozilla.com/D63085

--HG--
extra : moz-landing-system : lando
2020-02-18 13:52:42 +00:00
Simon Giesecke
b50347f917 Bug 1611415 - Prefer using std::move over forget. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D60980

--HG--
extra : moz-landing-system : lando
2020-02-13 14:38:48 +00:00
shindli
91aa0518dd Backed out changeset 0c982bc69cb3 (bug 1611415) for causing build bustages in /builds/worker/workspace/build/src/obj-firefox/dist/include/nsCOMPtr CLOSED TREE 2020-02-12 20:13:29 +02:00
Simon Giesecke
f604a47fa5 Bug 1611415 - Applied FixItHints from mozilla-non-std-move. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D60980

--HG--
extra : moz-landing-system : lando
2020-02-12 17:24:41 +00:00
Emilio Cobos Álvarez
6311bc2129 Bug 1614512 - Give mozilla::Side and mozilla::Corner a fixed underlying type. r=froydnj
So as to avoid UB. It is somewhat unfortunate/dumb the fact that we need to do
this and we can't detect when we forget to do it :(

Give it uint8_t as it's type as that's enough and consistent with LogicalSide.

Differential Revision: https://phabricator.services.mozilla.com/D62390

--HG--
extra : moz-landing-system : lando
2020-02-11 14:11:06 +00:00
David Major
7fc89d3fa3 Bug 1577236 - clang-10: Fix a -Wimplicit-int-float-conversion warning in ExtendInputEffectD2D1 r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D60998

--HG--
extra : moz-landing-system : lando
2020-02-07 18:06:11 +00:00
Andrew Osmond
52c022a178 Bug 1612589 - Improve image memory reporting even further. r=tnikkel
This patch adds reporting the surface types used by the image frame in a
bit mask (such if it is a CAPTURE including a DATA_SHARED, the mask will
be 1 << CAPTURE | 1 << DATA_SHARED), as well as an estimated size
included in the report as decoded-unknown for when we do not know if the
surface is on the heap or the non-heap specifically. This is the default
implementation for a SourceSurface as well, so we should no longer have
the case where surfaces appear empty despite being in the cache. It also
makes requests being validated as always notable for reporting purposes.

Differential Revision: https://phabricator.services.mozilla.com/D61458

--HG--
extra : moz-landing-system : lando
2020-02-05 22:22:13 +00:00
Ting-Yu Lin
22ea8326d7 Bug 1610670 - Add AllPhysicalHalfCorners() to support range-based for loops. r=mats
This patch is generated via:
1. Manually modify gfx/2d/Types.h
2. Run the following script and clang-format.
3. Add brackets for the for loop in nsCSSRendering.cpp.

```

function rename() {
    echo "Renaming $1 to $2"
    rg -l "$1" | xargs sed -i -E -e s/"$1"/"$2"/g
}

rename "NS_FOR_CSS_HALF_CORNERS\(i\)" "for (const auto i : mozilla::AllPhysicalHalfCorners())"
rename "NS_FOR_CSS_HALF_CORNERS\(corner\)" "for (const auto corner : mozilla::AllPhysicalHalfCorners())"
```

Differential Revision: https://phabricator.services.mozilla.com/D61252

--HG--
extra : moz-landing-system : lando
2020-02-04 03:28:47 +00:00
Ting-Yu Lin
b19983c13e Bug 1610670 - Add AllPhysicalCorners() to support range-based for loops. r=mats
This patch is generated via:
1. Manually modify gfx/2d/Types.h
2. Run the following script and clang-format.

```

function rename() {
    echo "Renaming $1 to $2"
    rg -l "$1" | xargs sed -i -E -e s/"$1"/"$2"/g
}

rename "NS_FOR_CSS_FULL_CORNERS\(i\)" "for (const auto i : mozilla::AllPhysicalCorners())"
rename "NS_FOR_CSS_FULL_CORNERS\(corner\)" "for (const auto corner : mozilla::AllPhysicalCorners())"
```

Differential Revision: https://phabricator.services.mozilla.com/D61251

--HG--
extra : moz-landing-system : lando
2020-02-04 03:28:35 +00:00
Ting-Yu Lin
c81d3e5f5f Bug 1610670 - Add AllPhysicalSides() to support range-based for loops. r=mats
This patch is generated via:
1. Manually modify gfx/2d/Types.h
2. Run the following script and clang-format.

```

function rename() {
    echo "Renaming $1 to $2"
    rg -l "$1" | xargs sed -i -E -e s/"$1"/"$2"/g
}

rename "NS_FOR_CSS_SIDES\(side\)" "for (const auto side : mozilla::AllPhysicalSides())"
rename "NS_FOR_CSS_SIDES\(s\)" "for (const auto s : mozilla::AllPhysicalSides())"
rename "NS_FOR_CSS_SIDES\(i\)" "for (const auto i : mozilla::AllPhysicalSides())"
rename "NS_FOR_CSS_SIDES\(ix\)" "for (const auto ix : mozilla::AllPhysicalSides())"
```

Differential Revision: https://phabricator.services.mozilla.com/D61250

--HG--
extra : moz-landing-system : lando
2020-02-04 03:28:27 +00:00
Andrew Osmond
de9131c720 Bug 1612207 - SourceSurfaceCapture::IsValid should validate any underlying surfaces. r=jrmuizel
SourceSurfaceCapture can contain an underlying surface instead of a set
of drawing commands. The surface has its own valid state, and must be
checked by the parent in SourceSurfaceCapture::IsValid. If we don't,
then we may end up failing silently while drawing, and images will go
missing. The underlying surface can be invalidated by a device reset if
it is a SourceSurfaceD2D1, as an example.

Differential Revision: https://phabricator.services.mozilla.com/D61245

--HG--
extra : moz-landing-system : lando
2020-01-30 12:24:25 +00:00
Bob Owen
60b9eebd75 Bug 1604800 Part 2: Remove DataSourceSurfaceRecording from DrawTargetRecording. r=jrmuizel
This is done by using CreateDataSourceSurfaceWithStrideFromData to create a
DataSourceSurface and then OptimizeSourceSurface to record and optimize that.
This means that we now only have SourceSurfaceRecording using SurfaceType
RECORDING. We then rely on this to improve the test in OptimizeSourceSurface to
check that a SourceSurfaceRecording is for its recorder.

Differential Revision: https://phabricator.services.mozilla.com/D60736

--HG--
extra : moz-landing-system : lando
2020-01-22 21:23:08 +00:00
Bob Owen
78557e5083 Bug 1604800 Part 1: Add a new WRAP_AND_RECORD SurfaceType for SourceSurfaceWrapAndRecord. r=jrmuizel
This is to avoid type confusion with SourceSurfaceRecording.

Differential Revision: https://phabricator.services.mozilla.com/D60735

--HG--
extra : moz-landing-system : lando
2020-01-22 21:21:08 +00:00
Andrew Osmond
c4d61e7193 Bug 1610814 - Fix NEON compile error with gcc and RGB unpacking. r=lsalzman
This patch makes us use the correct intrinsic for loading a uint8x16
register. It is not entirely clear why clang accepts this without
complaint but beyond the types, it should be equivalent.

Differential Revision: https://phabricator.services.mozilla.com/D60667

--HG--
extra : moz-landing-system : lando
2020-01-22 15:19:20 +00:00
Emilio Cobos Álvarez
256c124f94 Bug 1609996 - Reorder some includes affected by the previous patches. r=froydnj
This was done by:

This was done by applying:

```
diff --git a/python/mozbuild/mozbuild/code-analysis/mach_commands.py b/python/mozbuild/mozbuild/code-analysis/mach_commands.py
index 789affde7bbf..fe33c4c7d4d1 100644
--- a/python/mozbuild/mozbuild/code-analysis/mach_commands.py
+++ b/python/mozbuild/mozbuild/code-analysis/mach_commands.py
@@ -2007,7 +2007,7 @@ class StaticAnalysis(MachCommandBase):
         from subprocess import Popen, PIPE, check_output, CalledProcessError

         diff_process = Popen(self._get_clang_format_diff_command(commit), stdout=PIPE)
-        args = [sys.executable, clang_format_diff, "-p1", "-binary=%s" % clang_format]
+        args = [sys.executable, clang_format_diff, "-p1", "-binary=%s" % clang_format, '-sort-includes']

         if not output_file:
             args.append("-i")
```

Then running `./mach clang-format -c <commit-hash>`

Then undoing that patch.

Then running check_spidermonkey_style.py --fixup

Then running `./mach clang-format`

I had to fix four things:

 * I needed to move <utility> back down in GuardObjects.h because I was hitting
   obscure problems with our system include wrappers like this:

0:03.94 /usr/include/stdlib.h:550:14: error: exception specification in declaration does not match previous declaration
0:03.94 extern void *realloc (void *__ptr, size_t __size)
0:03.94              ^
0:03.94 /home/emilio/src/moz/gecko-2/obj-debug/dist/include/malloc_decls.h:53:1: note: previous declaration is here
0:03.94 MALLOC_DECL(realloc, void*, void*, size_t)
0:03.94 ^
0:03.94 /home/emilio/src/moz/gecko-2/obj-debug/dist/include/mozilla/mozalloc.h:22:32: note: expanded from macro 'MALLOC_DECL'
0:03.94     MOZ_MEMORY_API return_type name##_impl(__VA_ARGS__);
0:03.94                                ^
0:03.94 <scratch space>:178:1: note: expanded from here
0:03.94 realloc_impl
0:03.94 ^
0:03.94 /home/emilio/src/moz/gecko-2/obj-debug/dist/include/mozmemory_wrap.h:142:41: note: expanded from macro 'realloc_impl'
0:03.94 #define realloc_impl mozmem_malloc_impl(realloc)

   Which I really didn't feel like digging into.

 * I had to restore the order of TrustOverrideUtils.h and related files in nss
   because the .inc files depend on TrustOverrideUtils.h being included earlier.

 * I had to add a missing include to RollingNumber.h

 * Also had to partially restore include order in JsepSessionImpl.cpp to avoid
   some -WError issues due to some static inline functions being defined in a
   header but not used in the rest of the compilation unit.

Differential Revision: https://phabricator.services.mozilla.com/D60327

--HG--
extra : moz-landing-system : lando
2020-01-20 16:19:48 +00:00
Emilio Cobos Álvarez
aa3a695712 Bug 1609996 - Remove mozilla/Move.h. r=froydnj
rg -l 'mozilla/Move.h' | xargs sed -i 's/#include "mozilla\/Move.h"/#include <utility>/g'

Further manual fixups and cleanups to the include order incoming.

Differential Revision: https://phabricator.services.mozilla.com/D60323

--HG--
extra : moz-landing-system : lando
2020-01-20 16:18:20 +00:00
Emilio Cobos Álvarez
5cd5e6f148 Bug 1609996 - Remove mozilla::Swap in favor of std::swap. r=froydnj
Now mfbt/Move.h is empty except for that excellent comment about move
semantics... Should we put it somewhere else and delete the header as a
follow-up? Or just delete the header and carry on?

Differential Revision: https://phabricator.services.mozilla.com/D60297

--HG--
extra : moz-landing-system : lando
2020-01-20 16:17:06 +00:00
Sylvestre Ledru
cc2040bf21 Bug 1605934 - Use nested namespaces r=sg
Done with:
./mach static-analysis check --checks="-*, modernize-concat-nested-namespaces" --fix .
and then clang-format on the files

Differential Revision: https://phabricator.services.mozilla.com/D58217

--HG--
extra : moz-landing-system : lando
2020-01-18 13:48:34 +00:00
Dorel Luca
506e65bcab Backed out changeset bbb39655cf71 (bug 1605934) for build bustage in widget/gtk/mozwayland/mozwayland.c 2020-01-18 15:39:55 +02:00