Commit graph

21084 commits

Author SHA1 Message Date
Stephan Unverwerth
60c9e3bfc6 Demos: Remove VirGLDemo
All interesting code from the demo now lives in LibVirtGPU.
2022-12-26 09:39:20 +01:00
Stephan Unverwerth
2658351fa6 LibVirtGPU: Adopt rendering code from VirGLDemo 2022-12-26 09:39:20 +01:00
Stephan Unverwerth
1ec791fcd0 LibVirtGPU: Adopt device initialization code from VirGLDemo 2022-12-26 09:39:20 +01:00
Stephan Unverwerth
086c7c4c88 LibVirtGPU: Create and initialize device from file descriptor 2022-12-26 09:39:20 +01:00
Stephan Unverwerth
4b792cb7be LibVirtGPU: Replace magic values with command bitfields 2022-12-26 09:39:20 +01:00
Stephan Unverwerth
93b5af932e LibVirtGPU: Add utility header for command flag bitfields 2022-12-26 09:39:20 +01:00
Stephan Unverwerth
65a1ebcccf LibVirtGPU: Add enum for Gallium texture formats 2022-12-26 09:39:20 +01:00
Stephan Unverwerth
0993aba321 LibVirtGPU: Add length verification to append_create_shader() 2022-12-26 09:39:20 +01:00
Stephan Unverwerth
140338670a LibVirtGPU: Make depth and color clearing separate functions 2022-12-26 09:39:20 +01:00
Stephan Unverwerth
03884fad74 LibVirtGPU: Remove hard coded primitive type in append_draw_vbo() 2022-12-26 09:39:20 +01:00
Stephan Unverwerth
b5acfba487 LibVirtGPU: Improve append_set_framebuffer_state_no_attach()
Remove hardcoded framebuffer size and add argument verification.
2022-12-26 09:39:20 +01:00
Stephan Unverwerth
4a4aa23aed LibVirtGPU: Remove hardcoded size from append_viewport() 2022-12-26 09:39:20 +01:00
Stephan Unverwerth
7a2b9ad164 LibVirtGPU: Drop gl_ prefix from CommandBufferBuilder methods 2022-12-26 09:39:20 +01:00
Stephan Unverwerth
b220ed6b5c LibVirtGPU: Use c++ style casts in CommandBuilder 2022-12-26 09:39:20 +01:00
Stephan Unverwerth
44b2a746ca LibVirtGPU: Improve type safety of encode_command()
ObjectType is now passed as an enum instead of a plain number. The
underlying type for both ObjectType and VirGLCommand have been reduced
to u8 to make sure they fit in the encoded command. Command length is
verified to not overflow u16.
2022-12-26 09:39:20 +01:00
Stephan Unverwerth
ce57174802 LibVirtGPU: Make BindTarget an enum and move it into VirtGPU::Protocol 2022-12-26 09:39:20 +01:00
Stephan Unverwerth
51ac0d73a3 LibVirtGPU: Move VirGLDemo protocol code into VirtGPU namespace 2022-12-26 09:39:20 +01:00
Stephan Unverwerth
a95eea5ae2 LibVirtGPU: Add newlines between CommandBuilder methods 2022-12-26 09:39:20 +01:00
Stephan Unverwerth
255b12ea97 LibVirtGPU: Remove unnecessary BufferBuilder constructor deletion
Since there is a non-default constructor this line is not needed.
2022-12-26 09:39:20 +01:00
Stephan Unverwerth
a34998fb76 LibVirtGPU: Adopt virgl protocol files from VirGLDemo 2022-12-26 09:39:20 +01:00
Stephan Unverwerth
bd7931ff23 LibGPU+LibVirtGPU: Allow loading the driver and instantiating the device
This adds LibVirtGPU to the list of allowed drivers in LibGPU and adds a
factory method to create the device to libVirtGPU.
2022-12-26 09:39:20 +01:00
Stephan Unverwerth
c52abe0bea LibVirtGPU: Add a new GPU device that talks to our VirtIO-GPU driver
At this moment this only contains function stubs.
2022-12-26 09:39:20 +01:00
Stephan Unverwerth
3b2ded1d44 LibGPU+LibSoftGPU: Move size and pixel format information to GPU::Image
Size and format information are the same for every implementation and do
not need to be virtual. This removes the need to reimplement them for
each driver.
2022-12-26 09:39:20 +01:00
Thomas Keppler
dc8be499e6 WebServer: Use new String type internally as much as possible
Here, we try to use the new String type for everything internal,
keeping the public interface and the interface to other code the same.
2022-12-26 09:38:03 +01:00
Thomas Keppler
1d6528b94b WebServer: Use new String type for default option values
We've also pulled out the default root path instead of folding it in
with the receiving variables, so that it's uniform across all options
with default values.
2022-12-26 09:38:03 +01:00
Thomas Keppler
5d305845e3 WebServer: Require document root and credentials as config init params
Now, there is nothing that can react to `set_...()` calls, so
offering this possibility can cause wrong assumptions as to what one
can do as soon as a WebServer instance has launched.

