Commit graph

50451 commits

Author SHA1 Message Date
Ben Wiederhake
95d90a760b AK: Make all HashMap copy-constructs explicit 2023-05-19 22:33:57 +02:00
Ben Wiederhake
6421899078 AK: Rewrite HashMap::clone signature with template-args and const 2023-05-19 22:33:57 +02:00
Pankaj Raghav
dabc6dd962 Kernel/ScatterGatherList: Add region_name as a part of try_create API
Remove the hardcoded "AHCI Scattered DMA" for region name as it is a
part of a common API. Add region_name parameter to the try_create API
so that this API can be used by other drivers with the correct Memory
region name.
2023-05-19 22:04:37 +02:00
Pankaj Raghav
e067046474 Kernel/ScatterGatherList: Move constructor init code to try_create
The constructor code of ScatterGatherList had code that can return
error. Move it to try_create for better error propagation.

This removes one TODO() and one
release_value_but_fixme_should_propagate_errors().
2023-05-19 22:04:37 +02:00
Pankaj Raghav
489e268b96 Kernel/ScatterGatherList: Return ErrorOr from try_create
This removes the TODO from the try_create API to return ErrorOr. This
is also a preparation patch to move the init code in the constructor
that can fail to this try_create function.
2023-05-19 22:04:37 +02:00
Liav A
4617c05a08 Kernel: Move a bunch of generic devices code into new subdirectory 2023-05-19 21:49:21 +02:00
Ben Wiederhake
9eeda5719e LibLine: Prefer File::read_until_eof over DeprecatedFile::read_all 2023-05-19 21:36:37 +02:00
Ben Wiederhake
5b318dd160 WindowServer: Prefer File::read_until_eof over DeprecatedFile::read_all 2023-05-19 21:36:37 +02:00
Ben Wiederhake
f0ee630ee9 Shell: Prefer File::read_until_eof over DeprecatedFile::read_all 2023-05-19 21:36:37 +02:00
Ben Wiederhake
33026bcefe LibCore: Remove recursive copy API from DeprecatedFile 2023-05-19 21:12:15 +02:00
Ben Wiederhake
9f820fa2c5 HackStudio: Prefer FileSystem::copy_file_or_directory 2023-05-19 21:12:15 +02:00
Ben Wiederhake
c2d26ec541 usermod: Prefer FileSystem over DeprecatedFile 2023-05-19 21:12:15 +02:00
Ben Wiederhake
54b3f90e47 mv: Prefer FileSystem over DeprecatedFile 2023-05-19 21:12:15 +02:00
Ben Wiederhake
02fa97a13f cp: Prefer FileSystem over DeprecatedFile 2023-05-19 21:12:15 +02:00
Ben Wiederhake
6c9383ce89 install: Prefer FileSystem over DeprecatedFile 2023-05-19 21:12:15 +02:00
Jelle Raaijmakers
5031603cdc LibGfx: Remove clip check in Painter::do_draw_scaled_bitmap
We were performing a check whether source pixels would fall into a
clipped rect too early. Since we already clamp the resulting source
coordinates to the clipped rect, we can just remove this code.
2023-05-19 18:36:36 +02:00
Jelle Raaijmakers
7652dbd983 LibWeb: Use box sampling instead of bilinear scaling when downscaling
As a heuristic, either the width or height of the scaled image should
decrease for box sampling to be used. Otherwise, we use bilinear
scaling.
2023-05-19 18:36:36 +02:00
Jelle Raaijmakers
fae9a05039 PixelPaint: Use box sampling scaling for layer thumbnails 2023-05-19 18:36:36 +02:00
Jelle Raaijmakers
aebc260940 PixelPaint: Add support for box sampling scaling 2023-05-19 18:36:36 +02:00
Jelle Raaijmakers
6b07926466 ImageViewer: Add support for box sampling scaling 2023-05-19 18:36:36 +02:00
Jelle Raaijmakers
6242d8e023 LibGfx: Implement box sampling image scaling
Box sampling is a scaling algorithm that averages all the pixels that
form the source for the target pixel. For example, if you would resize a
9x9 image to 3x3, each target pixel would encompass a 3x3 pixel area in
the source image.

