Commit graph

25968 commits

Author SHA1 Message Date
Linus Groh
0e201fbb42 LibJS: Implement Temporal.PlainDate.prototype.toJSON() 2021-08-19 00:26:09 +01:00
Linus Groh
73d888e9e6 LibJS: Implement Temporal.PlainDate.prototype.toLocaleString() 2021-08-19 00:23:48 +01:00
Linus Groh
402f04c2fc LibJS: Implement Temporal.PlainDate.prototype.toString() 2021-08-19 00:14:17 +02:00
Linus Groh
310192f918 LibJS: Make Temporal's get_option() take a PropertyName directly
Instead of constructing a String and converting that to a PropertyName
on the fly, we can just leverage CommonPropertyNames, add a couple more
and directly pass ready-to-use PropertyNames with pre-allocated Strings.
2021-08-19 00:14:17 +02:00
sin-ack
705e5a3d87 WindowServer: Only clear the hovered item if the item was enabled
Otherwise, we emit a menu_item_left to the WindowServer client even
though the mouse never left the menu item (as is the case when a
disabled menu item is clicked).
2021-08-19 00:11:42 +02:00
sin-ack
d8fd4eee9b LibGUI: Move common action definitions to CommonActions.cpp
This makes Action.cpp itself only talk about the Action object, and
makes it easier to navigate.
2021-08-19 00:11:42 +02:00
Linus Groh
092f924cfd LibJS: Reflect naming consistency editorial changes in the Temporal spec
See:

- https://github.com/tc39/proposal-temporal/commit/2aa7dce
- https://github.com/tc39/proposal-temporal/commit/13daa33
- https://github.com/tc39/proposal-temporal/commit/8085873
2021-08-18 23:03:22 +01:00
Stephan Unverwerth
c4de2bb5e5 LibGL: Leave render loop early if color mask empty 2021-08-18 20:30:58 +02:00
Stephan Unverwerth
addbcd42d7 LibGL: Fix triangle winding calculation
Since we operate in screen space where y points down we need to reverse
what is considered clock wise and what is considered counter clockwise.

The rasterizer always expects triangles with a consistent winding order
thus swap 2 vertices if necessary to reverse the winding before passing
the triangle on to the rasterization stage.
2021-08-18 20:30:58 +02:00
Stephan Unverwerth
220ac5eb02 LibGL: Fix clipping and interpolate vertex attributes
The previous clipping implementation was problematic especially when
clipping against the near plane. Triangles are now correctly clipped
using homogenous coordinates against all frustum planes.

Texture coordinates and vertex colors are now correctly interpolated.
The earier implementation was just a placeholder.
2021-08-18 20:30:58 +02:00
Stephan Unverwerth
39ff1459f8 LibGL: Improve texture sampling performance
GL_NEAREST: Remove unnecessary modulo. UV is always in range due to
wrapping.
GL_LINEAR: Rewrite filter equation to save a few math operations.
2021-08-18 20:30:58 +02:00
Stephan Unverwerth
59998ff0b2 LibGL: Return white texel when sampling uninitialized texture 2021-08-18 20:30:58 +02:00
Stephan Unverwerth
894d81c1b8 LibGL: Complete glGetString implementation
GL_VERSION: The spec mandates the following format: x.y or x.y.z
optionally followed by text separated by space.