The main program can still decide whether to supply the optional
credentials or not, but this way, the configuration can become a Value
Object that won't change after initial creation.
2022-12-26 09:38:03 +01:00
Thomas Keppler
bb91857885 WebServer: Rename {real_}root_path to {real_}document_root_path
The concept of a "document root" seems to be a de-facto industry
standard and doesn't make you wonder what kind of root path is meant.
2022-12-26 09:38:03 +01:00
Timothy Flynn
4abafbbe3c LibIPC: Remove requirement that Variant types must begin with Empty
This is no longer required by the decoder.
2022-12-26 09:36:16 +01:00
Timothy Flynn
9b483625e6 LibIPC+Everywhere: Change IPC decoders to construct values in-place
Currently, the generated IPC decoders will default-construct the type to
be decoded, then pass that value by reference to the concrete decoder.
This, of course, requires that the type is default-constructible. This
was an issue for decoding Variants, which had to require the first type
in the Variant list is Empty, to ensure it is default constructible.

Further, this made it possible for values to become uninitialized in
user-defined decoders.

This patch makes the decoder interface such that the concrete decoders
themselves contruct the decoded type upon return from the decoder. To do
so, the default decoders in IPC::Decoder had to be moved to the IPC
namespace scope, as these decoders are now specializations instead of
overloaded methods (C++ requires specializations to be in a namespace
scope).
2022-12-26 09:36:16 +01:00
Timothy Flynn
765c5b416f IPCCompiler+LibIPC: Generate message decoders with better TRY semantics
Instead of a bunch of manual error checking and returning a null OwnPtr,
we can propagate the errors up and return NonnullOwnPtr on success.
2022-12-26 09:36:16 +01:00
Arda Cinar
4fec9540ec Taskbar: Handle errors when adding/changing quick launch entries
This patch removes 2 FIXMEs :^)
2022-12-26 09:31:44 +01:00
Arda Cinar
1acc788500 Taskbar: Add a factory function for TaskbarWindow
This means the errors all the way from Individual widgets get propagated
up.
2022-12-26 09:31:44 +01:00
Arda Cinar
f40cb8d771 Taskbar: Add a factory function for QuickLaunchWidget
This helps propagate errors that might happen when constructing the
quick launch menu. However, the errors are not propagated all the way
yet.
2022-12-26 09:31:44 +01:00
Luke Wilde
fa1416987a LibJS: Add yearOfWeek calendar methods and properties
This is a normative change in the Temporal spec.

See:
- https://github.com/tc39/proposal-temporal/commit/7fa4d18
- https://github.com/tc39/proposal-temporal/commit/caa941d
2022-12-26 09:30:36 +01:00
thankyouverycool
804baa42f9 LibGUI: Standardize automatic scrolling in TextEditor+GlyphMapWidget
Both widgets now make use of their base class's scrolling timer and
now always accept drag selection updates on mousemove_event().

This guarantees much snappier feeling selections when actively moving
the mouse.
2022-12-26 09:27:19 +01:00
thankyouverycool
d938b9effe LibGUI+Applications: Rename automatic scrolling timer functions
Renames on_automatic_scrolling_timer_fired() =>
	automatic_scrolling_timer_did_fire()

The 'on_' prefix is usually reserved for AK::Function hooks.

Renames set_automatic_scrolling_{active,timer}() =>
	set_automatic_scrolling_timer_active()

