Commit graph

49636 commits

Author SHA1 Message Date
Lucas CHOLLET
b35a6b206b IPCMagicLinter: Use LibMain 2023-04-27 07:26:32 +02:00
Timothy Flynn
4dcdc3bd25 Ladybird: Prohibit GUI interaction of the WebContent process on macOS
The WebContent process behaves a bit awkwardly on macOS. When we launch
the process, we have to create a QGuiApplication to access system fonts.
But on macOS, doing so creates an entry in the Dock, and also causes the
WebContent to be focused. So if you enter cmd+Q without first focusing
the Ladybird GUI, WebContent is closed, while the Ladybird process keeps
running.
2023-04-27 07:26:05 +02:00
Andreas Kling
cc86c07f58 LibGfx: Transform the x axis rotation for elliptical arcs
Without this, copy_transformed() will create paths with bogus elliptical
arcs. This was very noticeable with transformed ellipses in SVG.
2023-04-27 07:24:53 +02:00
Andreas Kling
a77accf3f4 LibGfx: Add AffineTransform::rotation()
Extracts the rotation from a 2D matrix.
2023-04-27 07:24:53 +02:00
Fabian Dellwing
8c1dacecba nc: Add -n option to suppress name resolution 2023-04-26 12:33:25 -06:00
Fabian Dellwing
7cfa108fad nc: Add -p option
With this change we support the well-known and shorter way to
create a listener on all interfaces:

`nc -lvp 1337`

instead of:

`nc -lv 0.0.0.0 1337`
2023-04-26 12:33:25 -06:00
Fabian Dellwing
eff3f52bda nc: Fix off-by-one-error in calls to inet_ntop 2023-04-26 12:33:25 -06:00
Fabian Dellwing
552e317a89 nc: Sort command line arguments alphabetically 2023-04-26 12:33:25 -06:00
Andreas Kling
f61947fa9e LibCore: Remove unused EventLoopManager::wake()
Only EventLoopImplementation needs to know how to wake up.
2023-04-26 19:17:04 +01:00
Andreas Kling
12c73915dc Tests: Re-enable TestLibCoreFileWatcher on macOS
Now that cross-thread event posting is unbroken, this should work.
2023-04-26 19:17:04 +01:00
Andreas Kling
b61a87c03c LibCore: Move post_event() back to EventLoopImplementation
This shouldn't have been moved to EventLoopManager, as the manager is
global and one-per-process, and the implementation is one-per-loop.

This makes cross-thread event posting work again, and unbreaks
SoundPlayer (and probably other things as well.)
2023-04-26 19:17:04 +01:00
Andreas Kling
7035a19645 LibAudio: Wait for enqueuer thread to start before poking its event loop 2023-04-26 19:17:04 +01:00
Fabian Dellwing
6990d4e025 Ports: Cleanup the build process a bit for taskwarrior 2023-04-26 16:54:31 +02:00
Aliaksandr Kalenik
3c89286467 LibWeb: Implement creation of fresh top-level traversables
Co-authored-by: Andreas Kling <kling@serenityos.org>
2023-04-26 15:51:50 +02:00
Aliaksandr Kalenik
9a19bdbfcf LibWeb: Implement Navigable::initialize_navigable() 2023-04-26 15:51:50 +02:00
Aliaksandr Kalenik
74ab8ec4f0 LibWeb: Add step property in SessionHistoryEntry 2023-04-26 15:51:50 +02:00
Timothy Flynn
61c0174fec Browser+Ladybird: Render text in the JS console with a monospace font 2023-04-26 15:43:57 +02:00
Timothy Flynn
d44df16704 Ladybird: Explicitly set the font family for CSS generic fonts
We currently query Qt for system fonts using QFont::setStyleHint(). The
docs from Qt have the following note regarding this API on X11:

    Qt does not support style hints on X11 since this information is not
    provided by the window system.

This prevents any monospace font from working on X11 systems. For now,
work around this by specifying the font-family for fonts which Qt has
listed as mapping to a CSS generic font-family.
2023-04-26 15:43:57 +02:00
LekKit
9fe6dcb50b Ports: Use makeopts in RVVM port 2023-04-26 12:48:56 +02:00
LekKit
1a3009fa2b Ports: Fix RVVM port syntax 2023-04-26 12:48:56 +02:00
LekKit
12730cefce Ports: Add RVVM port 2023-04-26 12:48:56 +02:00
iyush
ac435f914c LibCpp: Support for parsing c-style fixed arrays (arr[2])
Also adds tests for finding declaration of arrays inside
CppComprehension which requires proper parsing for passing.

Side-effect of this patch: if we ctrl+click on array variables, it
should jump to the correct declaration inside HackStudio.
2023-04-26 09:40:25 +01:00
Jelle Raaijmakers
34b04271f4 Ports/SDL2: Handle window close requests correctly
We were going about this the wrong way:

* We should not send `SDL_QUIT` events; SDL2 is doing this for us
  already when the last window is closed, for example.
* The `SDL_WINDOWEVENT_CLOSE` event does not represent a closed window,
  but rather a _request_ from the window manager to close a window.

This resolves the issue with the PrBoom+ port where the quit screen
would not be shown when trying to close the main window.
2023-04-26 09:37:16 +01:00
Jelle Raaijmakers
e283dfdeb6 Ports/scummvm: Enable release mode
This brings the binary's size down to 100 MiB, from about 600 MiB. The
`--enable-optimizations` flag is implied with `--enable-release`.
2023-04-26 09:37:16 +01:00
Jelle Raaijmakers
62843befca Ports/SDL2: Stop the audio client when device is closed
This ensures all threads and event loops on the audio client's side are
shut down.
2023-04-26 09:37:16 +01:00
Jelle Raaijmakers
bff5137cb4 Ports/gltron: Exit the game when SDL_QUIT is received 2023-04-26 09:37:16 +01:00
Andreas Kling
7465362fe7 LibWeb: Clamp CSS z-index to the range of a 32-bit integer
This appears to be consistent with other engines, and fixes many pages
where we were misinterpreting super large z-index values as something
else entirely.
2023-04-26 09:44:43 +02:00
Andreas Kling
cead039e7e Tests: Disable TestLibCoreFileWatcher on macOS temporarily
This broke somehow with the new event loop architecture and will need
debugging, but let's bring the CI back to green first.
2023-04-26 06:34:05 +02:00
Ali Mohammad Pur
6d48719069 Utilities: Add support for loading the WASI module to wasm 2023-04-26 03:47:15 +03:30
Ali Mohammad Pur
7e4e9fdb8f LibWasm: Start implementing WASI
This commit starts adding support for WASI, along with the framework to
implement all the functions (though only a couple are currently
implemented).
2023-04-26 03:47:15 +03:30
Ali Mohammad Pur
eceb244bef LibWasm: Allow Value::to<T>() to perform statically valid conversions
e.g. i32 -> i16 (if within range).
2023-04-26 03:47:15 +03:30
Zaggy1024
b10da81c7c LibVideo: Fast-path converting colors by only matrix coefficients
We don't need to run through the whole floating-point color converter
for videos that use sRGB transfer characteristics and BT.709 color
primaries. This commit adds a new templated inlining function to
ColorConverter to do a very fast fixed-point YCbCr to RGB conversion.

With the fast path, frame conversion times go from ~7.8ms down to
~3.7ms. The fast path can benefit a lot more from extra SIMD vector
width, as well.
2023-04-25 17:44:36 -04:00
Zaggy1024
d6b867ba89 LibVideo/VP9: Force inlining of inverse_transform_2d() and the IDCT
Clang was reluctant to inline these for some reason. However, inlining
them seems to be quite beneficial, reducing decoding time in an intra-
heavy video by about 21% (~12.7s -> ~10.0s).
2023-04-25 17:44:36 -04:00
Zaggy1024
90c0e1ad8f LibVideo/VP9: Pre-calculate the quantizers at the start of each frame
Quantizers are a constant for the whole frame, except when segment
features override them, in which case they are a constant per segment
ID. We take advantage of this by pre-calculating those after reading
the quantization parameters and segmentation features for a frame.
This results in a small 1.5% improvement (~12.9s -> ~12.7s).
2023-04-25 17:44:36 -04:00
Zaggy1024
094b0d8a78 LibVideo/VP9: Use an enum to select segment features
This throws out some ugly `#define`s we had that were taking the role
of an enum anyway. We now have some nice getters in the contexts that
take the place of the combo of `seg_feature_active()` and then doing a
lookup in `FrameContext::m_segmentation_features` directly.
2023-04-25 17:44:36 -04:00
Zaggy1024
6e6cc1ddb2 LibVideo/VP9: Make a lookup table for bit reversals
Bit reversals are used very often in intra-predicted frames. Turning
these into a constexpr lookup table reduces the branching needed for
block transforms significantly. This reduces the times spent decoding
an intra-heavy 1080p video by about 9% (~14.3s -> ~12.9s).
2023-04-25 17:44:36 -04:00
Zaggy1024
f6764beead LibVideo/VP9: Specialize transforms on their block size
Previously, the block sizes would be checked at runtime to
determine the transform size to apply for residuals. Making the block
sizes into constant expressions allows all the loops to be unrolled
and reduces branching significantly.