Box sampling is a near perfect scaling algorithm for downscaling. When
upscaling with this algorithm, the result is similar to nearest neighbor
or smooth pixels.
2023-05-19 18:36:36 +02:00
Jelle Raaijmakers
31fa449538 LibGfx: Cleanup of Painter::do_draw_scaled_bitmap()
No functional changes.
2023-05-19 18:36:36 +02:00
Andreas Kling
6f204f8c32 LibWeb: Fix null dereference on SVG element with bogus fill URL
Fixes a crash seen on YouTube channel pages.
2023-05-19 15:41:34 +02:00
Andreas Kling
411b28fc59 LibWeb: Make sure that margins don't collapse across a nested BFC
In order to fix this, I also had to reorganize the code so that we
create an independent formatting context even for block-level boxes
that don't have any children. This accidentally improves a table
layout test as well (for empty tables).
2023-05-19 15:09:09 +02:00
Andreas Kling
9ce7681ff2 Revert "LibGfx: Implement alternative Rect right/bottom edge calculations"
This reverts commit 88a7bb5ba7.
2023-05-19 13:33:55 +02:00
Andreas Kling
3a670389d6 Revert "LibGfx: Cleanup of Painter::do_draw_scaled_bitmap()"
This reverts commit 4944b16bd5.
2023-05-19 13:33:54 +02:00
Andreas Kling
2d3b7eff15 Revert "LibGfx: Implement box sampling image scaling"
This reverts commit eb418bec32.
2023-05-19 13:33:54 +02:00
Andreas Kling
9fb81c2c4e Revert "ImageViewer: Add support for box sampling scaling"
This reverts commit 032c2a882a.
2023-05-19 13:33:53 +02:00
Andreas Kling
20537ed3da Revert "PixelPaint: Add support for box sampling scaling"
This reverts commit d6aefb1bf1.
2023-05-19 13:33:53 +02:00
Andreas Kling
1c4d69681c Revert "PixelPaint: Use box sampling scaling for layer thumbnails"
This reverts commit 81b30ec372.
2023-05-19 13:33:52 +02:00
Andreas Kling
77db621be5 Revert "LibWeb: Use box sampling instead of bilinear scaling when downscaling"
This reverts commit b79fd3d1a9.
2023-05-19 13:33:52 +02:00
Andreas Kling
fb1a151fe3 Revert "LibGfx: Remove clip check in Painter::do_draw_scaled_bitmap"
This reverts commit 2959c2f2eb.
2023-05-19 13:33:50 +02:00
thankyouverycool
444470b238 Applications: Improve FSAC error message handling
Fixes apps showing redundant error messages and terminating
unnecessarily on failed file requests. It's nicer to drop the
user off at the equivalent of a default document on failure if
possible.

Also fixes TextEditor not showing response errors for missing files
in the recently opened list.
2023-05-19 06:20:41 +02:00
thankyouverycool
fef594708e FileSystemAccessServer: Return EPERM for denied prompts
Instead of showing an ambiguous "Unknown error" when FSAS approval is
denied, let's affirm the user's action wasn't permitted if they
reject the prompt.
2023-05-19 06:20:41 +02:00
thankyouverycool
37e621a3c7 LibFileSystemAccessClient: Improve error propagation
Previously FSAC displayed some but not all errors and always
rejected directories and devices. This has led most apps to ignore
response errors in open/save actions or show redundant messages.

Now FSAC displays all errors including fd failures and has the ability
to silence messages for directories, devices and ENOENT, which some
apps handle differently. Silenced directory and device errors now
return files on success.

A request's access mode is now stored in RequestData to format more
accurate error messages from the user's perspective.

