Commit Graph

12109 Commits

Author SHA1 Message Date
Jelle Raaijmakers
7833f25f8f LibGL: Remove stubbed border from glTexImage2D
Providing anything else than `border == 0` is deprecated and should
result in an invalid value error.
2021-12-27 11:58:43 +01:00
Jelle Raaijmakers
b2e75929f4 LibGL: Implement GL_LINEAR_MIPMAP_NEAREST support 2021-12-27 11:58:43 +01:00
Jelle Raaijmakers
ccf6769d95 LibGL: Stub more API calls
These stubs are largely implemented the same: their API is exposed, but
they print to the debug console and sometimes `TODO()`. These changes
allow GLU and Tux Racer to build.

Methods stubbed:

* `glTexImage1D`
* `glTexImage3D`
* `glTexCoord2d(v)`
* `glNormalPointer`
* `glTexGen(d|f|i)`
* `glTexGenfv`
2021-12-27 11:58:43 +01:00
Jelle Raaijmakers
abecff1766 LibGL: Stub lots of map-related methods
This adds stubs for `glMap(1|2)(d|f)`, `glMapGrid(1|2)(d|f)`,
`glEvalCoord(1|2)(d|f)`, `glEvalMesh(1|2)` and `glEvalPoint(1|2)`.
2021-12-27 11:58:43 +01:00
Jelle Raaijmakers
dae63352a3 LibGL: Implement glGetTexLevelParameteriv 2021-12-27 11:58:43 +01:00
Jelle Raaijmakers
d83702cb92 LibGL: Implement glRectf and glRecti 2021-12-27 11:58:43 +01:00
Jelle Raaijmakers
4a36d6b439 LibGL: Implement glMultMatrixd 2021-12-27 11:58:43 +01:00
Jelle Raaijmakers
60fa921daa LibGL: Fix GL_TRIANGLE_STRIP rendering only half its triangles
According to the documentation, we should switch around vertices every
other triangle to prevent front-face culling from removing them.

This allows Tux in Tux Racer to render correctly.
2021-12-27 11:58:43 +01:00
Jelle Raaijmakers
b455e6ca0d LibGL: Stub glClear support for stencil buffer
Previously, if the client supplied `GL_STENCIL_BUFFER_BIT`, `glClear`
would return an error. Since it is a valid parameter, we now continue
and report that this parameter is unimplemented instead.
2021-12-27 11:58:43 +01:00
Jelle Raaijmakers
688adba1a8 LibGL: Uncrash glMaterialf on invalid input
We should handle this in the context.
2021-12-27 11:58:43 +01:00
Jelle Raaijmakers
9e9e1c7634 LibGL: Implement glColor3/4dv 2021-12-27 11:58:43 +01:00
Jelle Raaijmakers
3883b42764 LibGL: Stub GL_(UN)PACK_* context parameters
Libraries like GLU depend on their memory initialization by requesting
these parameters, so if we do not support them, segfaults will occur.
2021-12-27 11:58:43 +01:00
Jelle Raaijmakers
70c6907546 LibGL: Add glext.h and lots of new defines in gl.h
These constants are used by GLU and Tux Racer.
2021-12-27 11:58:43 +01:00
Jelle Raaijmakers
2ce73b31b6 LibGL: Extract platform types to glplatform.h 2021-12-27 11:58:43 +01:00
Linus Groh
5ec39ca363 LibJS: Add spec comments to Number.prototype functions 2021-12-26 21:02:00 +01:00
Luke Wilde
2d26a50d28 LibJS: Fix toFixed throwing on undefined, null and NaN fractionDigits
It was checking the original fractionDigits argument was a finite
number instead of the coerced fraction_digits.
2021-12-26 20:37:44 +01:00
Ali Mohammad Pur
1a35e27490 LibRegex: Make FailForks fail all forks up to the last save point
This makes negative lookarounds with more than one fork behave
correctly.
Fixes #11350.
2021-12-25 18:41:10 +01:00
Liav A
105d558922 Meta: Remove kernel modules remains
Apparently Andreas found remains for that in the build system.
Let's remove them for completeness of that process of removing support
for kernel modules, which didn't work for many months before being
removed.
2021-12-25 18:42:41 +02:00
Andreas Kling
7d7950b322 LibVT: Don't leave 50ms auto-scroll timer running at all times
This timer was causing wake-ups every 50ms in all terminals, just to
right back to sleep unless we were in the middle of an auto-scroll.
2021-12-25 14:20:13 +01:00
Andreas Kling
d0df249666 LibCore: Add Core::Timer::set_active(bool)
This calls either start() or stop() depending on the boolean argument.
2021-12-25 14:20:13 +01:00
Andreas Kling
ae07660587 LibC: Buffer randomness to avoid syscall in every arc4random_buf()
Keep a page-sized buffer of random bytes cached and work through it
before calling the kernel again.
2021-12-25 14:20:13 +01:00
Andreas Kling
e923cf6624 strace: Port to LibMain :^) 2021-12-25 11:12:03 +01:00
Andreas Kling
2bd1a62ce1 LibCore: Add syscall wrapper for ptrace() 2021-12-25 11:05:30 +01:00
Andreas Kling
e815bf5d1f PDFViewer: Add a basic set of pledges 2021-12-25 10:58:30 +01:00
Andreas Kling
50e090071c WindowServer: Skip over destroyed windows in WindowSwitcher::draw()
I encountered a WindowServer crash due to null-pointer dereference in
this function, so let's protect against it by simply skipping over
nulled-out WeakPtrs.

