Commit graph

50052 commits

Author SHA1 Message Date
martinfalisse
af26b76e0a LibWebView: Use Vector for arguments to WebContent
In a future commit will add some more conditional arguments to the
array and so it's easier to have it be a Vector.
2023-05-08 14:47:52 +02:00
martinfalisse
00e446facd Ladybird: Move arguments parsing before FontPluginQt init
In a future commit will pass arguments parsed to the FontPluginQt
constructor.
2023-05-08 14:47:52 +02:00
Nico Weber
65c7145e69 LibGfx/WebP: Move lossless decoder to its own file
Pure code move (except of removing `static` on the two public functions
in the new header), not behavior change.
2023-05-08 12:52:05 +02:00
Nico Weber
4f1c9a4ba2 LibGfx/WebP: Let decode_webp_chunk_VP8L_header() take ReadonlyBytes
Both callers already have the assert, and that way the function
doesn't have to know about Chunk.
2023-05-08 12:52:05 +02:00
Nico Weber
9d4da5af43 LibGfx/WebP: Store pointer to lossless data in VP8LHeader struct
This way, the size of the header in bytes is only known in
decode_webp_chunk_VP8L_header().
2023-05-08 12:52:05 +02:00
Nico Weber
5252f1cd60 LibGfx/WebP: Stop storing vp8_header and vp8l_header in context
They're not needed on the context.
2023-05-08 12:52:05 +02:00
Nico Weber
135b029250 LibGfx/WebP: Stop passing context to decode_webp_chunk_VP8L_contents()
It was used only for context.error(), and the calling code needs to
be changed to deal normal Errors anyways, since CanonicalCode can
produce them.
2023-05-08 12:52:05 +02:00
Nico Weber
97d085abea LibGfx/WebP: Stop passing context to decode_webp_chunk_VP8L_image()
It was used only for context.error(), and the calling code needs to
be changed to deal normal Errors anyways, since CanonicalCode can
produce them.
2023-05-08 12:52:05 +02:00
Nico Weber
356cadc350 LibGfx/WebP: Stop passing context to decode_webp_chunk_VP8L_prefix_code
It was used only for context.error(), and the calling code needs to
be changed to deal normal Errors anyways, since CanonicalCode can
produce them.
2023-05-08 12:52:05 +02:00
Nico Weber
2f1f62cb3b LibGfx/WebP: Stop passing context to decode_webp_chunk_VP8L_header()
It was used only for context.error(), and the calling code needs to
be changed to deal normal Errors anyways, since CanonicalCode can
produce them.
2023-05-08 12:52:05 +02:00
Andreas Kling
3f4de06fc2 LibWeb: Cache the root element font metrics when calculating them
The root element font metrics were getting queried again and again
during style computation. Before this change we would do some work to
recalculate them each time.

This patch simply caches them in a StyleComputer member. Since style
updates always start with the root element, we know that it'll be
up-to-date by the time we look at any other element.

Before this change, we were spending ~5% of CPU time on Google Groups
in root_element_font_metrics().
2023-05-08 12:13:20 +02:00
Ahmed Hussein
214eaebe73 LibGUI: Use cursor position when calculating autoscroll delta
Autoscroll delta now takes into account the cursor
position relative to the widget inner rect height
to allow for faster rubber band autoscrolling.
2023-05-08 11:28:52 +02:00
Andreas Kling
064b7a6216 LibWeb: Make HTMLObjectElement invalidate the document layout
This is an oversized hammer for sure, but we have to make sure the
layout tree gets rebuilt in case the object representation changes.
Since "throw out the entire layout tree" is the finest tool we have
right now, it'll have to do.

This fixes an issue where the eyes on Acid2 would sometimes not show up
until the next layout invalidation occurred.
2023-05-08 10:26:09 +02:00
Kenneth Myhra
11a89a9d6e Documentation: Add libslirp-dev as a required dependency for QEMU
After the update to QEMU 8.0 libslirp-dev is a required dependency.
2023-05-08 09:30:09 +02:00
Andreas Kling
70db40c9b0 LibWeb: Don't include Layout/Node.h from DOM/Element.h
This required moving the CSS::StyleProperty destruct out of line.
2023-05-08 09:29:44 +02:00
Andreas Kling
e43027091d LibWeb: Don't include HTML/Window.h from DOM/Element.h
This required moving HTML::ScrollOptions to its own header file.
2023-05-08 09:29:44 +02:00
Andreas Kling
ac0c30ce62 LibWeb: Don't include WindowGlobalMixin from DOM/Element.h 2023-05-08 09:29:44 +02:00
Andreas Kling
67d2e32984 LibWeb: Don't include DOM/NamedNodeMap.h from DOM/Element.h 2023-05-08 09:29:44 +02:00
Andreas Kling
f7678e2797 LibWeb: Don't include Layout/TreeBuilder.h from DOM/Element.h 2023-05-08 09:29:44 +02:00
Andreas Kling
4399ca2d82 LibWeb: Don't include CSS/CSSStyleDeclaration.h from DOM/Element.h
This required splitting out CSS::StyleProperty into its own file and
out-of-lining Element::layout_node().
2023-05-08 09:29:44 +02:00
Andreas Kling
5b5fbecb38 LibWeb: Don't include DOM/Attr.h from DOM/Element.h
This required moving Element::for_each_attribute() out of line, but that
seems harmless enough.
2023-05-08 09:29:44 +02:00
Andreas Kling
43616316de LibWeb: Don't include CSS/StyleComputer.h from Element.h and Document.h
This made editing StyleComputer.h unpleasant for no reason.
2023-05-08 09:29:44 +02:00
Kemal Zebari
5ba5beb50f Tests: Add more tests for JsonArray
At an attempt to detect future regressions in AK/JsonArray, this
snapshot adds additional tests for it to TestJSON.cpp.
2023-05-08 07:39:49 +01:00
Kenneth Myhra
03ca560b2d Ports: Update dosbox-staging to 0.77.1
This version of 'dosbox-staging' uses the meson build system.

