Commit graph

62783 commits

Author SHA1 Message Date
Aliaksandr Kalenik 8db700033d LibWeb: Replace SDFs with vector paths in CheckBoxPaintable
Initially, SDF rendering was adopted for checkbox rendering because our
vector path renderer had not yet matured. This is no longer the case.

(cherry picked from commit 20c506f59747879d64c1b56fa58c6dd0e114e443)
2024-09-13 13:44:29 -04:00
Aliaksandr Kalenik 6fea053334 LibWeb+LibGfx: Replace usage of Gfx::PaintStyle in fill{stoke}_commands
...with a struct defined in LibWeb. This is a step towards uncoupling
LibWeb from LibGfx, so we can try third-party libraries for painting.

(cherry picked from commit 7a04a95c8a80ac115298b4107aed37f157133fe8)
2024-09-13 12:56:40 -04:00
Aliaksandr Kalenik f7227550a7 LibWeb+WebContent: Move PageClient::paint() into TraversableNavigable
This way we leak less LibWeb implementation details into WebContent.

(cherry picked from commit cbd566a3543d5ad50db3b68890ff23f76ca3b4bd)

Patched to fix build on SerenityOS

Co-authored-by: circl <circl.lastname@gmail.com>
2024-09-13 11:11:24 -04:00
Aliaksandr Kalenik aae5ad0b7c LibWeb: Rename Navigable::paint() to record_painting_commands()
This method does not paint, but only records painting commands that
could be passed to painting commands executor, which will perform
actual painting.

(cherry picked from commit c7133faf264901ace5e1fb3b97aaddc504d45005)
2024-09-13 11:11:24 -04:00
Aliaksandr Kalenik 0ff61064fd LibWeb: Implement rejection by bounding box for PaintInnerBoxShadow
Before this change we were painting inner shadows lying outside of
viewport.

Improves painting performance on Github and Twitter where this command
is used a lot.

(cherry picked from commit 9be5867eb2f52c05a34024771ddffb6b981c878f)
2024-09-13 11:10:33 -04:00
Aliaksandr Kalenik ac67bc511d LibWeb: Rename PaintOuterBoxShadowParams to PaintBoxShadowParams
Drop "outer" from the name because this struct is used for both inner
and outer shadows.

(cherry picked from commit 1c8d37d528424cad7d0c951ba87bddac33d65421)
2024-09-13 11:10:33 -04:00
logkos 3abaf9f3f8 Kernel/Net: Remove obsolete diagnostic trick 2024-09-12 15:57:11 -04:00
Tim Ledbetter 269018a26f LibWeb: Ensure anchor node is not null when extending selection
Previously, clicking while holding shift without having previously made
any text selection would cause a crash.

(cherry picked from commit c79041344d7f9957bf810cd4db5330d8006ef0e3)
2024-09-12 15:56:40 -04:00
Tim Ledbetter 9728fea47a LibWeb: Extend text selection when left clicking and holding shift
(cherry picked from commit f7212304563b4609577c0dd70db459669c723563)
2024-09-12 15:56:40 -04:00
Aliaksandr Kalenik a8a509ab10 LibWeb: Use ints instead of DevicePixels in PaintOuterBoxShadowParams
DevicePixels concept should not leak from painting recording phase.

(cherry picked from commit 22bb476b6fe078e34a9dbf50800c521e909929ea)
2024-09-12 15:56:12 -04:00
Aliaksandr Kalenik 7dde814b78 LibWeb: Remove unused members in PaintOuterBoxShadowParams
This struct had all members in CSSPixels and DevicePixels, but only the
latter are needed for painting.

Shrinks PaintOuterBoxShadowParams from 144 bytes to 72 bytes.