I added a FIXME about how we ideally wouldn't be in this situation in
the first place, but that will require some more investigation.
2021-12-25 10:41:06 +01:00
Daniel Bertalan
a2aae6a582 LibCrypto: Remove redundant __builtin_memset() call
This call caused GCC 12's static analyzer to think that we perform an
out-of-bounds write to the v_key Vector. This is obviously incorrect,
and comes from the fact that GCC doesn't properly track whether we use
the inline storage, or the Vector is allocated on the heap.

While searching for a workaround, Sam pointed out that this call is
redundant as `Vector::resize()` already zeroes out the elements, so we
can completely remove it.

Co-authored-by: Sam Atkins <atkinssj@serenityos.org>
2021-12-24 14:35:33 -08:00
Brian Gianforcaro
d6f1d11aa0 pro: Convert to serenity_main(..) 2021-12-24 14:29:52 -08:00
Brian Gianforcaro
74948950bb ini: Convert to serenity_main(..) 2021-12-24 14:29:52 -08:00
Brian Gianforcaro
831242f32a env: Convert to serenity_main(..) 2021-12-24 14:29:52 -08:00
Brian Gianforcaro
81c98502f3 pwd: Convert to serenity_main(..) 2021-12-24 14:29:52 -08:00
Brian Gianforcaro
a62669ebcf LibCore: Add Core::System::getcwd() wrapper 2021-12-24 14:29:52 -08:00
Nihal Jere
4574a58f6f Spider: Add animation when drawing cards 2021-12-24 05:49:52 -08:00
Brian Gianforcaro
49749e279a LibC: Implement _setjmp and _longjmp
These are aliases to `setjmp()` and `longjmp()` on our system,
as our implementations don't modify the signal mask.

This is required for the syzkaller executor process.
2021-12-24 05:26:21 -08:00
Sam Atkins
eefe471dce SystemMonitor: Remove unused SortingProxyModel include 2021-12-24 05:11:52 -08:00
Sam Atkins
f6633a1026 LibGUI+Userland: Make SortingProxyModel::create() return ErrorOr
Unfortunately, most of the users are inside constructors, (and two
others are inside callback lambdas) so the error can't propagate, but
that can be improved later.
2021-12-24 05:11:52 -08:00
Stephan Unverwerth
c72a996542 LibSoftGPU: Add method to copy texels between images
Adds a method `copy_texels()` to class `Image` that copies a rect of
texels from source image to destination.
2021-12-24 05:10:28 -08:00
Stephan Unverwerth
5e9d99474d LibGL: Remove image storage from MipMap
Images are stored on the device side. Texture2D and MipMap are now only
used to store imformation about the texture and reference to the device
image.
2021-12-24 05:10:28 -08:00
Stephan Unverwerth
4c944eaa41 LibGL: Remove sampling code from Sampler2D
Texture sampling now happens entirely in SoftGPU thus this class will
now only be used to hold the sampler configuration.
2021-12-24 05:10:28 -08:00
Stephan Unverwerth
39995548e4 LibGL+LibSoftGPU: Add method to query device info
This adds a method `info()` to SoftGPU that returns the name of the
hardware vendor and device name, as well as the number of texture untis.

LibGL uses the returned texture unit count to initialize its internal
texture unit array.
2021-12-24 05:10:28 -08:00
Stephan Unverwerth
1a758d7bf2 LibSoftGPU: Move enums into separate file 2021-12-24 05:10:28 -08:00
Stephan Unverwerth
f7c40b25ac LibSoftGPU: Remove GLenum used for selecting rendered primitive type
This removes the last reference to LibGL from LibSoftGPU. The GLenum
has been replaced by our own enum.
2021-12-24 05:10:28 -08:00
Stephan Unverwerth
de0069188f LibSoftGPU: Remove OpenGL type for polygon mode
Replaces the GLenum used to setup polygon mode in RasterizerOptions with
our own enum.
2021-12-24 05:10:28 -08:00
Stephan Unverwerth
f4d29bf665 LibSoftGPU: Remove OpenGL type for fog mode
Replaces the GLenum used to set up the fog mode in RasterizerOptions
with out own enum.
2021-12-24 05:10:28 -08:00
Stephan Unverwerth
74ed7713fa LibSoftGPU: Remove OpenGL type for depth test func
Replaces the GLenum used in the RasterizerConfig for selecting the depth
test function with out own enum.
2021-12-24 05:10:28 -08:00
Stephan Unverwerth
33e601800c LibSoftGPU: Remove OpenGL type for draw buffer selection
Replaces the GLenum used in RasterizerConfig to select the draw buffer
with a simple boolean that disabled color output when the draw buffer
is set to GL_NONE on the OpenGL side.
2021-12-24 05:10:28 -08:00
Stephan Unverwerth
1904be0370 LibSoftGPU: Remove OpenGL type for culled side selection
Replaces the GLenum in RasterizerConfig, that selects the triangle sides
to be culled, with two booleans.
2021-12-24 05:10:28 -08:00
Stephan Unverwerth
24c76741e8 LibSoftGPU: Remove OpenGL type for front face selection
Replaces the GLenum used for selecting the frontface in the rasterizer
config with out own enum.
2021-12-24 05:10:28 -08:00
Stephan Unverwerth
c720cd00db LibSoftGPU: Remove OpenGL type for alpha blend factors
Replaces the GLenum used for configuring alpha blend factors in the
SoftGPU device with out own enum.
2021-12-24 05:10:28 -08:00
Stephan Unverwerth
40bd73bdef LibSoftGPU: Remove OpenGL type for alpha test func
Replaces the OpenGL enum used for setting the alpha test func in
RasterizerOptions with out own enum.
2021-12-24 05:10:28 -08:00
Stephan Unverwerth
7d49015403 LibSoftGPU: Remove simple OpenGL types from RasterizerConfig
Replace GLfloat and GLboolean types in RasterizerConfig with their c++
native equivalent.
2021-12-24 05:10:28 -08:00