Commit graph

34743 commits

Author SHA1 Message Date
kleines Filmröllchen 604309327e AK: Add the Fundamental concept 2022-02-23 00:42:49 +00:00
kleines Filmröllchen 7418bdb85f AK: Prevent Atomic with complex types
This would throw some really weird linker errors, so let's prevent it
from happening instead!
2022-02-23 00:42:49 +00:00
Jelle Raaijmakers d905de6a7a LibGL: Set correct matrices in glFrustum and glOrtho
We were erroneously setting the projection matrix when `GL_MODELVIEW`
was supplied.
2022-02-22 23:48:59 +00:00
Jelle Raaijmakers 5cf967e4f2 LibGL: Improve glFrustum precision and error handling
Do not convert to float too early. Additionally, handle some error
cases for the input parameters.
2022-02-22 23:48:59 +00:00
Jelle Raaijmakers d92047c74d LibGL: Clamp color in glClearColor to 0..1 2022-02-22 23:48:59 +00:00
Jelle Raaijmakers 44a3d5c101 LibGL: Implement glClearDepthf and store as float
Our API still specifies it as a double, but internally we communicate a
float to the rasterizer. Additionally, clamp the value to 0..1 as
described in the spec.
2022-02-22 23:48:59 +00:00
Jelle Raaijmakers 36a732e98e LibGL: Ignore stack on projection and model view matrix retrieval
Our implementation keeps the top-most item on the matrix stacks in a
member variable, so we can always use that instead of considering the
actual stack.

Additionally, the current matrix mode should not influence retrieving
the projection or model view matrix.
2022-02-22 23:48:59 +00:00
Jelle Raaijmakers c3273e9492 LibSoftGPU: Clean up some conditionals in Device
No functional changes.
2022-02-22 23:48:59 +00:00
Jelle Raaijmakers f28047de73 LibSoftGPU: Round rasterization position to nearest integer
This fixes the issue where e.g. `299.97` would be cast to an integer
value of `299`, whereas the pixel's center would lie at `299.5` and
would then erroneously be excluded.
2022-02-22 23:48:59 +00:00
Jelle Raaijmakers 8c9fa50c61 LibSoftGPU: Apply regular cartesian coordinate system
Currently, LibSoftGPU is still OpenGL-minded in that it uses a
coordinate system with the origin of `(0, 0)` at the lower-left of
textures, buffers and window coordinates. Because we are blitting to a
`Gfx::Bitmap` that has the origin at the top-left, we need to flip the
Y-coordinates somewhere in the rasterization logic.

We used to do this during conversion of NDC-coordinates to window
coordinates. This resulted in some incorrect behavior when
rasterization did not pass through the vertex transformation logic,
e.g. when calling `glDrawPixels`.

This changes the coordinate system to OpenGL's throughout, only to blit
the final color buffer upside down to the target bitmap. This fixes
drawing to the depth buffer directly resulting in upside down images.
2022-02-22 23:48:59 +00:00
Jelle Raaijmakers 3832656464 LibGL: East-const two methods in Texture2D
No functional changes.
2022-02-22 23:48:59 +00:00
Jelle Raaijmakers 7004b20656 LibGL+LibSoftGPU: Use more expressive is_power_of_two 2022-02-22 23:48:59 +00:00
Jelle Raaijmakers 971b39ae4f LibSoftGPU: Rename rgba to bgra to reflect actual value 2022-02-22 23:48:59 +00:00
Jelle Raaijmakers 506a857c3e LibGL: Use clamp<float> for depth range
We get `double`s as input, so convert them to `float` first.
2022-02-22 23:48:59 +00:00
Jelle Raaijmakers db0616c67a LibSoftGPU: Generalize pixel buffers and standardize on BGRA8888
Between the OpenGL client and server, a lot of data type and color
conversion needs to happen. We are performing these conversions both in
`LibSoftGPU` and `LibGL`, which is not ideal. Additionally, some
concepts like the color, depth and stencil buffers should share their
logic but have separate implementations.

This is the first step towards generalizing our `LibSoftGPU` frame
buffer: a generalized `Typed3DBuffer` is introduced for arbitrary 3D
value storage and retrieval, and `Typed2DBuffer` wraps around it to
provide in an easy-to-use 2D pixel buffer. The color, depth and stencil
buffers are replaced by `Typed2DBuffer` and are now managed by the new
`FrameBuffer` class.

The `Image` class now uses multiple `Typed3DBuffer`s for layers and
mipmap levels. Additionally, the textures are now always stored as
BGRA8888, only converting between formats when reading or writing
pixels.

