Commit graph

31932 commits

Author SHA1 Message Date
Daniel Bertalan
7608af13cd Kernel: Use the toolchain's nm in mkmap.sh
By using the binary from our build of binutils, we can be sure that `nm`
supports demangling symbols, so we can avoid spawning a separate
`c++filt` process.
2021-12-30 18:10:51 +01:00
davidot
9d3623f0e8 LibJS: Add and fix some spec comments in AbstractOperations 2021-12-30 15:29:33 +01:00
davidot
d72022ba04 LibJS: Convert get_identifier_reference() to ThrowCompletionOr
And while we're here add spec comments.
2021-12-30 15:29:33 +01:00
davidot
676554d3f8 LibJS: Convert resolve_binding() to ThrowCompletionOr
The spec has a note stating that resolve binding will always return a
reference whose [[ReferencedName]] field is name. However this is not
correct as the underlying method GetIdentifierReference may throw on
env.HasBinding(name) thus it can throw. However, there are some
scenarios where it cannot throw because the reference is known to exist
in that case we use MUST with a comment.
2021-12-30 15:29:33 +01:00
creator1creeper1
dfaa6c910c Utilities/lsusb: Propagate errors in JSON decoding 2021-12-30 14:37:02 +01:00
creator1creeper1
575a8e6487 Utilities/arp: Propagate errors in JSON decoding 2021-12-30 14:37:02 +01:00
creator1creeper1
067e32c023 Utilities/netstat: Propagate errors in JSON decoding 2021-12-30 14:37:02 +01:00
creator1creeper1
9c832e3b0f Utilities/ifconfig: Propagate errors in JSON decoding 2021-12-30 14:37:02 +01:00
creator1creeper1
d9b3278074 Utilities/notify: Propagate errors in Gfx::Bitmap loading 2021-12-30 14:37:02 +01:00
creator1creeper1
9d6ecdca7b Utilities/lsirq: Propagate errors in JSON decoding 2021-12-30 14:37:02 +01:00
creator1creeper1
bceddb2073 Utilities/mount: Propagate errors in JSON decoding 2021-12-30 14:37:02 +01:00
creator1creeper1
904c8634eb Utilities/lsof: Propagate errors in JSON decoding 2021-12-30 14:37:02 +01:00
r00ster91
fe2ade13e9 Pong: Support W and S keys for movement 2021-12-30 14:36:21 +01:00
Young-Jin Park
9d74659f3b LibGUI: Fix leading whitespaces when text is wrapped
This commit should fix a bug where using leading whitespaces when a line
is wrapped results in a crash. Now it should correctly highlight the
leading whitespaces even when the leading whitespaces are longer than a
line.
2021-12-30 14:34:01 +01:00
Hendiadyoin1
23037d619a Kernel: Simplify some if statements 2021-12-30 14:32:17 +01:00
Hendiadyoin1
04d75f4ff9 Kernel: Add some implied auto qualifiers 2021-12-30 14:32:17 +01:00
Hendiadyoin1
9346b9589f Kernel: Remove else-after-return statements in CommandLine.cpp 2021-12-30 14:32:17 +01:00
Hendiadyoin1
1db53400ce Kernel: Remove superfluous moves in CommandLine.cpp 2021-12-30 14:32:17 +01:00
Hendiadyoin1
b1aee18078 Kernel: Add missing includes in ThreadTracer and WorkQueue 2021-12-30 14:32:17 +01:00
Elyse
173a84a2ef LibGUI+SoundPlayer: Use 'decrease_slider_by_page_steps()' method
This method allow us to avoid repeating the pattern
'set_value(value() - page_step() * page_number)'.
2021-12-30 14:31:50 +01:00
Elyse
0d660b27ae LibGUI+SoundPlayer: Use 'increase_slider_by_page_steps()'
This method allow us to avoid repeating the pattern
'set_value(value() + page_step() * page_number)'.
2021-12-30 14:31:50 +01:00
Elyse
8d1fb299b1 LibGUI+LibWeb: Use 'decrease_slider_by_steps()' method
This method allow us to avoid repeating the pattern
'set_value(value() - step() * step_number)'.
2021-12-30 14:31:50 +01:00
Elyse
cee4e02134 LibGUI+LibWeb: Use 'increase_slider_by_steps()' method
This method allow us to avoid repeating the pattern
'set_value(value() + step() * step_number)'.
2021-12-30 14:31:50 +01:00
Elyse
086615535f Everywhere: Use 'decrease_slider_by()' method from AbstractSlider
The same idea as 'increase_slider_by()', it helps us to avoid repeating
the pattern 'set_value(value() - delta)'.
2021-12-30 14:31:50 +01:00
Elyse
d53e1fa1fa Everywhere: Use 'increase_slider_by()' method from AbstractSlider
This method help us to avoid repeating the pattern
'set_value(value() + delta)'.
2021-12-30 14:31:50 +01:00
Elyse
8b8f404146 LibGUI: Add movement methods to AbstractSlider
These methods give us a simple way to move up and down the slider,
without needing to repeat the 'set_value(value() + some_value)'
pattern that multiple applications and libraries use.
2021-12-30 14:31:50 +01:00
Luke Wilde
4427386d5f LibWeb: Implement Element.getAttributeNames 2021-12-30 14:30:35 +01:00
Daniel Bertalan
6b39c6b1bf Shell: Avoid many single byte write() syscalls when printing the prompt
Whenever the prompt is printed, we write a line's worth of space
characters to the terminal to ensure that the prompt ends up on a new
line even if there is dangling output on the current line.