Resolved promises don't require callback propagation so they're voided
2023-05-19 06:20:41 +02:00
thankyouverycool
7a183ee568 LibGUI: Set Open/Save button as default in FilePicker
This makes it more obvious that enter will return the current
selection and prevents returning without a valid selection.
2023-05-19 06:20:41 +02:00
Andreas Kling
f823b297b4 LibWeb: Push the realm execution context while linking modules
If linking fails, we throw a JS exception, and if there's no execution
context on the VM stack at that time, we assert in VM::current_realm().

This is a hack to prevent crashing on failed module loads. Long term we
need to rewrite module loading since it has been refactored to share
code differently between HTML and ECMA262.
2023-05-19 06:20:14 +02:00
Andreas Kling
819fb39a87 LibWeb: Implement the "error to rethrow" mechanism in HTML::Script
This allows JS module loads to fail and throw without crashing the
WebContent process due to a TODO() assertion.
2023-05-19 06:20:14 +02:00
Jelle Raaijmakers
2959c2f2eb LibGfx: Remove clip check in Painter::do_draw_scaled_bitmap
We were performing a check whether source pixels would fall into a
clipped rect too early. Since we already clamp the resulting source
coordinates to the clipped rect, we can just remove this code.
2023-05-19 06:16:14 +02:00
Jelle Raaijmakers
b79fd3d1a9 LibWeb: Use box sampling instead of bilinear scaling when downscaling
As a heuristic, either the width or height of the scaled image should
decrease for box sampling to be used. Otherwise, we use bilinear
scaling.
2023-05-19 06:16:14 +02:00
Jelle Raaijmakers
81b30ec372 PixelPaint: Use box sampling scaling for layer thumbnails 2023-05-19 06:16:14 +02:00
Jelle Raaijmakers
d6aefb1bf1 PixelPaint: Add support for box sampling scaling 2023-05-19 06:16:14 +02:00
Jelle Raaijmakers
032c2a882a ImageViewer: Add support for box sampling scaling 2023-05-19 06:16:14 +02:00
Jelle Raaijmakers
eb418bec32 LibGfx: Implement box sampling image scaling
Box sampling is a scaling algorithm that averages all the pixels that
form the source for the target pixel. For example, if you would resize a
9x9 image to 3x3, each target pixel would encompass a 3x3 pixel area in
the source image.

Box sampling is a near perfect scaling algorithm for downscaling. When
upscaling with this algorithm, the result is similar to nearest neighbor
or smooth pixels.
2023-05-19 06:16:14 +02:00
Jelle Raaijmakers
4944b16bd5 LibGfx: Cleanup of Painter::do_draw_scaled_bitmap()
No functional changes.
2023-05-19 06:16:14 +02:00
Jelle Raaijmakers
88a7bb5ba7 LibGfx: Implement alternative Rect right/bottom edge calculations
For `IntRect`, we assume that the right/bottom edge is offset by minus
one. This obviously will not work for `FloatRect`, since those edges are
infinitely small.

Specialize `right()` and `bottom()` and add a `FIXME` to get rid of the
offset in the future.
2023-05-19 06:16:14 +02:00
Aliaksandr Kalenik
902ceb1675 LibWeb: Resolve grid item fixed size paddings in GFC
Adds support for grid items with fixed size paddings. Supporting
percentage paddings will probably require to do second pass of tracks
layout: second pass is needed to recalculate tracks sizes when final
items sizes are known when percentage paddings are already resolved.
2023-05-19 06:12:05 +02:00
Aliaksandr Kalenik
f8d6569841 LibWeb: Move resolving grid item heights into separate method in GFC 2023-05-19 06:12:05 +02:00
Tim Ledbetter
c87053c685 Base: Add man page for shuf 2023-05-18 21:06:37 -06:00
Tim Ledbetter
12d6845c4e shuf: Add -r option to allow output lines to be repeated
This commit also modifies the behavior of the `-z` option, so that a
'\0' character now delimits output lines, as well as input lines. This
matches the behavior of the GNU coreutils and FreeBSD implementations
of shuf.
2023-05-18 21:06:37 -06:00