Ideally this refactor should have no functional changes, but some
graphical glitches in Grim Fandango seem to be fixed and most OpenGL
ports get an FPS boost on my machine. :^)
2022-02-22 23:48:59 +00:00
Jelle Raaijmakers 72ec2c21f4 LibGL: Remove superfluous AK::dbgln alias 2022-02-22 23:48:59 +00:00
Jelle Raaijmakers 6318522339 LibSoftGPU: Remove Device::wait_for_all_threads()
This function was added as a FIXME but was then arbitrarily invoked in
the rest of `Device`. We are better off removing this FIXME for now and
reevaluate introducing multithreading later on, so the code is not
littered with useless empty function calls.
2022-02-22 23:48:59 +00:00
Jelle Raaijmakers 4d53a87355 LibSoftGPU: Remove unused AK/Function.h include 2022-02-22 23:48:59 +00:00
Jelle Raaijmakers a5ad702387 LibSoftGPU: Use fabsf instead of fabs for float
Let's not do a `float -> double -> float` roundtrip. :^)
2022-02-22 23:48:59 +00:00
Jelle Raaijmakers 011f6542db LibGL: Allow all primitives in glBegin()
We check for primitive support in `glEnd()`, so we do not need to
preemptively reject the mode in `glBegin()`. This allows `glBegin()` to
be invoked with `GL_POINTS`, for example.
2022-02-22 23:48:59 +00:00
Jelle Raaijmakers e3d5a11d84 Ports: Enable monkey4 engine for ScummVM
This depends on both the `libmpeg2` and `libmad` ports. Since `monkey4`
is currently an experimental engine in ScummVM, we need to explicitly
enable it during configuration.
2022-02-22 23:48:59 +00:00
Jelle Raaijmakers 6a3017625b Ports: Add libmpeg2 2022-02-22 23:48:59 +00:00
Jelle Raaijmakers 5b593783f3 Ports: Add libmad 2022-02-22 23:48:59 +00:00
Ali Mohammad Pur bed129a69f LibTest+Spreadsheet: Add some basic spreadsheet runtime behaviour tests
As there's a somewhat active development going on, let's keep the
expected behaviour under tests to make sure nothing blows up :^)
2022-02-23 03:17:12 +03:30
Ali Mohammad Pur 0fe97cdfe4 LibJS: Print the expected and received value on expect.toEqual() failure
'ExpectationError' is hardly an actionable error message.
2022-02-23 03:17:12 +03:30
Ali Mohammad Pur 6bb0c09bc1 Spreadsheet: Make Range.forEach() stop looping when it receives a Break
Not having this broke the mechanism behind lookup() and reflookup().
2022-02-23 03:17:12 +03:30
thankyouverycool 4ccb6c8815 Base: Merge Serifina into Roman font family as italic variant 2022-02-22 22:53:05 +00:00
Ryan Chandler 05cdfb8698 Shell: Start history counter from 1
Previously would show the list of history items starting from
an index of 0.

This is a bit misleading though. Running `!0` would actually cause
the parser to error out and prevent you from running the command.
2022-02-22 21:26:25 +03:30
electrikmilk 8fe20232e8 Base: Fix Cyrillic in Katica
Previously I thought I finished this section but I missed some
characters. My bad!

This fix completes the Cyrillic section, as this fix adds the proper
characters for U+0F4D, U+04FE, U+04FF.
2022-02-22 13:33:42 +00:00
JT b426623f9d Documentation: Add sudo apt update step to build instructions
This adds the necessary `sudo apt update` to the build instructions
after adding the GCC 11 respository.
2022-02-22 13:10:17 +00:00
Tom 97e18a6ce1 WindowServer: Mark window frame as invalidated when updating title
We need to set Window::m_invalidated_frame to true when invalidating
the title, otherwise we may miss re-rendering the frame if nothing
else triggers it.
2022-02-21 20:34:36 -08:00
u9g 678d26dd19 Spreadsheet: Fix calling variable that wasn't defined 2022-02-22 07:53:02 +03:30
Brian Gianforcaro d05fa14e52 Kernel: Use TRY() when validating clock_id in TimeManagement
Gets rid of a bit of code duplication, and makes the API more consistent
with the style we are moving towards.
2022-02-21 15:47:51 -08:00
Idan Horowitz e167cafa70 SystemMonitor: Add missing /boot/Kernel.debug unveil
When using the stack tab as root LibSymbolication uses this file to
provide Kernel symbols.
2022-02-21 23:30:46 +02:00
Andreas Kling b45ed48ca7 LibWeb: Support CSSStyleDeclaration.cssFloat
Unlike all the other CSS properties, 'float' is special, and can only be
accessed via 'cssFloat' on CSSStyleDeclaration. So this patch adds
support for that. 1 point on ACID3! :^)
2022-02-21 22:27:56 +01:00
Andreas Kling 19b5033dc4 LibWeb: Implement Node.removeChild() in terms of "pre-remove"
This is what the spec wants us to do.
2022-02-21 22:21:59 +01:00
Andreas Kling 8b2499b112 LibWeb: Make document.write() work while document is parsing
This necessitated making HTMLParser ref-counted, and having it register
itself with Document when created. That makes it possible for scripts to
add new input at the current parser insertion point.

