Commit graph

59563 commits

Author SHA1 Message Date
Aliaksandr Kalenik 1bd20a4595 LibWeb: Skip large stacking context in gpu painter only if it allocates
Skipping all stacking contexts with a size larger than 10000px in one
dimension was a mistake because it also affects pages that are simply
tall due to having a lot of content. Instead, we only need to skip if
the stacking context requires the allocation of a framebuffer that
could possibly fail.

Fixes https://github.com/SerenityOS/serenity/issues/23397
2024-03-02 14:36:33 +01:00
Andreas Kling d8e8293b7e LibWeb: Add PercentageOr<Length>::to_px() fast path for absolute lengths
We can avoid round-tripping through a temporary Length in the simple
case here.
2024-03-02 13:00:09 +01:00
Andreas Kling 1e14264d13 LibWeb: Avoid repeated layout lookups in resolve_paint_only_properties()
By caching the layout node and its computed values in locals, we can
avoid the small amount of redundant work needed to look them up every
single time.
2024-03-02 13:00:09 +01:00
Andreas Kling 8303e61912 LibWeb: Pass BorderRadiusData const& to normalize_border_radii_data()
This avoids making a bunch of temporary copies for no reason.
2024-03-02 13:00:09 +01:00
Andreas Kling 3ff5beb229 LibWeb: Add fast_is<T>() for SVGPaintable 2024-03-02 13:00:09 +01:00
Andreas Kling b66033720a LibWeb: Let Length::to_px(Layout::Node) be inline for absolute lengths 2024-03-02 13:00:09 +01:00
Andreas Kling 881e7fcee1 LibWeb: Copy various flags from layout node to paintable
This removes indirection when asking if a paintable is positioned,
floating, etc.

Removes a bunch of 1-1.5% items in the profile when hovering links
on ziglang.org.
2024-03-02 13:00:09 +01:00
Andreas Kling c69b266e43 LibGfx: Add fast path for multiply() with identity transforms
This is a no-op, and exiting early is useful as it cuts time spent in
AffineTransform::multiply() from 3% to 2% when hovering links on
ziglang.org.
2024-03-02 13:00:09 +01:00
Andreas Kling e46deec846 LibGfx: Inline some AffineTransform functions
Asking if an AffineTransform is identity or translate-only can be done
inline and avoid the cost of a function call in tight loops.
2024-03-02 13:00:09 +01:00
Andreas Kling 2dacd1252c LibGfx: Add fast paths for identity/translate-only transforms
This shrinks time spent in AffineTransform::map() from 3.3% to 1.6%
when hovering links on ziglang.org.
2024-03-02 13:00:09 +01:00
Andreas Kling 20ff69cd41 LibWeb: Add fast_is<T>() for InlinePaintable
dynamic_cast<InlinePaintable> was showing up in profiles when hovering
links on ziglang.org.
2024-03-02 13:00:09 +01:00
Andreas Kling c4403fd28c LibWeb: Fix bogus ReplacedBox type check in StackingContext
We should be asking if the layout node is a ReplacedBox, not the
paintable.
2024-03-02 13:00:09 +01:00
Shannon Booth cb1c3e5ea5 LibJS: Use TimeZoneMethods in DisambiguatePossibleInstants
This commit partially updates the DisambiguatePossibleInstants AO to use
a time zone methods record in line with the latest spec.
2024-03-02 12:27:20 +01:00
Shannon Booth f95117f75d LibJS: Use TimeZoneMethods in GetOffsetNanosecondsFor
Update to the latest version of the spec which was refactored to use
time zone methods record. This requires updating a whole bunch of
callers to pass through a record too.

