Commit Graph

18225 Commits

Author SHA1 Message Date
davidot
1d846e5591 LibWeb: Visit internal fields of Crypto in visit_edges
Not visiting the field holding SubtleCrypto in Crypto caused subtle
crashes all over the Value functions, due to accessing SubtleCrypto
after it was garbage collected (and potentially replaced by a new cell).
This meant that the crashes were only appearing in Value::to_boolean,
Value::typeof, etc. Which then held pointer to things that looked like
Shapes, Environments and other non-Object Cells.

To find the actual cause, all pointer used to construct Values were
checked and if a pointer was none of the allowed types, the backtrace
is logged.

Co-authored-by: Luke Wilde <lukew@serenityos.org>
2022-09-12 20:14:58 -04:00
Ben Wiederhake
0e901f8c68 Shell: Sort CompletionSuggestions for paths lexicographically
This used to be ordered by inode, which can be surprising.
2022-09-12 16:49:48 +01:00
networkException
802cf9bc69 Everywhere: Use my very shiny serenityos.org email :^) 2022-09-12 15:13:12 +01:00
Ali Mohammad Pur
660d2b53b1 LibRegex: Account for eof after \<x> when 'x' leads to legacy behaviour 2022-09-12 16:03:57 +04:30
Ali Mohammad Pur
48442059fc LibRegex: Consume exactly two chars for escaped characters
We were previously consuming an extra char afterwards, which could be
the charclass terminator, leading to possible OOB accesses.
2022-09-12 16:03:57 +04:30
networkException
45aeba15c8 CharacterMap: Allow resizing the unicode block list
Previously we would constrain the unicode block list to a width of 175,
causing it to stick to the splitter when manually resizing.

This patch allows resizing the list properly while retaining the new
width when resizing the window.
2022-09-11 23:25:08 +01:00
Linus Groh
81f1183e28 Tubes: Run clang-format 2022-09-11 23:24:33 +01:00
Jelle Raaijmakers
9dfe50170e Demos: Add Tubes :^) 2022-09-11 22:45:49 +01:00
Jelle Raaijmakers
16ca9ec762 LibGfx: Templatize VectorN::length()
This allows us to get a `float` length from an `IntVector3` without
needing to convert to `FloatVector3` first.
2022-09-11 22:45:49 +01:00
Jelle Raaijmakers
70ea2a2258 LibGL: Implement glNormal3d 2022-09-11 22:45:49 +01:00
Jelle Raaijmakers
1aa1c89afa LibGL+LibGPU+LibSoftGPU: Report texture clamp to edge support 2022-09-11 22:37:07 +01:00
Jelle Raaijmakers
087f565700 LibSoftGPU: Divide texture coordinates by Q
Up until now, we have only dealt with games that pass Q = 1 for their
texture coordinates. PrBoom+, however, relies on proper homogenous
texture coordinates for its relatively complex sky rendering, which
means that we should perform this per-fragment division.
2022-09-11 22:37:07 +01:00
Jelle Raaijmakers
72782d845d LibGL: Ensure texture coordinate Q is set to 1 by default
When using vertex attribute pointers, we default the Q coordinate for
textures to 0 causing issues if the 4th coordinate is not passed in the
vertex data.

Clean up these defaults and make sure that Q is always set to `1.f`.
2022-09-11 22:37:07 +01:00
Jelle Raaijmakers
af217b0c3a LibGL: Implement GL_(CLIENT_)?ACTIVE_TEXTURE context parameters 2022-09-11 22:37:07 +01:00
Jelle Raaijmakers
00d46e5d77 LibGL+LibGPU+LibSoftGPU: Implement matrix stack per texture unit
Each texture unit now has its own texture transformation matrix stack.
Introduce a new texture unit configuration that is synced when changed.
Because we're no longer passing a silly `Vector` when drawing each
primitive, this results in a slightly improved frames per second :^)
2022-09-11 22:37:07 +01:00
Jelle Raaijmakers
1540c56e6c LibGL+LibGPU+LibSoftGPU: Implement GL_GENERATE_MIPMAP
We can now generate texture mipmaps on the fly if the client requests
it. This fixes the missing textures in our PrBoom+ port.
2022-09-11 22:37:07 +01:00
Jelle Raaijmakers
dda5987684 LibGL+LibGPU+LibSoftGPU: Remove concept of layer in favor of depth
Looking at how Khronos defines layers:

  https://www.khronos.org/opengl/wiki/Array_Texture

We both have 3D textures and layers of 2D textures, which can both be
encoded in our existing `Typed3DBuffer` as depth. Since we support
depth already in the GPU API, remove layer everywhere.

