Commit graph

37946 commits

Author SHA1 Message Date
Sam Atkins
f64a164392 Documentation: Correct and update IDL documentation
- Delete the part about removing `[Exposed=Window]` since that's not
  necessary and we may want that information there to generate the
  Window object.
- Mention adding `#import`s.
- Outline the requirements for the implementation class.
- Mention the non-Event wrapper factories that need to know about
  certain types.

I tend to refer to this document every time I add an IDL type so it's
helpful if it's comprehensive.
2022-05-11 20:16:10 +02:00
Sam Atkins
c718ba5947 LibWeb: Implement CSSRule.parentRule and .parentStyleSheet
Both of these are supposed to be set when the CSSRule is created. The
spec is silent on setting it when a CSSRule is added to a parent. So,
this is a bit ad-hoc.

The parent rule gets set whenever a rule is added to a new parent. The
parent stylesheet gets set whenever the rule or one of its ancestors is
added to a different stylesheet. There may be some nuance there that
I'm missing, but I'm sure we'll find out quickly once we have WPT
running!
2022-05-11 20:16:10 +02:00
Sam Atkins
6e6607a92f LibWeb: Allow passing StringView to CSSRuleList::insert_a_css_rule()
The spec is a little bizarre here. One caller of this
(`CSSStyleSheet::insert_rule()`) wants to give it a parsed CSSRule, but
the spec itself wants it to take a string. (As will be used by
`CSSGroupingRule::insert_rule()`) Using a Variant isn't pretty but it's
the best solution I've come to - having two overloads was worse, whether
one called the other or they just duplicated the logic. This seems the
least bad.
2022-05-11 20:16:10 +02:00
Sam Atkins
dfba0cb2d9 LibWeb: Implement @supports serialization 2022-05-11 20:16:10 +02:00
Sam Atkins
1cec8e473f LibWeb: Add CSSSupportsRule wrapper 2022-05-11 20:16:10 +02:00
Sam Atkins
fda71a6d48 LibWeb: Add CSSMediaRule wrapper 2022-05-11 20:16:10 +02:00
Sam Atkins
0cf8986a1e LibWeb: Add CSSImportRule wrapper 2022-05-11 20:16:10 +02:00
Sam Atkins
1951873a5d LibWeb: Add CSSConditionRule wrapper 2022-05-11 20:16:10 +02:00
Sam Atkins
cfe5d63a1e LibWeb: Add CSSGroupingRule wrapper 2022-05-11 20:16:10 +02:00
Sam Atkins
bc4c185aef LibWeb: Add MediaList wrapper
Most of the pieces were already there, I'd just forgotten to actually
wire them up.
2022-05-11 20:16:10 +02:00
Jelle Raaijmakers
b8c0ebccfd LibSoftGPU: Implement depth offset factor
This implements the depth offset factor that you can set through e.g.
OpenGL's `glPolygonOffset`. Without it, triangles might start to Z-
fight amongst each other.

This fixes the floor decals in Quake 3.
2022-05-10 19:36:41 +02:00
offtkp
62d41d58d6 LibGUI: Consider TextEditor icon size when scrolling text horizontally
If an icon exists and the horizontal scroll value is larger than 0,
translate the TextEditor painter by the icon size and padding.

The text would scroll over the icon when the text was long enough to
trigger a horizontal scroll.

Fixes #13669.
2022-05-09 22:52:05 +02:00
Jelle Raaijmakers
a20bf80b05 LibGL+LibGPU+LibSoftGPU: Implement point and line drawing
Implement (anti)aliased point drawing and anti-aliased line drawing.
Supported through LibGL's `GL_POINTS`, `GL_LINES`, `GL_LINE_LOOP` and
`GL_LINE_STRIP`.

In order to support this, `LibSoftGPU`s rasterization logic was
reworked. Now, any primitive can be drawn by invoking `rasterize()`
which takes care of the quad loop and fragment testing logic. Three
callbacks need to be passed:

* `set_coverage_mask`: the primitive needs to provide initial coverage
   mask information so fragments can be discarded early.
* `set_quad_depth`: fragments survived stencil testing, so depth values
  need to be set so depth testing can take place.
* `set_quad_attributes`: fragments survived depth testing, so fragment
  shading is going to take place. All attributes like color, tex coords
  and fog depth need to be set so alpha testing and eventually,
  fragment rasterization can take place.