We write these to the stderr, which is unbuffered, so each putc() call
would come with the overhead of a system call. Let's use a buffer
+ fwrite() instead, since heap allocation is much faster.
2021-12-30 14:26:29 +01:00
Jelle Raaijmakers
c19632128c LibGL+LibSoftGPU: Implement texture coordinate generation
Texture coordinate generation is the concept of automatically
generating vertex texture coordinates instead of using the provided
coordinates (i.e. `glTexCoord`).

This commit implements support for:

* The `GL_TEXTURE_GEN_Q/R/S/T` capabilities
* The `GL_OBJECT_LINEAR`, `GL_EYE_LINEAR`, `GL_SPHERE_MAP`,
  `GL_REFLECTION_MAP` and `GL_NORMAL_MAP` modes
* Object and eye plane coefficients (write-only at the moment)

This changeset allows Tux Racer to render its terrain :^)
2021-12-30 14:24:29 +01:00
Jelle Raaijmakers
69da279073 LibSoftGPU: Use eye coordinates for fog calculation
Now that we calculate and store eye coordinates for each vertex, we
should use their `z` values for the fragment depth used in further fog
calculations.

This fixes the fog in Tux Racer :^)
2021-12-30 14:24:29 +01:00
Jelle Raaijmakers
fef7f7159c LibGL+LibSoftGPU: Implement eye, clip, NDC and window coordinates
This follows the OpenGL 1.5 spec much more closely. We need to store
the eye coordinates especially, since they are used in texture
coordinate generation and fog fragment depth calculation.
2021-12-30 14:24:29 +01:00
Jelle Raaijmakers
fd4d6b0031 LibSoftGPU: Set obvious FP values for depth_min/max 2021-12-30 14:24:29 +01:00
Jelle Raaijmakers
e4080aed00 LibGL: Use standard debug message for gl_materialv 2021-12-30 14:24:29 +01:00
Jelle Raaijmakers
92ecd66490 LibGL: Reduce nesting levels in gl_tex_env 2021-12-30 14:24:29 +01:00
Jelle Raaijmakers
8cf91a5ae5 LibGL: Change gl_tex_gen param to GLint
The singular form of `glTexGeni/f/d` only supports constants, not
floating point values as its parameter.
2021-12-30 14:24:29 +01:00
Jelle Raaijmakers
ab6a869f55 LibSoftGPU: Drop unnecessary FP divisions in to_vec4 2021-12-30 14:24:29 +01:00
Jelle Raaijmakers
079c14931f LibSoftGPU: Be less lenient towards unknown enum values 2021-12-30 14:24:29 +01:00
Jelle Raaijmakers
9d90bab91b LibSoftGPU: Prevent fog from overwriting the alpha channel
Fog only affects the RGB channels according to the spec.
2021-12-30 14:24:29 +01:00
Jelle Raaijmakers
f2d8fcb830 LibGL: Remove glPush/PopMatrix debug spam
Even behind the `GL_DEBUG` macro this was too noisy.
2021-12-30 14:24:29 +01:00
Jelle Raaijmakers
3a5f69b6f3 LibGL+LibSoftGPU: Implement normalization of normals
* LibGL now supports the `GL_NORMALIZE` capability
* LibSoftGPU transforms and normalizes the vertices' normals