(cherry picked from commit 2dd3b6fcffce3b40ce8d0fe6333cd85b3464609e)
2024-09-12 15:56:12 -04:00
Sönke Holz 76bd6115cb CI: Don't build AArch64 QEMU in CI
We now get the command line from the flattened devicetree, so manually
building a newer QEMU version to make the RPi "Get command line" mailbox
message work is not necessary anymore.
2024-09-11 12:47:12 -04:00
Sönke Holz 327e498463 Kernel/aarch64: Remove some unused RPi mailbox query functions
These have been unused since f74f80e13b.
2024-09-11 12:47:12 -04:00
Sönke Holz 815361aec2 Kernel/aarch64: Remove BootPPMParser.{cpp,h}
The BootPPMParser has been unused since 0acd87954b.
2024-09-11 12:47:12 -04:00
Sönke Holz b41365d11d Tests/Kernel: Add some more EFAULT tests 2024-09-11 12:45:56 -04:00
Sönke Holz c2aea15c9b Tests/Kernel: Build TestMemoryDeviceMmap only on x86
This test is very x86-specific, it expects specific memory regions
to be present at certain physical addresses.
2024-09-11 12:45:56 -04:00
Sönke Holz 19c391ed6f Kernel/riscv64: Actually implement safe SafeMem functions
This causes the riscv64 kernel to no longer panic on failed (userspace)
memory accesses.
2024-09-11 12:45:56 -04:00
Lucas CHOLLET ba9875c56f LibGfx/JPEGXL: Add support for decoding embedded ICC profiles
The test case was generated by opening `modular_property_8.jxl` in
Krita, then changing the Color Profile to Apple RGB and then exporting
as PNG. Finally, the conversion to JPEGXL was made with:
`cjxl --container=0 --modular=1 -d 0 -e 9 file.png icc.jxl`

Note that, we can't use Krita to export a jxl as it always create a
container instead of a raw stream. Also, this needs an old version of
`cjxl` (I used 0.7), as more recent version reencode the ICC profile
using the JPEGXL's internal representation for color profile, which is
encoded differently.
2024-09-09 21:18:38 -04:00
Lucas CHOLLET 5983e774eb LibGfx/JPEGXL: Move the entropy decoder to its own file
No functional change.
2024-09-09 21:18:38 -04:00
Lucas CHOLLET b88b0e9a3f LibGfx/JPEGXL: Explicitly use our own integral math
No expected functional change.
2024-09-09 21:18:38 -04:00
Lucas CHOLLET 469fb26e61 LibGfx/JPEGXL: Move some functions to a common header
The decoder, while being far from complete is already a huge file. Let's
split it in multiple files. This commit is the first step toward this
goal.

No functional change.
2024-09-09 21:18:38 -04:00
Nico Weber 32720f3a2d Userland: Use read_until_eof() more
No intended behavior change.
2024-09-09 23:25:08 +02:00
famfo 36b7cac605 SystemMonitor: Display IPv6 addresses on adapters 2024-09-08 18:27:55 -04:00
famfo e7fe821f86 ifconfig: Display IPv6 addresses
This commit displays IPv6 addresses and netmasks of adapters if
present. Also adds a check to omit IPv4 addresses if e.g. a system
is running IPv6 only.
2024-09-08 18:27:55 -04:00
kleines Filmröllchen d6b37e40df Kernel/Net: Naive IPv6 autoconfiguration
This commit introduces very naive IPv6 autoconfiguration by just
setting fe80::{mac address} as the adapters link local address every
time the link state comes up. Note: this is currently not compliant
with RFC4862 which mandates Duplicate Address Detection, which is
missing from this implementation.

Co-authored-by: famfo <famfo@famfo.xyz>
2024-09-08 18:27:55 -04:00
famfo c57b1c319b Kernel/SysFS: Expose IPv6 information for adapters
This commit adds the ipv6_address and ipv6_netmask parameters to the
adapters SysFS JSON if present on the interface.
2024-09-08 18:27:55 -04:00
kleines Filmröllchen ac44ec5ebc Kernel+ifconfig: Allow setting an IPv6 address on an interface
Since we take a socket address with an address
type, this allows us to support setting an IPv6
address using an IPv4 socket without a
particularly hacky API. This deviates from Linux's
behavior (see
https://www.man7.org/linux/man-pages/man7/netdevice.7.html
) where AF_INET6 uses a completely different
control structure, but this doesn't seem
necessary.