As of this commit, there are four instantiations of this function:

* Triangle rasterization
* Points - aliased
* Points - anti-aliased
* Lines - anti-aliased

In order to standardize vertex processing for all primitive types,
things like vertex transformation, lighting and tex coord generation
are now taking place before clipping.
2022-05-09 21:49:48 +02:00
Jelle Raaijmakers
950ded7ab9 LibSoftGPU: Mention correct i686 target in Device comment 2022-05-09 21:49:48 +02:00
Jelle Raaijmakers
2c381ea45c AK: Add clamp(f32x4, float, float)
We are allowed to directly compare `f32x4` with a `float`, so make use
of it.
2022-05-09 21:49:48 +02:00
Jelle Raaijmakers
7906ada015 LibSoftGPU: Update coverage mask bits during rasterization
We were not updating `coverage_bits` causing us to perform just a
little bit more work than strictly necessary.
2022-05-09 21:49:48 +02:00
Jelle Raaijmakers
54a24fe45a LibGfx: Use AK::round_to for VectorN::to_rounded<U> 2022-05-09 21:49:48 +02:00
Jelle Raaijmakers
878111abf6 LibGfx: Add VectorN::to_type<T>() 2022-05-09 21:49:48 +02:00
Jelle Raaijmakers
dfe002cfd4 LibGfx: Use VectorN dot product of self for length()
No functional changes.
2022-05-09 21:49:48 +02:00
Jelle Raaijmakers
582fb3f263 LibGL+LibGPU: Copy line width to rasterizer in glLineWidth 2022-05-09 21:49:48 +02:00
Jelle Raaijmakers
0abb7df09b LibGL+LibGPU: Implement GL_LINE_SMOOTH context parameter 2022-05-09 21:49:48 +02:00
Jelle Raaijmakers
f13d4cd3a0 LibGL+LibGPU: Implement GL_POINT_SMOOTH context parameter 2022-05-09 21:49:48 +02:00
Jelle Raaijmakers
0dcb23ee96 LibGL+LibGPU: Implement glPointSize 2022-05-09 21:49:48 +02:00
Jelle Raaijmakers
ac3e46b97d LibGL: Remove break from GL_SCISSOR_BOX context parameter
We already `return` immediately before; no functional changes.
2022-05-09 21:49:48 +02:00
Jelle Raaijmakers
0730bd620c LibGL: Alphabetize GL_LIGHT* cases in gl_enable()
No functional changes.
2022-05-09 21:49:48 +02:00
Jelle Raaijmakers
e34e46ebb3 LibSoftGPU: Reference correct class in Typed2DBuffer comment
No functional changes.
2022-05-09 21:49:48 +02:00
Jelle Raaijmakers
b5a39f5edb Ports: Play GLTron audio at 1x speed
Because of sample rate issues, the audio used to be played at 2x speed.
2022-05-09 21:18:21 +02:00
Jelle Raaijmakers
fa77e6b289 Ports: Convert GLTron patches to new format 2022-05-09 21:18:21 +02:00
Jelle Raaijmakers
37bbfc1b38 Ports: Improve newline support for ./package.sh dev
Previously `git am` could fail on patches with Windows line endings
(CRLF). By supplying `--keep-cr`, we prevent git from stripping the CR
from our patches.
2022-05-09 21:18:21 +02:00
Timon Kruiper
b8854549f2 Kernel: Sort aarch64 CMake sources alphabetically 2022-05-09 21:12:56 +02:00
Timon Kruiper
c515e1341a Kernel: Add initial implementation of Processor in aarch64
Instead of storing the current Processor into a core local register, we
currently just store it into a global, since we don't support SMP for
aarch64 anyway. This simplifies the initial implementation.
2022-05-09 21:12:56 +02:00
Timon Kruiper
ed4bfaed12 Kernel: Call the constructors in the aarch64 init function
Now that we have separated the kmalloc.cpp constructors into a separate
library, we can actually call the constructors in the init function.
2022-05-09 21:12:56 +02:00
Timon Kruiper
2e49d6b001 Kernel: Separate kmalloc.cpp into a separate library similar to x86_64
This will allow the call the constructors of the kmalloc.cpp file
before calling the other constructors in the Kernel.
2022-05-09 21:12:56 +02:00
Timon Kruiper
d449fef606 Kernel: Reorder sections in aarch64 linker script to save space
By putting the NOLOAD sections (.bss and .super_pages) at the end of the
ELF file, objcopy does not have to insert a lot of zeros to make sure
that the .ksyms section is at the right place in memory. Now the .ksyms
section comes before the two NOLOAD sections. This shrinks the
kernel8.img with 6MB, from 8.3M to 2.3M. :^)
2022-05-09 21:12:56 +02:00
Timon Kruiper
a1b352fdc0 Kernel: Add some mission sections to the aarch64 linker script
The sections did end up in the ELF file, however they weren't
explicitely mentioned in the linker.ld script. In the future, we can add
the --orphan-handling=error flag to the linker options, which will
enforce that the sections used in the sources files also are mentioned
in the linker script.
2022-05-09 21:12:56 +02:00
Linus Groh
80048c694a LibJS: Use '2 × nsMaxInstant' in a couple of assertion comments
This is an editorial change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/a225863
2022-05-09 20:27:20 +02:00
Linus Groh
9202f101b5 DisplaySettings: Add 2256x1504 resolution
This is a common resolution of laptops with a 3:2 aspect ratio, such as
the Framework Laptop or Microsoft Surface Laptop.
2022-05-09 20:22:10 +02:00
Karol Kosek
8a9211de4b LibGfx: Add the glyph spacing also to spaces in Painter::draw_text_run()
This caused the text selection not to match the selected glyph after
some words.
2022-05-09 20:16:59 +02:00
networkException
45d78f6435 Documentation: Update the required packages for arch based systems
Since qemu 7 the Arch Linux repository is using a different naming
system for the various required packages. This patch updates the
required dependencies for running serenity.