Previous versions of dosbox-staging started in windowed mode with a
resolution of 320x200. This version starts in windowed mode with a
resolution of 640x480.

Audio was stuttering a bit in previous versions, but it sounds like it
might have become a bit worse. This is probably because of higher CPU
usage and the audio server/client not able to keep up.

Added a post_install() section to package script which outputs a link to
dosbox-staging's release notes.
2023-05-08 08:03:31 +02:00
Kenneth Myhra
9541f23376 Ports: Clean up 'package.sh' for dosbox-staging
This makes dosbox-staging's 'package.sh' conform to our coding standards
for bash scripts.
2023-05-08 08:03:31 +02:00
Kenneth Myhra
4eaac2ff1e Ports: Add opusfile 0.12 2023-05-08 08:03:31 +02:00
Kenneth Myhra
748289211a Ports: Add libopus 1.3.1 2023-05-08 08:03:31 +02:00
Ben Wiederhake
ac5cef1b66 LibCrypto+LibTLS: Avoid crashing on invalid input
Fixes #18307.
2023-05-08 06:43:28 +02:00
Andreas Kling
f37f081f15 LibWeb: Don't relayout when visibility changes between visible/hidden
Layout will be identical for both of those values, so only a repaint is
necessary. If it changes to/from "collapse" however, we do need to
relayout. This means we can't simply use the "affects-layout" mechanism.
We have to write a little bit of custom code.

This makes Google Groups (and surely many other sites) significantly
more responsive by avoiding large amounts of layout work.
2023-05-08 06:42:17 +02:00
Pankaj Raghav
53d47c6614 Documentation: Update information regarding MSIx for NVMe :^)
Now we support MSIx for NVMe. Retain the information about using
nvme_poll until MSIx is tested on a Bare metal system.
2023-05-07 21:16:41 +02:00
Pankaj Raghav
9b3b0531e5 Kernel: Add MSIx support to NVMe
Add MSIx support to NVMe. Prefer MSIx over pin-based interrupts as they
are more efficient and all modern hardware support them.
2023-05-07 21:16:41 +02:00
Pankaj Raghav
bfcf7ab3e8 Kernel: Pass NVMeController reference to NVMequeue
This is in preparation for adding MSI(x) support to the NVMe device.
NVMeInterruptQueue needs access to the PCI device to deal with MSI(x)
interrupts. It is ok to pass the NVMeController as a reference to the
NVMeQueue as NVMeController is the one that owns the NVMeQueue.

This is very similar to how AHCIController passes its reference to its
interrupt handler.
2023-05-07 21:16:41 +02:00
Pankaj Raghav
693e3419b7 NVMe: Use an explicit Queue type instead of using an Optional irq
Add an explicit QueueType enum which could be used to create a poll or
an interrupt queue. This is better than passing an Optional<irq>.

This refactoring is in preparation for adding MSIx support to NVMe.
2023-05-07 21:16:41 +02:00
Pankaj Raghav
feb48cbc7c Kernel: Introduce PCIIRQHandler
PCIIRQHandler is a generic IRQ handler that the device driver can
inherit to use either Pin or MSI(x) based interrupt mechanism.

The PCIIRQHandler can do what the existing IRQHandler can do for pin
based interrupts but also deal with MSI based interrupts. We can
hopefully convert all the PCI based devices to use this handler so that
MSI(x) can be used.
2023-05-07 21:16:41 +02:00
Pankaj Raghav
82cf0bfb75 Kernel: Add APIs to PCI Device to use MSI(x)
Add reserve_irqs, allocate_irq, enable_interrupt and disable_interrupt
API to a PCI device.

reserve_irqs() can be used by a device driver that would like to
reserve irqs for MSI(x) interrupts. The API returns the type of IRQ
that was reserved by the PCI device. If the PCI device does not support
MSI(x), then it is a noop.