Normals are heavily used in texture coordinate generation, to be
implemented in a future commit.
2021-12-30 14:24:29 +01:00
Jelle Raaijmakers
e056cf7e3f LibGfx: Mark some Matrix functions as [[nodiscard]] 2021-12-30 14:24:29 +01:00
Jelle Raaijmakers
57e1dc7765 LibGfx: Add Matrix3x3
This defines `Matrix3x3`, `FloatMatrix3x3` and `DoubleMatrix3x3`
mirroring `Matrix4x4`. Since we will need matrix multiplication with a
`Vector3` for LibGL's normalization, we also add that `*` operator.
2021-12-30 14:24:29 +01:00
Jelle Raaijmakers
9bc8587c0d LibGL: Implement fog in GL_LINEAR mode
The `GL_LINEAR` param was erroneously not picked up on. Also implement
support for `GL_FOG_START` and `GL_FOG_END`, and make sure that the
`gl_fog*` family of functions are optionally registered with the active
list.
2021-12-30 14:24:29 +01:00
Jelle Raaijmakers
5e01ca29c5 LibGL: Optimize float divisions in unpack_color
For Tux Racer on my machine, this function would account for 15% of
samples. After this change, that drops down to 9%.
2021-12-30 14:24:29 +01:00
Jelle Raaijmakers
8d8f74e334 Ports: Implement SDL_QUIT event in Tux Racer
This allows the user to close Tux Racer by closing the window.
2021-12-30 14:24:29 +01:00
Jelle Raaijmakers
1a3af23a10 LibGL: Defer depth writing until after alpha testing
In the OpenGL fixed function pipeline, alpha testing should happen
before depth testing and writing. Since the tests are basically boolean
ANDs, we can reorder them however we like to improve performance and as
such, we perform early depth testing and delay the more expensive alpha
testing until we know which pixels to test.

However, we were already writing to the depth buffer during the depth
test, even if the alpha test fails later on. Depth writing should only
happen if depth testing _and_ writing is enabled.

This change introduces depth staging, deferring the depth write until
we are absolutely sure we should do so.
2021-12-30 14:24:29 +01:00
Timothy Flynn
565a880ce5 Userland: Link directly against LibUnicodeData where needed
This is partially a revert of commits:
    10a8b6d411
    561b67a1ad

Rather than adding the prot_exec pledge requried to use dlopen(), we can
link directly against LibUnicodeData in applications that we know need
that library.

This might make the dlopen() dance a bit unnecessary. The same purpose
might now be fulfilled with weak symbols. That can be revisted next, but
for now, this at least removes the potential security risk of apps like
the Browser having prot_exec privileges.
2021-12-30 14:18:12 +01:00
Timothy Flynn
0c84957eba Meta: Add helper CMake function to link directly against LibUnicodeData
Rather than each CMakeLists.txt needing to import unicode_data.cmake and
check if Unicode data generation is enabled, add a helper method to do
this.
2021-12-30 14:18:12 +01:00
Daniel Bertalan
8e2efe78f7 Kernel: Tighten String-related includes 2021-12-30 14:16:03 +01:00
Daniel Bertalan
2175c689ef Kernel: Remove redundant (K)String::characters() calls 2021-12-30 14:16:03 +01:00