See https://archlinux.org/news/qemu-700-changes-split-package-setup/
2022-05-09 17:18:25 +02:00
circl
d79486109a LibC: Add missing macro definitions for errno codes 2022-05-08 13:04:32 -07:00
MacDue
739d870091 Fire: Ignore mouse events outside the window (to the left)
This fixes a small issue where if you drag the cursor outside the
window on the left-hand side, the fire demo will still respond to
the mouse events, but wrapped around to the right of the window.
2022-05-08 18:15:12 +02:00
MacDue
934ea4faf1 Fire: Replace #defines with constexprs 2022-05-08 18:15:12 +02:00
Lucas CHOLLET
ebb35e03be Toolchain: Allow BuildQemu.sh to resume downloads
Use -C option for curl to resume if a partially downloaded file already
exists.
2022-05-08 17:48:05 +02:00
Torstennator
f9ec3b986e LibGUI: Fix {Value,Opacity}Slider value changes for values less than 0
This patch fixes a value glitch when changing the slider value via
dragging the knob with the mouse and having a min value smaller than 0.
Before this patch it was not possible to drag the value below 0 and it
just snapped to the configured min value if the mouse was at the most
left position. Now the value is calculated from the value range and
mouse position within the widget.
2022-05-08 17:17:56 +02:00
Luke Wilde
ee6fb51db6 LibJS: Add a couple of missing spec steps to PerformEval
I missed these in 34f902fb52.
2022-05-08 17:12:27 +02:00
Luke Wilde
77ba3d3e3f LibJS: Remove callerRealm from HostEnsureCanCompileStrings
This is a normative change in the ecma262 spec.

See: https://github.com/tc39/ecma262/commit/2527be4
2022-05-08 17:12:27 +02:00
Vitaly Dyachkov
a0a4d169f4 AK+LibGUI: Pass predicate to *_matching() methods by const reference 2022-05-08 17:02:00 +02:00
Romain Chardiny
6ed2ded77c KeyboardSettings: Also activate keymap via ListView's on_activation 2022-05-08 16:58:20 +02:00
EWouters
0317882b61 AK: Use AK:: sin and cos on aarch64 build
This fixes the lagom build on aarch64, as `__builtin_sincosf` doesn't
take double arguments.
2022-05-08 16:51:23 +02:00
Lucas CHOLLET
c2d999eb52 Meta: Remove hardcoded resize2fs executable path
Let which find the resize2fs executable path for us, and use `/usr/sbin`
as a default.
2022-05-08 16:49:52 +02:00