allocate_irq() API can be used to allocate an IRQ at an index. For
MSIx the driver needs to map the vector table into the memory and add
the corresponding IRQ at the given index. This API will return the
actual IRQ that was used so that the driver can use it create interrupt
handler for that IRQ.

{enable, disable}_interrupt API is used to enable or disable a
particular IRQ at the given index. It is a noop for pin-based
interrupts. This could be used by IRQHandler to enable or disable an
interrupt.
2023-05-07 21:16:41 +02:00
Pankaj Raghav
f0b6eb6932 Kernel: Implement helpers to manipulate MSI(x) data structures
MSIx table entry is used to program interrupt vectors and it is
architecture specific. Add helper functions declaration in
Arch/PCIMSI.h. The definition of the function is placed in the
respective arch specific code.
2023-05-07 21:16:41 +02:00
Pankaj Raghav
bf7ac06d7b Kernel: Implement {enable,disable}_msix interrupts in PCI Device
Implement enabling and disabling MSIx interrupts for a PCI device.

Removes two TODO()s from PCI::Device.cpp :^)
2023-05-07 21:16:41 +02:00
Pankaj Raghav
d3bb63afff Kernel: Use PCIIdentifier is_msix_capable API to retrieve MSIx status
Instead of iterating through the capabilities, use the
is_msix_capable() API from the PCIIdentifier class that belongs to the
device.
2023-05-07 21:16:41 +02:00
Pankaj Raghav
d0fbaf790a Kernel: Add MSIxInfo struct to PCI DeviceIdentifier
Add a struct named MSIxInfo that stores all the relevant MSIx
information as a part of PCI DeviceIdentifier struct.

Populate the MSIx struct during the PCI device init. As the
DeviceIdentifier struct need to populate MSIx info, don't mark
DeviceIdentifier as const in the PCI::Device class.
2023-05-07 21:16:41 +02:00
Pankaj Raghav
71c75873c9 Kernel: Add write{8,16,32} to the PCI Capability struct
MSI(x) mechanism requires the device to write to its Capability
structure. Add write{8,16,32} similar to read{8,16,32}.
2023-05-07 21:16:41 +02:00
Pankaj Raghav
91da264a4c Kernel: Add reserve_interrupt_handlers API
MSI(x) interrupts need to reserve IRQs so that it can be programmed by
the device. Add an API to reserve contiguous ranges of interrupt
handlers so that it can used by PCI devices that use MSI(x) mechanism.

This API needs to be implemented by aarch64 architecture.
2023-05-07 21:16:41 +02:00
Pankaj Raghav
a5ec5f07fa Kernel/PCI: Set IRQ as reserved for pin-based interrupts
Set pin-based interrupt handler as reserved during PCI bus init.
This is required so that MSI(x) based interrupts can avoid sharing the
IRQ which has been marked as reserved.
2023-05-07 21:16:41 +02:00
Pankaj Raghav
e5cc78e9db Kernel: Add m_reserved private variable to GenericInterruptHandler
Pin-based PCI device are allocated an IRQ, and it could be shared with
multiple devices. An interrupt handler with an IRQ for a PCI device
will get registered only during the driver initialization.

For MSI(x) interrupts, the driver has to allocate IRQs and this field
can be used to skip IRQs that have already been reserved by pin-based
interrupts so that we don't have to share IRQs, which generally will
reduce the performance.
2023-05-07 21:16:41 +02:00
MacDue
b5e593d0e7 Ladybird: Don't ask Qt to decode any images for us
We should only rely on LibGfx to decode images for us, if LibGfx
can't decode an image that should be motivation to improve LibGfx,
not hidden by Qt picking up the slack :^)
2023-05-07 21:13:02 +02:00
thankyouverycool
af8cd477b4 LibGUI: Always paint vertical lines for Frames in unmaximized windows
Fixes incorrect thread highlighting for ResourceGraph panels.

Prior to FrameStyles, these graphs were painted as faux-panels,
this is, sunken containers with a thickness of 1, and weren't
subject to the bug.
2023-05-07 21:12:35 +02:00
Andreas Kling
222a1b8b95 LibWeb: Don't force relayout on scheduled layout update
If something else has already caused a layout, there's no need to force
a new relayout when the layout timer fires.

This avoids a lot of redundant work on many pages. :^)
2023-05-07 21:00:12 +02:00
Kenneth Myhra
50413c2326 Toolchain: Replace inline nproc with get_number_of_processing_units() 2023-05-07 14:29:25 +02:00
Kenneth Myhra
36c892ae14 Meta: Add get_number_of_processing_units() to shell_include.sh
This adds the method get_number_of_processing_units() which returns the
number of processing units the system has available.
2023-05-07 14:29:25 +02:00
Ben Wiederhake
449911c286 Chess: Slightly improve error propagation during startup 2023-05-07 14:04:55 +02:00
Ben Wiederhake
0fe29a48ad Chess: Avoid IODevice and DeprecatedFile 2023-05-07 14:04:55 +02:00