This requires changing the sockaddr size to fit
sockaddr_in6, as the network ioctl's are the only
place where sockaddr is used with a fixed size
(and not with variable size data like in POSIX
APIs, which would support sockaddr_in6 without
changes).

ifconfig takes a new parameter for setting the
IPv6 address of an interface. The IPv4 address
short option '-i' is removed, as it only yields
confusion (which IP version is the default? and
usually such options are called -4 or -6, if they
exist) and isn't necessary thanks to the brief
long option name.

This commit's main purpose for now is to allow
participating in IPv6 NDP and pings without
requiring SLAC.

Co-authored-by: Dominique Liberda <ja@sdomi.pl>
2024-09-08 18:27:55 -04:00
sdomi 81eae154b7 Kernel/Net: Add basic IPv6 address support to NetworkAdapter 2024-09-08 18:27:55 -04:00
kleines Filmröllchen d21ee3206e AK: Add IPv6 subnet and address category handling
IPv6Address can now determine the broad address
categories as defined in various RFCs, and check
if addresses belong to certain subnets.
2024-09-08 18:27:55 -04:00
landonbr 37424ade04 Kernel/riscv64: Fix typo in naming of Devicetree 2024-09-08 14:19:57 -04:00
Sönke Holz 1d83f73ec5 Kernel/PCI: Stop using a dangling pointer in dmesgln_pci
VariadicFormatParams only stores pointers to the parameters, so
the device.device_name() parameter will dangle.

This fixes broken dmesgln_pci output on riscv64 GCC.
2024-09-07 12:52:52 -04:00
Nico Weber b72136cad5 LibCompress: Remove needless check
I added this check in #18216 in commit 6d38824985.

Back then, I mentioned that `m_bit_codes` is only used for writing,
but only added reading support. `CanonicalCode::from_bytes()` sets
up both tables for reading and writing, so I needed the construction
of the writing tables to not crash. This check in
`CanonicalCode::write_symbol()` was dead code back then though.

Later, #24700 added support for writing WebP files, and it can create
canonical codes with more than 288 symbols. This works just fine, is
now under test, and this check in `write_symbol()` isn't needed
(and never was). So remove it again.

No behavior change.

(I saw this in the profiler once, so maybe a tiny speedup for
writing deflate-compressed data, but on the order of < 2%.)
2024-09-06 18:09:29 -04:00
Sönke Holz b628ab0ae3 Kernel/riscv64: Add comment about the bss to the linker script 2024-09-06 16:02:08 -04:00
Sönke Holz ed3fa378c5 Kernel/riscv64: Add FLAGS to the PHDRS linker script command
Otherwise validate_program_headers will complain about the kernel text
segment being executable and writable.
2024-09-06 16:02:08 -04:00
Liav A. 3e7eb30466 Utilities/du: Add an option to print the total size in the end
This is useful when using du on many files and wanting to get a total
size count in the end after iterating on all the directories and files.
2024-09-05 16:36:12 +02:00
Liav A. c23005a3f0 Utiltities/elfdeps: Add an option to only print library paths
This is useful for argument passing to other utilities on the terminal.
2024-09-05 16:36:12 +02:00
Liav A. 0482f4e117 Kernel: Remove passing of register state to IRQ handlers
Linux did the same thing 18 years ago and their reasons for the change
are similar to ours - https://github.com/torvalds/linux/commit/7d12e78

Most interrupt handlers (i.e. IRQ handlers) never used the register
state reference anywhere so there's simply no need of passing it around.
I didn't measure the performance boost but surely this change can't make
things worse anyway.
2024-09-01 21:00:18 +02:00
Liav A. fdf3e0aca1 Kernel: Don't assume sizes of needed buffers early in the execve syscall
Instead, start by trying to read a buffer with size of Elf_Ehdr, and
check it for the shebang sign. If it's indeed an executable with shebang
then read again from the file, now with PAGE_SIZE size, which should
suffice for finding the interpreter path.

