Commit graph

48967 commits

Author SHA1 Message Date
Tim Schumacher 56fdbf81dc Ports: Reapply the SDL2_sound patch 2023-04-09 01:53:33 +02:00
Karol Baraniecki f532f9d279 BrickGame: Remember the "Show Shadow Piece" setting between executions
by using the ConfigServer.
2023-04-09 00:44:45 +02:00
Karol Baraniecki 439076df8a BrickGame: Add a menu option to disable the shadow drop hint 2023-04-09 00:44:45 +02:00
Karol Baraniecki f3f14a7ef1 BrickGame: Show where a piece would end up when after a fast drop
To show it to the player, draw a faint outline of where the piece would
end up.
2023-04-09 00:44:45 +02:00
Karol Baraniecki 652a19b232 BrickGame: Use title case in menu items consistently
by fixing the "Toggle pause" option
2023-04-09 00:44:45 +02:00
Karol Baraniecki bd12a72546 BrickGame: Add a missing [[nodiscard]] for consistency
Every other function there returning a RenderRequest has one, so might
as well.

Don't add it to check_and_remove_full_rows(), because it's only used
inside other functions returning a RenderRequest, when it's already
clear a render will happen.
2023-04-09 00:44:45 +02:00
Karol Baraniecki 962d39cc05 BrickGame: Port from DeprecatedStrings to Strings 2023-04-09 00:44:45 +02:00
Ben Wiederhake 2344666725 Documentation+Ports: Be upfront about dependencies
Yes, these can be 'discovered' incrementally, but it's usually nicer to
be upfront instead of making the user play trial-and-error.
2023-04-08 15:20:33 -07:00
Tim Schumacher 381da77ffb LibCompress: Mark some XZ-related variables and functions as const 2023-04-08 15:18:59 -07:00
Tim Schumacher e9789e9f36 LibCompress: Move loading XZ blocks into its own function 2023-04-08 15:18:59 -07:00
Tim Schumacher e6b1e1bb33 LibCompress: Move finishing the current XZ stream into its own function 2023-04-08 15:18:59 -07:00
Tim Schumacher 68984abc43 LibCompress: Move finishing the current XZ block into its own function 2023-04-08 15:18:59 -07:00
Tim Schumacher 0e11e7012d LibCompress: Move loading XZ stream headers into its own function 2023-04-08 15:18:59 -07:00
Nico Weber 95e35b7f5e LibGfx: Correctly decode webp lossless with small palette and odd width
WebP lossless files that use a color indexing transform with <= 16
colors use pixel bundling to pack 2, 4, or 8 pixels into a single pixel.

If the image's width doesn't happen to be an exact multiple of the
bundling factor, we need to:

1. Use ceil_div() instead of just dividing the width by the bundling
   factor

2. Remember the original width and use it instead of computing
   reduced width times bundling factor

This does these changes, and adds a simple test for it -- it at least
checks that the decoded images have the right size.

(I created these images myself in Photoshop, and used the same
technique as for Tests/LibGfx/test-inputs/catdog-alert-*.webp
to create images with a certain number of colors.)
2023-04-09 00:14:15 +02:00
Ben Wiederhake 625b29f507 Ports: Repair qt6-qtbase by disabling QDnsLookup 2023-04-08 14:25:30 -07:00
Marco Cutecchia 401946947c Toolchain: Stop building QEMU with i386 support 2023-04-08 14:12:29 -07:00
Timothy Flynn 4555e3b8d2 LibWeb: Begin painting video controls on HTMLVideoElement layout nodes
If the video element has a 'controls' attribute, we now paint some basic
video controls over the video element. If no frame has been decoded yet,
we paint a play button on the center of the element.