GL_EXTENSIONS: Return empty string. We do not support any extensions.
2021-08-18 20:30:58 +02:00
Stephan Unverwerth
5b9c87a8b5 LibGL: Implement glDepthFunc 2021-08-18 20:30:58 +02:00
Stephan Unverwerth
a97dbd2317 LibGL: Implement glDepthRange 2021-08-18 20:30:58 +02:00
Stephan Unverwerth
3dd9efd35f LibGL: Fix incorrect blend factor setup 2021-08-18 20:30:58 +02:00
Stephan Unverwerth
b38edf994b LibGL: Allow glTexImage2D to create uninitialized textures
When passing a nullptr as the pixel array LibGL now allocates texture
memory but does not initialize the texture contents.
2021-08-18 20:30:58 +02:00
Stephan Unverwerth
22905daacb LibGL: Fix interpretation of BGRA byte order
This fixes byte order interpretation in several places.
2021-08-18 20:30:58 +02:00
Stephan Unverwerth
e9514cf6c0 LibGL: Fix glVertexPointer argument validation 2021-08-18 20:30:58 +02:00
Stephan Unverwerth
5e27da20f4 LibGL: Fix glTexCoord behaviour
glTexCoord should behave like glColor. It only updates a gl context
variable that contains the current texture coordinates. The vertex is
only actually created once glVertex is called.
2021-08-18 20:30:58 +02:00
Stephan Unverwerth
b6373c2aba LibGL+3DFileViewer: Make glRotatef accept degrees, not radians
This is in accordance with the GL spec. Also adjust rotation values in
3DFileViewer to take the new units into account.
2021-08-18 20:30:58 +02:00
Jean-Baptiste Boric
5a8de62a1a Utilities: Remove memset calls inside ls 2021-08-18 20:30:46 +02:00
Jean-Baptiste Boric
58cebf1b6f Utilities: Implement -p flag for cp 2021-08-18 20:30:46 +02:00
Jean-Baptiste Boric
8cc8d72619 LibCore: Implement preserve flag for file/directory copy 2021-08-18 20:30:46 +02:00
Jean-Baptiste Boric
91bcff2994 Utilities: Properly sort files in ls 2021-08-18 20:30:46 +02:00
Linus Groh
b2badd6333 LibJS: Update some Temporal spec section numbers
These shifted due to the addition of the ParseTemporalRelativeToString
AO in https://github.com/tc39/proposal-temporal/commit/ad06578.
2021-08-18 19:26:08 +01:00
panky-codes
1b093c8b48 Kernel: Const defines for PCI IDs for storage controllers 2021-08-18 18:18:12 +02:00
kleines Filmröllchen
a9cbdcbcd0 Utilities: Make aplay respect loader errors
aplay would previously just retry a couple of times when the loader
encountered an error, even though there is a standard mechanism for
loaders to report errors. Now, aplay outputs these errors to the user
and exits.
2021-08-18 18:16:48 +02:00
kleines Filmröllchen
195d6d006f LibAudio: Resample FLAC audio data
FlacLoader initialized, but never used its resampler; this is now fixed
and all subframes are resampled before decorrelation occurs. FLAC files
with non-44100-Hz sample rates now play properly.
2021-08-18 18:16:48 +02:00
kleines Filmröllchen
d7ca60b998 LibAudio: Resample with integer ratios instead of floats
Floating-point ratios are inherently imprecise, and can lead to
unpredictable or nondeterministic behavior when resampling and expecting
a certain number of resulting samples. Therefore, the resampler now uses
integer ratios, with almost identical but fully predictable behavior.

This also introduces the reset() function that the FLAC loader will use
in the future.
2021-08-18 18:16:48 +02:00
Sergey Bugaev
6c9343e262 Userland: Also cache d_type in find(1)
Since readdir() actually gives us the file type, we don't have
to stat it again to know whether it's a directory! This means that
'find /' can process the majority of files without ever calling
stat() on them, simply by reading directories.

In addition, the TypeCommand (-t) can make use of this info too,
so, for instance, a 'find / -t d' does not need to stat anything
either.

This gives us a final huge speedup :^)
2021-08-18 18:13:59 +02:00
Sergey Bugaev
ed5b3f8495 Kernel: Specify directory entry types properly
...in a few more places, at least.

find(1) is about to start relying on the reported types more or less
reflecting reality. This is especially relevant for magic symlinks
in ProcFS.
2021-08-18 18:13:59 +02:00
Sergey Bugaev
548a880310 Userland: Cache stat in find(1)
We have multiple commands that are implemented in terms of stat.
Let's cache the stat in FileData after we query it once.

This gives us another large speed-up :^)
2021-08-18 18:13:59 +02:00
Sergey Bugaev
d4232d5ee2 Userland: Simplify recursion in find(1)
Now walk_tree() itself checks whether it should descend into a file
(if the file is a directory) or not.
2021-08-18 18:13:59 +02:00
Sergey Bugaev
ad15d0c880 Userland: Ditch Core::DirIterator for readdir() in find(1)
While Core::DirIterator is nice C++ API, we want more low-level
control here. In particular, we want to open the directory using
openat(), to also not pay the cost of re-traversing the path
components we have already resolved previously.

This gives us another nice speedup :^)