Also pass in `Texture2D::LOG2_MAX_TEXTURE_SIZE` as the maximum number
of mipmap levels, so we do not allocate 999 levels on each Image
instantiation.
2022-09-11 22:37:07 +01:00
Jelle Raaijmakers
44953a4301 LibGL+LibGPU+LibSoftGPU: Implement glCopyTex(Sub)?Image2d
These two methods copy from the frame buffer to (part of) a texture.
2022-09-11 22:37:07 +01:00
Jelle Raaijmakers
d7f1dc146e LibGL: Calculate maximum log2 of texture size 2022-09-11 22:37:07 +01:00
Jelle Raaijmakers
eb81b66b4e LibGL+LibGPU+LibSoftGPU: Rename blit_color_buffer_to
This makes it consistent with our other `blit_from_color_buffer` and
paves the way for a third method that will be introduced in one of the
next commits.
2022-09-11 22:37:07 +01:00
Jelle Raaijmakers
1d36bfdac1 LibGL+LibSoftGPU: Implement fixed pipeline support for GL_COMBINE
`GL_COMBINE` is basically a fixed function calculator to perform simple
arithmetics on configurable fragment sources. This patch implements a
number of texture env parameters with support for the RGBA internal
format.
2022-09-11 22:37:07 +01:00
Jelle Raaijmakers
494024b70e LibGL: Verify Texture2D existence
The code currently guarantees that we always have a target texture.
2022-09-11 22:37:07 +01:00
Jelle Raaijmakers
72b4f95f71 LibGL: Implement glMultiTexCoord2fv(ARB)? APIs 2022-09-11 22:37:07 +01:00
Jelle Raaijmakers
789d871892 LibGL: Define GL_NO_ERROR as 0
This conforms to the Khronos enum value listing and prevents a
redefinition warning when compiling with SDL_opengl.
2022-09-11 22:37:07 +01:00
Jelle Raaijmakers
6d8dd0ee61 LibGL: Remove unused/default includes from GLContext 2022-09-11 22:37:07 +01:00
Jelle Raaijmakers
07e94b3ec1 LibGL: Implement GL_CURRENT_COLOR context parameter 2022-09-11 22:37:07 +01:00
Jelle Raaijmakers
759ef82e75 LibSoftGPU: Convert width and height to f32x4 just once
We were passing along a `u32x4` only for it to be converted to `f32x4`
as soon as we'd use it.
2022-09-11 22:37:07 +01:00
Jelle Raaijmakers
b62dba6bbf LibSoftGPU: Remove unused alias truncate_int_range 2022-09-11 22:37:07 +01:00
networkException
9ff6c1e692 LibWeb: Avoid copying viewport rect when converting length to pixels
See https://github.com/SerenityOS/serenity/pull/3433#discussion_r484570948
2022-09-11 22:08:38 +01:00
networkException
2612d23032 LibGUI: Implement rubber band selection in table view
This patch implements rubber band selection in table view while clamping
the rubber band rect to the widget inner rect, matching the behavior of
IconView and ColumnsView.
2022-09-11 21:39:32 +01:00
networkException
e0353c405d LibGUI: Limit column view rubber band rect to widget inner rect
Previously when selecting a column that was partially scrolled out of
view the rubber band rect would extend outside the widget inner rect.

This patch rewrites the implementation to be more readable and clamps
the rubber band rect to the widget inner rect to match the behavior of
IconView.
2022-09-11 21:39:32 +01:00
networkException
e42a9cf957 LibGUI: Properly limit the icon view rubber band rect to the widget
Previously the rubber band rect of IconView was not properly constrained
to the widget inner rect, leaving a one pixel gap on the bottom and
right side. This patch removes the gap by inflating the constraint rect
by one pixel on each axis.
2022-09-11 21:39:32 +01:00
Timothy Flynn
5190f4e605 LibGUI: Support emoji with multiple code points in EmojiInputDialog 2022-09-11 20:33:57 +01:00
Timothy Flynn
31b2d93038 LibGUI+LibVT: Notify widgets of emoji selection with a callback
Currently, LibGUI modifies the Ctrl+Alt+Space key event to instead
represent the emoji that was selected through EmojiInputDialog. This is
limited to a single code point.