However, if the executable is an ELF, we quickly validate it and then
pass the preliminary buffer to the find_elf_interpreter_for_executable
method.

That method calculates the last byte offset which is needed to read all
of the program headers, so we don't just assume 4096 bytes is sufficient
anymore. The same pattern is applied when loading the interpreter ELF
main header and its program headers.
2024-09-01 20:52:55 +02:00
Tim Ledbetter f5cfee08d7 Ports/devilutionX: Update to version 1.5.3 2024-09-01 01:26:21 +02:00
brody-qq 44a2157e2e Kernel/Ext2FS: Reduce allocations in compute_block_list_impl()
In Ext2FSInode::compute_block_list_impl(), each call to
process_block_array() creates a new ByteBuffer, which leads to a
kmalloc() call. The ByteBuffer is then discarded when
process_block_array() exits, leading to a kfree() call.

This leads to repeated kmalloc() and kfree() calls as ByteBuffers are
created and destroyed each time process_block_array() is called.

This commit makes it so that only 1 ByteBuffer is created for each level
of inode indirect block (so only 3 ByteBuffers are created at most).
These ByteBuffers are re-used on each call to process_block_array().

This reduces the number of kmalloc() and kfree() calls during
compute_block_list_impl(), especially for larger files.
2024-08-30 22:22:13 +02:00
Dan Klishch 500ff2a7ed AK: Declare AK::Coroutine<T>::CoroutinePromiseBase::unhandled_exception
For some reason, Clang wants AK to work with exceptions enabled so much
that it produces a very annoying warning complaining about the absence
of (completely useless in our setup) unhandled_exception method in
promise type for every coroutine declared. We work around this during
build by suppressing -Wcoroutine-missing-unhandled-exception in
Meta/CMake/common_compile_options.cmake. However, the flag is only added
if build is using Clang. If one builds coroutine code with GCC but still
uses clangd, clangd, obviously, doesn't pick up warning suppression and
annoys user with a squiggly yellow line under each coroutine function
declaration.
2024-08-29 13:28:42 +02:00
Dan Klishch 3d3dd46618 AK: Rename AsyncStreamBuffer -> StreamBuffer
There is not nearly enough async-specific stuff in AsyncStreamBuffer for
it to carry "Async" prefix.
2024-08-29 13:28:42 +02:00
Dan Klishch c3e13ce420 AK: Do not return value from void must_sync<void>(...) 2024-08-29 13:28:42 +02:00
Sönke Holz a9a63c0f7c CI: Build riscv64 in CI
Don't run any tests on riscv64 for now, since some tests still fail
(mostly due to missing generic AK/Math.h implementations).
2024-08-27 12:03:49 +02:00
Dan Klishch 3ead8e8f4f AK: Make workaround for broken coroutine type deduction more specific
This bug was fixed on GCC trunk.
2024-08-26 17:47:03 +02:00
MacDue ba21a17b75 shot: Use "popup" window type for screenshot area selection
This allows the selection to appear above all normal window types
including the task bar.
2024-08-25 15:34:38 +01:00
Alec Murphy d73bad14ea LibIMAP+Mail: Show unseen message count for mailboxes
This PR implements the standard behavior of displaying the mailbox name
and parenthesized unseen message count in bold when the unseen message
count is greater than zero.
2024-08-24 21:52:44 -04:00
A* Ulven 4ac1ad48a2 LibVT: Handle concealed ANSI escape codes 2024-08-24 12:38:35 -04:00
Alec Murphy 99b01816ad Base: Add poweroff alias to shellrc
Just a little QoL improvement for muscle memory :^)
2024-08-23 22:16:50 +02:00
Nico Weber af0fe2374d Tests: Modernize TestDeflate a bit
- Use TRY_OR_FAIL() instead of MUST() in a few places
- Use for-each loop in two tests
- Use StringView literals instead of u8 arrays in a few places

No behavior change.
2024-08-23 14:54:37 -04:00