For consistency, accuracy, and header file A E S T H E T I C S
2022-12-26 09:27:19 +01:00
thankyouverycool
5b02e6a46b LibGUI: Handle Enter+Leave events for automatic cursor trackers
Previously, automatic cursor tracking widgets consumed all mouse
events but did not update their own hover state while active, meaning
Enter and Leave events were not being dispatched.

Fixes TextEditor's automatic selection scroll timer failing to stop
and start while autotracking. Its manual workaround in mousedown
is no longer needed.
2022-12-26 09:27:19 +01:00
Thomas Keppler
a969eac848 pro: Warn if credentials will not be considered for Authorization 2022-12-26 08:06:21 +03:30
Thomas Keppler
b5cae5867a pro: Override authorization with manually set Authorization header 2022-12-26 08:06:21 +03:30
Thomas Keppler
de23e7c2d3 pro: Allow passing Basic Auth credentials for HTTP URLs
Since our WebServer can already react to Basic Auth, now there is a way
to use that in SerenityOS :^)

This commit intentionally omits any Digest authentication.

NOTE: We specifically allow for empty credentials (just ':'), since
standard RFC7617 doesn't explicitly prohibit this.
2022-12-26 08:06:21 +03:30
Thomas Keppler
d2171abb2c pro: Add header format to argument help 2022-12-26 08:06:21 +03:30
ominusliticus
ae16cfff0f HackStudio: Remove release_values_but_fixme_should_propogate_errorss
There were a total of 20 fixmes that were removed. This required me to
create a `initialize_all()` function for the HackStudioWidget class
that could actually propagate the errors forward to the Serenity::Main
function for the HackStudio application.

All the fixmes dealt with loading icons for the various actions
possible.
This should not be a failure that keeps HackStudio from running, but
currently, if the icons cannot be loaded HackStudio fails to open.
2022-12-26 04:57:02 +03:30
Baitinq
419dea0996 WebDriver: Implement stub for .../element/{element id}/click
This patch adds a stub implementation for the POST
/session/{session id}/element/{element id}/click endpoint.
2022-12-25 17:24:52 +01:00
Baitinq
6a72a4df96 LibWeb: Propagate errors in Element::scroll_into_view()
This patch will allow us to handle scrolling errors in the WebDriver
implementation :)
2022-12-25 17:24:52 +01:00
Andrew Kaster
9a66a9ac4a LibWasm: Split SaturatingTruncate conversion function by float/non-float
It's possible to construct a floating point value that when converted to
double is not larger than i64::max(), but when remaining a float is
larger. This patch avoids that edge case with some even less exciting if
constexpr branches to fix a float-cast-overflow UBSAN error on macOS
with llvm 15.0.6.
2022-12-25 07:58:58 -07:00
Jelle Raaijmakers
ae82b14e59 LibGL+LibWeb: Remove WebGL-specific API from GLContext
The OpenGL API has ways to retrieve these values, so let's make sure to
implement them. :^)
2022-12-25 15:48:59 +01:00
Aayush
bc1293925a Hackstudio: Use `GUI::TextEditor' actions for cut/copy/paste buttons
This fixes a bug where hackstudio's language server will crash upon
clicking the 'cut' button when no text is selected.  This was because
the actions were not disabled on empty selection.

We now disable the actions depending on if there is empty selection
inside current tab. We update the cut/copy/paste buttons' actions when
changing tabs.
2022-12-25 15:40:46 +01:00
MacDue
2b1342b120 LibWeb: Remove done gradient painting TODO
This code is already generalised to every gradient in existence.
2022-12-25 15:35:31 +01:00
MacDue
f2fe3245cf LibWeb: Speed up gradient painting quite a lot
Previously gradient painting was dominated by the clipping checks in
Painter::set_pixel(). This commit changes gradient painting to use the
new Painter::fill_pixels() function (which does all these checks outside
the hot loop).

With this change gradient painting drops from 96% of the profile to 51%
when scrolling around on gradients.html. A nice 45% reduction :^)
2022-12-25 15:35:31 +01:00
MacDue
ca01017f32 LibGfx: Add Painter::fill_pixels()
This function fills a region of pixels with the result of a callback
function. This is an alternative to a for loop that repeatedly calls
Painter::set_pixel(), which can get very expensive due to the clipping
checks set_pixel() does each call.
2022-12-25 15:35:31 +01:00