For multiple code point emoji support, individual widgets now set a hook
to be notified of the emoji selection with a UTF-8 encoded string. This
replaces the previous set_accepts_emoji_input() method.
2022-09-11 20:33:57 +01:00
Timothy Flynn
8190120f95 LibGUI: Use discovered emoji files as the EmojiInputDialog button icons
Rather than rendering the emoji as text, use the emoji icons themselves.
2022-09-11 20:33:57 +01:00
Timothy Flynn
a2eb42a9c0 LibGUI: Add an emoji category filter for SerenityOS custom emojis
Most of the emoji are 7x10px (or close to that). But some are larger, on
the order of 128x128px. The icon used for the SerenityOS category is one
such large emoji, and must be scaled down to an appropriate size for
rendering.
2022-09-11 20:33:57 +01:00
Timothy Flynn
4cb9472f97 LibGUI: Ensure unknown emoji have a set display order
Currently, we use code point values as a tie break when sorting emoji by
display order. When multiple code point emoji are supported, this will
become a bit awkward. Rather than dealing with varying code point length
while sorting, just set a maximum display order to ensure these are
placed at the end.
2022-09-11 20:33:57 +01:00
Timothy Flynn
b7ef36aa36 LibUnicode: Parse and generate custom emoji added for SerenityOS
Parse emoji from emoji-serenity.txt to allow displaying their names and
grouping them together in the EmojiInputDialog.

This also adds an "Unknown" value to the EmojiGroup enum. This will be
useful for emoji that aren't found in the UCD, or for when UCD downloads
are disabled.
2022-09-11 20:33:57 +01:00
davidot
b6094b7a3d LibTest: Extract some useful functions from TestRunner.h
This allows other test like programs to use these without needing to
link to LibTest.
2022-09-11 20:25:51 +01:00
Liav A
5d0edc7a42 WindowServer: Unveil only subdirectories in /dev directory
Now that each HID device node is located in /dev/input/, and Display
Connector device nodes are in /dev/gpu/, we can simply just unveil those
directories instead of the entire /dev directory.
2022-09-11 19:51:23 +01:00
Liav A
89835558b4 Userland: Move HID input device nodes to /dev/input/{mouse,keyboard}
Because HID devices are not always present in quantities of one per type
it is more elegant and correct to put the representative device nodes in
subdirectories for each HID device type.
2022-09-11 19:51:23 +01:00
networkException
1346a653e4 WidgetGallery: Port file picker to use FileSystemAccessClient
Previously we would unveil the home directory of anon to allow showing
anything in the file picker. This patch removes direct access to the
home directory and instead makes WidgetGallery connect to
FileSystemAccessServer to open a file, making the application more user
agnostic and allowing directories outside /home/anon to be shown.
2022-09-10 20:41:16 +01:00
networkException
08f465a47d LibGUI: Blit brightened icon when try item is hovered 2022-09-10 20:40:05 +01:00
davidot
d4736d17ae LibJS: Allow negative pointers in Value
Also ensure that all a nullptr input gives null object and you don't
accidentally dereference a nullptr.
2022-09-10 00:05:32 +01:00
Jelle Raaijmakers
325263f0e8 LibC: Consume all whitespace in scanf if present in format
We were consuming all whitespace from the format, but not the input
lexer - that was left to the actual format parsing code. It so happened
that we did not account for whitespace with the conversion specifier
'[', causing whitespace to end up in the output variables.

Fix this by always consuming all whitespace and removing the whitespace
logic from the conversion code.
2022-09-09 22:54:25 +01:00
Luke Wilde
875ca2fb68 LibWeb: Set prototype for both TextDecoder and AbortSignal
These were forgotten to be set during the GC heap conversion.
2022-09-09 20:47:43 +02:00
Cr4xy
ac60633694 Keymap: Rename context menu item "Settings" to "Keyboard Settings"
This is a very small change to improve consistency between applet
context menu item names.
2022-09-09 18:59:04 +01:00
networkException
75ac47dbd8 LibWeb: Resolve two document-tree child browsing context count FIXMEs
This patch makes use of helpers implemented for window.length to resolve
two FIXMEs in WindowProxy previously simply assuming no child browsing
contexts :^)
2022-09-09 17:42:30 +01:00
networkException
e377e28fd2 LibWeb: Implement window.length 2022-09-09 17:42:30 +01:00
thankyouverycool
b70e4e9909 Spreadsheet+LibGUI: Set EmojiInputDialog as a CaptureInput modal
This has two advantages: First the picker no longer changes the active
window state of its parent. Visually this is an additional hint that the
dialog is "fragile" and will close on loss of focus. Second, because
it contains a search box, its own input won't be preempted by global
application shortcuts when typing (pending #15129). This is a problem
in apps like PixelPaint which use shortcuts without modifiers.
2022-09-09 11:27:38 -04:00