This also ends up improving exceptions on a missing
getOffsetNanosecondsFor method.
2024-03-02 12:27:20 +01:00
Shannon Booth 230ffc022c LibJS: Update Temporal's GetPossibleInstantsFor to latest spec
The most noteworthy change is that we now pass through a Time Zone
Methods Record to this function instead of a raw object.
2024-03-02 12:27:20 +01:00
Shannon Booth aa9cdc2205 LibJS: Make DisambiguatePossibleInstants take a vector of NonullGCPtr
Instead of a raw pointer. Then deal with the fallout of making that
change.
2024-03-02 12:27:20 +01:00
Matthew Olsson 53a247dbe1 Base: Extend the web-animations demo to showcase complex transforms 2024-03-02 12:25:53 +01:00
Matthew Olsson 6d0672eec0 LibWeb: Implement complex transform interpolation
With this commit, we can interpolate between transforms whose functions
don't match. For example:
    translate(100px) -> scale(2) translateX(50px)
2024-03-02 12:25:53 +01:00
Matthew Olsson 892f407d75 LibWeb: Do not abort interpolation if the StyleValue types differ
This can be perfectly valid, and depends on the property being animated.
For example, interpolating between the StyleValue "none" (an identifier)
and a TransformationStyleValue is perfectly defined.
2024-03-02 12:25:53 +01:00
Matthew Olsson 15942b4262 LibWeb: Revert changing transform's animation-type to by-computed-value
In the upcoming commits where we properly handle transformation
interpolation, it actually becomes easier to change this back to custom,
so lets do that since its more correct anyways.
2024-03-02 12:25:53 +01:00
Matthew Olsson 55dfeedc46 LibGfx: Add VectorN::operator== 2024-03-02 12:25:53 +01:00
Matthew Olsson 44afc8678d LibGfx: Add an indexing operator to Matrix 2024-03-02 12:25:53 +01:00
Nico Weber 9e502dcfe4 LibPDF: Honor writing mode in TJ operator as well 2024-03-02 12:25:09 +01:00
Nico Weber c69797fda9 LibPDF: Implement support for vertical text for Type0
For Identity-V only for now.
2024-03-02 12:25:09 +01:00
Nico Weber 6348a857ea LibPDF: Prepare for more encodings than just Identity-H in Type0 code
Introduces CIDIterator, an iterator type for iterating over CIDs.

Also introduces Type0CMap which can return a CIDIterator given some
bytes.

The existing code of treating the bytes as an identity map of
big-endian u16s is now implemented in IdentityType0CMap.

No behavior change.
2024-03-02 12:25:09 +01:00
Nico Weber b9a4689af3 LibPDF: In Type0Font, read metrics /DW2 and /W2 for vertical text
Not used for anything yet.
2024-03-02 12:25:09 +01:00
Nico Weber ef5d7b685d LibPDF: In Type0::initialize(), move variable increment next to cause
No behavior change.
2024-03-02 12:25:09 +01:00
Nico Weber fc9b2440bd LibPDF: Add some spec comments in Type0Font::initialize() 2024-03-02 12:25:09 +01:00
Nico Weber 004e47df88 LibPDF: Remove minor duplication in Renderer::text_show_string_array()
This "regressed" in #10080 (back then, the branches were smaller).