Also, in the future commits this will allow us to make use of more
data from the returned struct dirent, to speed things up even further.
2021-08-18 18:13:59 +02:00
Sergey Bugaev
4c126ea908 Userland: Use fstatat() in find(1)
This speeds things up noticeably :^)

The idea here is that a directory fd is a way to hold onto
the results of path resolution that the kernel has already done
for us. This way we don't ask the kernel to resolve the same
parent directories over and over.
2021-08-18 18:13:59 +02:00
Sergey Bugaev
e526a7641f Userland: Wrap path a into struct in find(1)
Also, replace the raw string by a LexicalPath.

Both are weird changes to make on their own; but they set
the stage for what's to come next.
2021-08-18 18:13:59 +02:00
Daniel Bertalan
bd6dc5ccec Meta+LibC: Don't allow text relocations in SerenityOS libraries
The `-z,text` linker flag causes the linker to reject shared libraries
and PIE executables that have textrels. Our code mostly did not use
these except in one place in LibC, which is changed in this commit.
This makes GNU ld match LLD's behavior, which has this option enabled by
default.

TEXTRELs pose a security risk, as performing these relocations require
executable pages to be written to by the dynamic linker. This can
significantly weaken W^X hardening mitigations.

Note that after this change, TEXTRELs can still be used in ports, as the
dynamic loader code is not changed. There are also uses of it in the
kernel, removing which are outside the scope of this PR. To allow those,
`-z,notext` is added.
2021-08-18 18:01:22 +02:00
networkException
446bd1e0de README+Meta: Update the screenshot :^) 2021-08-18 14:27:37 +02:00
Andreas Kling
b36968c442 SystemMonitor: Put the "Hardware" tabs at the end of the list 2021-08-18 13:07:35 +02:00
Andreas Kling
4eb198baf3 Profiler: Limit the initial size of the timeline container
If there are a lot of process timeline tracks, we don't want to make the
window gigantic. So let's just put a limit on it.
2021-08-18 13:06:27 +02:00
Andreas Kling
16efe603cb Base: Remove System Monitor and Assistant from quick launch bar
System Monitor can already be accessed quickly by clicking one of the
resource graph applets in the task bar, so this icon was redundant.

Assistant can be opened with the Super+Space hotkey, so we don't need a
dedicated icon for it.
2021-08-18 13:03:11 +02:00
Andreas Kling
7d904eed12 FileManager: Reorder main toolbar actions a little bit
Put the "Open in terminal" action next to the other navigation actions.
And separate the "New File" and "New Directory" actions from the actions
that operate on existing items.
2021-08-18 13:00:20 +02:00
Andreas Kling
db33a36048 Base: Rename GitHub browser bookmark to "GitHub"
"SerenityOS @ GitHub" was a pointlessly long name for this.
2021-08-18 12:56:05 +02:00
Andreas Kling
fe1b490416 SystemMonitor: Rename "Graphs" tab to "Performance" 2021-08-18 12:54:59 +02:00
Andreas Kling
636a4fe36c SystemMonitor: Rename "File system" tab to "Storage" 2021-08-18 12:53:59 +02:00
Andreas Kling
f91c499a41 SystemMonitor: Consolidate hardware tabs + remove interrupts tab
Combine the "PCI devices" and "Processors" tabs into a "Hardware" tab.

And then remove the "Interrupts" tab because the number of received
IRQ's per device is not really useful information to expose in this GUI.
If the user needs this, he can check lsirq.
2021-08-18 12:50:24 +02:00
Andreas Kling
9994b81931 SystemMonitor: Remove "Devices" tab
This was crowding up the GUI without providing anything useful.
2021-08-18 12:49:30 +02:00
Andreas Kling
a401a0f8fe LibWeb: Add fast_is<Layout::InitialContainingBlockBox>
This is used by Layout::Node::containing_block() which is fairly hot.
2021-08-18 11:45:39 +02:00
Andreas Kling
1268b39ba0 LibGfx: Make FastBoxBlurFilter go faster
When entering FastBoxBlurFilter::apply_single_pass(), we VERIFY that the
bitmap format is BGRA8888.

This invariant allows us to use get_pixel<BGRA8888>() instead of the
generic get_pixel() throughout the function. This removes a lot of
branches and makes the filter significantly faster. :^)
2021-08-18 11:35:51 +02:00