If a frame has been decoded, we paint that frame and paint a control bar
on the bottom of the frame. This control bar currently only contains a
play/pause button, depending on the video's playback state. We will only
paint the control bar if the video is paused or hovered.
2023-04-08 22:04:14 +02:00
Timothy Flynn 4f29cac715 LibWeb: Set the media ready state to HAVE_ENOUGH_DATA after fetching
Because we currently both fetch and process the media data in one chunk,
we have enough data for playback immediately.
2023-04-08 22:04:14 +02:00
Timothy Flynn 90e1d4f545 Base: Add playback state data to the video test page 2023-04-08 22:04:14 +02:00
Timothy Flynn d99a075ff9 LibWeb: Implement HTMLMediaElement.play
This also includes the HTMLMediaElement's list of pending play promises,
which is coupled pretty tightly with HTMLMediaElement.play.
2023-04-08 22:04:14 +02:00
Timothy Flynn b8a37ef809 LibWeb: Implement HTMLMediaElement.pause 2023-04-08 22:04:14 +02:00
Timothy Flynn 90921a4f16 LibWeb: Implement the HTMLMediaElement paused attribute
Note that the default value of the attribute is true. We were previously
autoplaying videos as soon as they loaded - this will prevent that from
happening until the paused attribute is set to false.
2023-04-08 22:04:14 +02:00
Timothy Flynn e130525c24 LibWeb: Implement HTMLMediaElement.load 2023-04-08 22:04:14 +02:00
Timothy Flynn 9ad4c9e6b0 LibWeb: Log correct error object when failing to decode a video sample 2023-04-08 22:04:14 +02:00
Timothy Flynn 8dd5bf7f11 LibWeb: Add missing include to WebIDL::Promise
WebIDL::Promise is aliased to a JS::PromiseCapability. This missing
include would cause a compile error in an upcoming commit.
2023-04-08 22:04:14 +02:00
Nico Weber f2efb97578 Tests: Add webp lossless test with color index and < 16 colors
For the test files, I opened Base/res/icons/catdog/alert.png in Adobe
Photoshop 2023, used Image->Mode->Index Color...->
Palette: Local (Perceptive) to reduce the number of colors to 13, 8, and
3 with transparency, and 2 without transparency, then converted it back
to Image->Mode->RGB Color (else it can't be saved as webp), then
File->Save a Copy... to save a WebP (mode lossless) for every palette
size.
2023-04-08 19:24:13 +02:00
Nico Weber 1dab480015 LibGfx: Implement color index pixel bundling in webp decoder
See the lengthy comment added in this commit for details.

With this, the webp lossless decoder is feature complete :^)

(...except for bug fixes and performance improvements, as always.)
2023-04-08 19:24:13 +02:00
Nico Weber 7309441b31 LibGfx: Enable webp lossless Transform to return new bitmap
...in addition to modifying in-place. This is needed for bitpacking
support for the color indexing transform (and it could also be used
to make the color indexing transform return an indexed bitmap, which
is something we could do if that's the last transform that's applied).

No behavior change.
2023-04-08 19:24:13 +02:00
Nico Weber 13f8bbb284 LibGfx: Add some more dbgln_if()s to webp decoder 2023-04-08 19:24:13 +02:00
Nico Weber 82182f4560 LibGfx: Give PrefixCodeGroup a deleted copy ctor
This makes the accidental copy fixed in 2125ccdc19 a compile error.

No behavior change.
2023-04-08 19:23:44 +02:00
Nico Weber a34b300393 Fuzzers: Add a WebP fuzzer 2023-04-08 18:58:14 +02:00
Nico Weber 1fc56e56c3 LibGfx: Make webp lossless decoder 6 times as fast
Reduces the time to run

    Build/lagom/image ~/src/libwebp/webp_js/test_webp_wasm.webp -o tmp.png

from 0.5s to 0.25s.

Before, 60% of the time was spent decoding webp and 40% writing png.
Now, 16% of the time was spent decoding webp and 84% writing png.

That means png writing takes 0.2s, and webp decoding time went from
0.3s to 0.05s.

A template expression without explicit return type deduces its return
type as if for a function whose return type is declared auto. That
does deduce return-by-value, while `decltype(auto)` would deduce
return-by-reference.  Explictly saying `decltype(auto)` would work
too, but writing out the type is maybe easier to understand.

No behavior change other than being much faster.
2023-04-08 18:57:37 +02:00
Liav A b414b56336 Ports: Update dmidecode to version 3.5 2023-04-08 19:02:06 +03:00
Liav A fd62eb325e Ports: Update dtc to version 1.7.0
Also, don't use a commit hash anymore but instead use tags, which are
updated often enough.
2023-04-08 18:01:06 +03:00
Liav A 9d43132380 Ports: Update file to version 5.44 2023-04-08 17:59:09 +03:00
Nico Weber 6151a251f5 Tests: Add test for lossless webp file using a color indexing tranform
The image is https://quakewiki.org/wiki/File:Qpalette.png in lossless
webp format with a color indexing transform.

I've created Qpalette.webp by running

    examples/cwebp -z 0 ~/src/serenity/tmp.ppm -o Qpalette.webp