No behavior change.
2024-03-02 12:25:09 +01:00
Timothy Flynn 62596f3e43 CI: Reduce the ccache size for CI
We currently use 0.6GB for a clean build with sanitizers enabled. This
will allow us to have ~3 clean builds cached and save 3GB of disk space
on CI. (The effect is actually double, because Azure archives the cache
in a tar file before uploading).
2024-03-02 09:11:03 +01:00
Timothy Flynn ba67a0645e CI: Strip binaries and libraries during the installation step
This saves ~400MB of disk space.
2024-03-02 09:11:03 +01:00
Idan Horowitz 0b7e4b335a strace: Add support for pretty-printing the prctl syscall 2024-03-02 09:10:14 +01:00
Idan Horowitz 8c562a764d strace: Add support for printing the fourth syscall argument 2024-03-02 09:10:14 +01:00
Idan Horowitz beca73e0fd strace: Add support for pretty-printing the kill syscall 2024-03-02 09:10:14 +01:00
Idan Horowitz c55b4d49a3 strace: Replace incorrect syscall arg2 register
Since commit e6df1c9988 which switched us
over to using the syscall/sysret instruction the second syscall
argument changed from rcx to rdi. Update strace as well to print the
actually correct values for the second arg.
2024-03-02 09:10:14 +01:00
Idan Horowitz 209c588ed1 Kernel: Switch a couple of signal dispatch dbglns to dbgln_if
These are pretty spammy when using strace.
2024-03-02 09:10:14 +01:00
Aliaksandr Kalenik 06c176bbfb LibGfx+LibWeb: Use ref-counted object to store glyph run
...to avoid allocating a copy of glyph run for painting commands. We
can't simply save pointers to a glyph run in layout/paintable tree
because it should be safe to deallocate layout and paintable trees
after painting commands are recorded, if in the future we decide to
move command execution to a separate thread.
2024-03-02 09:09:10 +01:00
Aliaksandr Kalenik cf6999f5f3 LibWeb: Remove glyph run allocation in paint_text_fragment()
Instead of allocating a new glyph run to scale glyph positions and
fonts, a scale factor could be encoded in a paint command and applied
later during command execution.
2024-03-02 09:09:10 +01:00
Aliaksandr Kalenik aeb5a0d9e8 LibWeb: Remove glyph run allocation in RecordingPainter::draw_text_run
Instead of allocating a new glyph run solely to shift each glyph by the
painter's offset, this offset could be encoded in a paint command and
applied later during command execution.
2024-03-02 09:09:10 +01:00
Hendiadyoin1 79fd8eb28d AK/HashMap: Use structured bindings when iterating over itself 2024-03-01 14:05:53 -07:00
Hendiadyoin1 b0fc5bea91 Kernel/PCI: Prefer structured bindings when iterating over HashMaps
This makes `Access::rescan_hardware` look a bit nicer.
2024-03-01 14:05:53 -07:00
Hendiadyoin1 2537efaf64 LibGUI: Use HashMap::keys() to hand out the available sizes of icons 2024-03-01 14:05:53 -07:00
Hendiadyoin1 e1c663ba27 LibTLS: Move Strings when creating RelativeDistinguishedNames
Also cleans up the organizational_unit() helper to use `value_or({})`
instead of doing the same thing manually.
2024-03-01 14:05:53 -07:00
Hendiadyoin1 f7329f89aa LibTLS: Prefer structured bindings when iterating over HashMaps 2024-03-01 14:05:53 -07:00
Hendiadyoin1 d6c631ebe0 WindowServer: Prefer structured bindings when iterating over HashMaps 2024-03-01 14:05:53 -07:00
Hendiadyoin1 773a280bdf LibPDF: Use a struct for the subsection in parse_xref_stream 2024-03-01 14:05:53 -07:00
Hendiadyoin1 3e3b34ab8a Kernel/NVMe: Use a struct for the namespace features, instead of a Tuple 2024-03-01 14:05:53 -07:00
Hendiadyoin1 fe0fde2154 Userland+Tests: Remove unused <AK/Tuple.h> includes 2024-03-01 14:05:53 -07:00
Andreas Kling d1b5f55f91 LibWeb: Make Paintable::containing_block() return a PaintableBox*
Every single client of this function was immediately calling paintable()
on the result anyway, so there was no need to return a layout node!

This automatically leverages the cached containing block pointer we
already have in Paintable, which melts away a bunch of unnecessary
traversal in hit testing and painting. :^)
2024-03-01 17:57:10 +01:00
Nico Weber c3980eda9e LibPDF: Give Type0 CIDFontType2 a ScaledFont instead of a Font
...with the same reasoning as the previous commit.

No behavior change.
2024-03-01 17:56:59 +01:00