There is now a reference cycle between Document and HTMLParser. This
cycle is explicitly broken by calling Document::detach_parser() at the
end of HTMLParser::run().

This is a huge progression on ACID3, from 31% to 49%! :^)
2022-02-21 22:00:28 +01:00
Andreas Kling bb1f26c149 LibWeb: Use correct coordinate space when measuring space between floats
When calculating how much space is available for inline content between
left and right floated elements, we have to use coordinates in the
containing block's coordinate space, since that's what floats use.

This fixes an issue where text would sometimes overlap floats.
2022-02-21 20:42:34 +01:00
Andreas Kling 8c2a4a2a3d LibWeb: Calculate edge of containing block correctly when floating right 2022-02-21 20:42:34 +01:00
Andreas Kling f21a0bf437 LibWeb: Don't shift right-floated boxes too much to the left
We were subtracting the content width of right-floated boxes from their
X position for no reason. Removing this makes floats snuggle up to each
other on the right side. :^)
2022-02-21 20:42:34 +01:00
Tom a5ce5564a9 Kernel: Fix allocating identity-mapped APIC memory on x86_64
We were not allocating enough memory due to using u32 instead of
FlatPtr for each AP's stack pointer.
2022-02-21 20:44:09 +02:00
Idan Horowitz 5fa75dbcda Kernel: Try to dispatch pending signals on context switch
This ensures that processes that don't perform any syscalls will also
eventually receive signals.
2022-02-21 19:42:16 +01:00
Idan Horowitz 0911112286 Kernel: VERIFY that signals are not sent to Kernel processes
Kernel processes can't handle signals, nor should they ever receive any
2022-02-21 19:42:16 +01:00
Idan Horowitz 2c996cbbee Kernel: Stop sending SIGCHLD to kernel parent processes
Kernel processes cannot handle signals.
2022-02-21 19:42:16 +01:00
Andreas Kling 5a770f2eff LibWeb: Fix floating boxes getting stacked on top of each other
This was caused by the freestanding margin_box_rect() using 0 for the
content height instead of the actual content height.
2022-02-21 19:38:50 +01:00
Andreas Kling 89d0cb0ce2 LibWeb: Compute table cell height after doing its inside layout 2022-02-21 18:35:12 +01:00
Andreas Kling db5bf6e64c LibWeb: Rename FormattingState::ensure() -> get_mutable()
This makes it much more obvious what the difference between get() and
get_mutable() is.
2022-02-21 18:35:12 +01:00
Andreas Kling 0f15d1f947 LibWeb: Add hack to avoid crashing on !child_display.is_flow_inside()
When encountering a box that claims to have block-level children, but
its CSS display type isn't actually "flow" inside, we would previously
crash due to a VERIFY() failure.

However, many sites choke on this due to freestanding table-related
boxes like those created by "table-row" and "table-row-group".
We're supposed to fix those up by wrapping them in a full set of table
boxes during layout tree construction, but that algorithm obviously
isn't working correctly in all cases. So let's work around the crashes
for now, allowing many more sites to load (even if visually incorrect.)

This is a rather monstrous hack, and we should get rid of it as soon as
it's not needed anymore.
2022-02-21 18:35:12 +01:00
Andreas Kling c61747fb2a LibWeb: Respect font-size specified by CSS in "em" length calculations
"5em" means 5*font-size, but by forcing "em" to mean the presentation
size of the bitmap font actually used, we broke a bunch of layouts that
depended on a correct interpretation of "em".

This means that "em" units will no longer be relative to the exact
size of the bitmap font in use, but I think that's a compromise we'll
have to make, since accurate layouts are more important.

This yields a visual progression on both ACID2 and ACID3. :^)
2022-02-21 18:35:12 +01:00
Andreas Kling 2615728d6b LibWeb: Store overflow data in the FormattingState 2022-02-21 18:35:12 +01:00