built at libwebp webmproject/libwebp@0825faa4c1 (without
png support, so I first ran

    Build/lagom/image ~/Downloads/Qpalette.png -o tmp.ppm

to convert it from png to a format my cwebp binary could read).

This file also happens to explicitly set max_symbol, so it serves
as a test for that code path as well.
2023-04-08 16:50:40 +02:00
Nico Weber 24967b0d29 LibGfx: Second attempt to handle max_symbol correctly in webp decoder
The previous attempt was in commit e5e9d3b877, where I thought
max_symbol describes how many code lengths should be read.

But it looks like it instead describes how many code length input
symbols should be read. (The two aren't the same since one code length
input symbol can produce several code lengths.)

I still agree with the commit description of e5e9d3b877 that the spec
isn't very clear on this :)

This time I've found a file that sets max_symbol and with this change
here, that file decodes correctly. (It's Qpalette.webp, which I'm about
to add as a test case.)
2023-04-08 16:50:40 +02:00
Nico Weber a915d07293 LibGfx: Implement most of COLOR_INDEXING_TRANSFORM for webp decoder
Doesn't yet implement pixel packing for when the palette has fewer
than 16 colors.
2023-04-08 16:50:40 +02:00
Nico Weber 6f4fdd85b7 LibGfx: Extract free add_argb32() function in webp decoder 2023-04-08 16:50:40 +02:00
Nico Weber 50c9b51eca LibGfx: Make a webp error message more detailed
Now that lossless decoding mostly works, make it clear that only
lossy decoding isn't implemented yet.
2023-04-08 16:50:40 +02:00
Liav A 7b745a20f1 Kernel: Mark a bunch of NonnullRefPtrs also const to ensure immutability
These were easy to pick-up as these pointers are assigned during the
construction point and are never changed afterwards.

This small change to these pointers will ensure that our code will not
accidentally assign these pointers with a new object which is always a
kind of bug we will want to prevent.
2023-04-08 13:44:21 +02:00
Andreas Kling e1f5aae632 AK: Bake CLion IDE check into AK_COMPILER_CLANG
For whatever reason, when CLion does its code indexing thing, it doesn't
define __clang__ despite using Clang. This causes it to run into various
problems that we've solved by checking for Clang.

Since CLion does define __CLION_IDE__ (or sometimes __CLION_IDE_, no
idea why but I have seen this issue locally), let's make that part of
the AK_COMPILER_CLANG check.

This makes CLion stop highlighting various things as errors.
2023-04-08 13:43:25 +02:00
Andreas Kling 9264303f5d Kernel: Don't reuse old master TLS region data in sys$execve()
When switching to the new address space, we also have to switch the
Process::m_master_tls_* variables as they may refer to a region in
the old address space.

This was causing `su` to not run correctly.

Regression from 65641187ff.
2023-04-08 07:28:27 +02:00
Tim Ledbetter 44dd824764 Ports: Add stockfish port 2023-04-07 14:59:27 -06:00
Kenneth Myhra ad5cbdc51b LibWeb: Port {Mouse,UI,Wheel,}Event to new String
This ports MouseEvent, UIEvent, WheelEvent, and Event to new String.
They all had a dependency to T::create() in
WebDriverConnection::fire_an_event() and therefore had to be ported in
the same commit.
2023-04-07 22:41:01 +02:00
Kenneth Myhra e0002aa993 LibWeb: Move string literals to HTML::EventNames
This moves the string literals animation{end,iteration,start} and
transitionend to HTML::EVentNames.
2023-04-07 22:41:01 +02:00
Kenneth Myhra d7ff360969 LibWeb: Correct casing of webkitTransitionEnd and webkitAnimation*
This corrects the casing of the legacy event types webkitTransitionEnd
and webkitAnimation{End,Iteration,Start}.
2023-04-07 22:41:01 +02:00
Kenneth Myhra 59a21c6274 LibWeb: Port CustomEvent to new String 2023-04-07 22:41:01 +02:00
Timothy Flynn 44cf92616e LibTimeZone: Update to TZDB version 2023c
https://mm.icann.org/pipermail/tz-announce/2023-March/000079.html
2023-04-07 20:52:01 +02:00
Timothy Flynn a8fce9eec2 LibJS: Update spec numbers for the Intl Enumeration proposal
This proposal has been merged into the main ECMA-402 spec. See:
https://github.com/tc39/ecma402/commit/81856b3
2023-04-07 20:50:50 +02:00