This results in about a 26% improvement (~18s -> ~13.2s) in speed in an
intra-heavy test video.
2023-04-25 17:44:36 -04:00
Zaggy1024
5b4c1056f1 LibVideo/Color: Always inline convert_yuv_to_full_range_rgb()
Inlining the color conversion reduces time spent for frame conversions
in a 1080p video from ~12ms down to ~9ms.
2023-04-25 17:44:36 -04:00
Zaggy1024
8ad0dff5c2 LibVideo/VP9: Implement unscaled fast paths in inter prediction
Inter-prediction convolution filters are selected based on the
subpixel position determined for the motion vector relative to the
block being predicted. The subpixel position 0 only uses one single
sample in the center of the convolution, not averaging any other
samples. Let's call this a copy.

Reference frames can also be a different size relative to the frame
being predicted, but in almost every case, that scale will be 1:1
for every single frame in a video.

Taking into account these facts, we can create multiple fast paths for
inter prediction. These fast paths are only active when scaling is 1:1.

If we are doing a copy in both dimensions, then we can do a straight
memcpy from the reference frame to the output block buffer. In videos
where there is no motion, this is a dramatic speedup.

If we are doing a copy in one dimension, we can just do one convolution
and average directly into the output block buffer.

If we aren't doing a copy in either dimension, we can still cut out a
few operations from the convolution loops, since we only need to
advance our samples by whole pixels instead of subpixels.

These fast paths result in about a 34% improvement (~31.2s -> ~20.6s)
in a video which relies heavily on intra-predicted blocks due to high
motion. In videos with less motion, the improvement will be even
greater.

Also, note that the accumulators in these faster loops are only 16-bit.
High bit-depth videos will overflow those, so for now the fast path is
only used for 8-bit videos.
2023-04-25 17:44:36 -04:00
Zaggy1024
8cd72ad1ed LibVideo/VP9: Use the Y scale value in predict_inter_block()
A typo caused the Y scale value to never be used, so if a reference
frame's aspect ratio didn't match up with the current frame's, it would
decode incorrectly.

Some comments have been added to clarify the frame-constants used in
the function as well.
2023-04-25 17:44:36 -04:00
Zaggy1024
7a58577fee LibVideo: Convert subsampled frames in a vectorization-friendly way
This change reduces the time spent converting frames for display in
a 1080p video from ~19ms per frame to ~12ms per frame.
2023-04-25 17:44:36 -04:00
Zaggy1024
f2c0cee522 LibVideo/VP9: Consolidate frame size calculations
This moves all the frame size calculation to `FrameContext`, where the
subsampling is easily accessible to determine the size for each plane.
The internal framebuffer size has also been reduced to the exact frame
size that is output.
2023-04-25 17:44:36 -04:00
Zaggy1024
57c7389200 LibVideo/VP9: Fix rounding of components in the motion vector selection
The division in the `round_mv_...()` functions contained in the motion
vector selection process was done by bit shifting right. However, since
bit shifting negative values will truncate towards the negative end, it
was flooring instead of rounding.

This changes it to match the spec and rely on the compiler to simplify
down to a bit shift.
2023-04-25 17:44:36 -04:00
Jelle Raaijmakers
7b10c8048c WindowServer: Draw stretched wallpapers with bilinear blending
This improves the quality of stretched photos and artwork considerably,
and I'd argue that this is what users will expect by default.
2023-04-25 22:37:57 +02:00
Fabian Dellwing
6acf03d9a8 Ports: Add default zshrc
Previosly we had a very messed up PS1 as the Shell PROMPT is not
unset correctly.

We now provide a default `zshrc` file for the system that uses
sane values for basic categories like aliases, autocompletion and
history management to make the port more usable. It also forces
the prompt to be the default zsh one.
2023-04-25 20:48:51 +02:00
Timothy Flynn
3d4d0a1243 Kernel: Colorize log message for paths which haven't been unveiled
The log message can be hard to spot in a sea of debug messages. Colorize
it to make the message more immediately pop out.
2023-04-25 18:04:15 +02:00
nipos
938a4e26b5 LibCore: Include sys/ucred.h in System.h for FreeBSD 2023-04-25 18:04:05 +02:00
Timothy Flynn
374a24d84c LibVideo: Remove hook to override LibVideo's playback timers
This was added to allow Ladybird to override the timers with Qt timers.
2023-04-25 18:02:22 +02:00
Timothy Flynn
78ad471367 LibWeb: Remove custom playback timer from HTMLMediaElement
After the EventLoop changes, we do not need to override LibVideo's timer
with a Qt timer for Ladybird. The timer callback provided here also does
not need the JS::SafeFunction wrapper that Platform::Timer provides.
2023-04-25 18:02:22 +02:00
Andreas Kling
e5b97f4a57 WebContent: Always update layout before dumping layout tree
This fixes an issue where layout tests were sometimes flakey because
we tried dumping the layout tree before one had been built(!)
2023-04-25 18:01:35 +02:00