Commit graph

26496 commits

Author SHA1 Message Date
Nico Weber 5f9c42c404 LibGfx: Give Bitmap a scale factor
Gfx::Bitmap can now store its scale factor. Normally it's 1, but
in high dpi mode it can be 2.

If a Bitmap with a scale factor of 2 is blitted to a Painter with
scale factor of 2, the pixels can be copied over without any resampling.
(When blitting a Bitmap with a scale factor of 1 to a Painter with scale
factor of 2, the Bitmap is painted at twice its width and height at
paint time. Blitting a Bitmap with a scale factor of 2 to a Painter with
scale factor 1 is not supported.)

A Bitmap with scale factor of 2 reports the same width() and height() as
one with scale factor 1. That's important because many places in the
codebase use a bitmap's width() and height() to layout Widgets, and all
widget coordinates are in logical coordinates as well, per
Documentation/HighDPI.md.

Bitmap grows physical_width() / physical_height() to access the actual
pixel size. Update a few callers that work with pixels to call this
instead.

Make Painter's constructor take its scale factor from the target bitmap
that's passed in, and update its various blit() methods to handle
blitting a 2x bitmap to a 2x painter. This allows removing some gnarly
code in Compositor. (In return, put some new gnarly code in
LibGfxScaleDemo to preserve behavior there.)

No intended behavior change.
2021-01-20 10:28:27 +01:00
Linus Groh c46056122a LibM: Add nextafter() and nexttoward() stubs
Only thing missing for Python to build the _math module! :^)
2021-01-18 22:28:56 +01:00
Linus Groh 8db54f9ef4 LibC: Return ENOSYS from clock_getres() rather than asserting
This is only a stub function for now, but we can make it even more
useful by just hardcoding an error return value rather than asserting.
2021-01-18 22:28:56 +01:00
Linus Groh 22b56d6a82 LibC: Make tzset() set daylight to 0
Quoting POSIX:

    https://pubs.opengroup.org/onlinepubs/009695399/functions/tzset.html

    The tzset() function also shall set the external variable daylight
    to 0 if Daylight Savings Time conversions should never be applied
    for the timezone in use; otherwise, non-zero.

We're already pretending to be in UTC+0 and setting timezone to 0
accordingly, we can also fake the absence of Daylight Savings Time.
2021-01-18 22:28:56 +01:00
Linus Groh 0d58e75910 LibC: Make tzset() set tzname to { "UTC", "UTC" }
Since tzset() itself pretends to succeed (it just sets timezone = 0 for
now), it seems unwise to leave tzname uninitialized. Since Serenity
already assumes UTC pretty much everywhere time is used, let's continue
that trend here. Quoting POSIX:

    https://pubs.opengroup.org/onlinepubs/009695399/functions/tzset.html

    The tzset() function shall use the value of the environment variable
    TZ to set time conversion information used by ctime(), localtime(),
    mktime(), and strftime(). If TZ is absent from the environment,
    implementation-defined default timezone information shall be used.

So we still don't care about TZ at all, but the program doesn't need to
know! :^)

This matches what musl libc ("UTC") and glibc ("GMT") do, see:

- https://sourceware.org/git/?p=glibc.git;a=blob;f=time/tzset.c
- https://git.musl-libc.org/cgit/musl/tree/src/time/__tz.c
2021-01-18 22:28:56 +01:00
Linus Groh 3c68f557a9 LibC: Add wcstol() and wcstoll() stubs 2021-01-18 22:28:56 +01:00
Linus Groh ec42f864d4 LibC: Add wcsncmp()
Taken from strncmp(), like wcscmp() in ef40ebb. :^)
2021-01-18 22:28:56 +01:00
Linus Groh 2cc3d68615 Kernel+LibC: Add _SC_TTY_NAME_MAX 2021-01-18 22:28:56 +01:00
Linus Groh b432fd0bc0 LibC: Add TTY_NAME_MAX (32) 2021-01-18 22:28:56 +01:00
Andreas Kling 93831ef456 LibWeb: Very basic support for CSS flex-direction
The FFC now supports both vertical and horizontal flex layout, based on
the flex-direction property. It's still extremely naive, but at least
now you can be naive in two directions! :^)

This implementation of flexbox is going to take a lot of work, but at
least now we've gotten started.
2021-01-18 20:20:24 +01:00
Andreas Kling 3e8873b63e LibWeb: Add Layout::Box::margin_box_height() 2021-01-18 20:20:20 +01:00
Andreas Kling 149f10b0b9 LibWeb: Parse the CSS "flex-direction" property 2021-01-18 20:20:16 +01:00
Andreas Kling fd7920fa8f LibWeb: Add a very naive Layout::FlexFormattingContext :^)
This is very dumb and only lays out its child boxes on a horizontal
line with their shrink-to-fit widths.

You have to start somewhere! :^)
2021-01-18 20:20:13 +01:00
Andreas Kling d18bc9ccd2 LibWeb: Add Layout::Box::margin_box_width() 2021-01-18 20:20:07 +01:00
Andreas Kling 140463e833 LibWeb: Parse "display: flex" and create BlockBox layout nodes for them
I'm not 100% sure that BlockBox is the right layout node for flex
containers, but it's the most obviously fitting one we already have.
2021-01-18 20:20:00 +01:00
Linus Groh 6715ca3e16 LibELF: Remove unused m_global_symbol_lookup_func from DynamicObject
This was refactored in 3e815ad, leaving this unused member behind.
2021-01-18 19:17:52 +01:00
Andreas Kling 9e45594dc8 LibWeb: Stub out the PerformanceTiming object from Navigation Timing
Just have all the timing functions return 0 for now.

We can now run the Shynet JS on https://linus.dev/ although the XHR
is rejected by our same-origin policy.
2021-01-18 15:11:20 +01:00
Andreas Kling c99e35485a LibWeb: Add support for XMLHttpRequest request headers
Implement XMLHttpRequest.setRequestHeader() and include the headers in
the outgoing HTTP request.
2021-01-18 14:02:58 +01:00
Andreas Kling 0639e77898 LibWeb: Make the Window object "inherit" from EventTarget :^)
Since Web::Bindings::WindowObject inherits from JS::GlobalObject, it
cannot also inherit from Web::Bindings::EventTargetWrapper.

However, that's not actually necessary. Instead, we simply set the
Window object's prototype to the EventTargetPrototype, and add a little
extra branch in the impl_from() function that turns the JS "this" value
into a DOM::EventTarget*.

With this, you can now call window.addEventListener()! Very cool :^)

Fixes #4758.
2021-01-18 12:18:29 +01:00
Andreas Kling fd83918476 LibWeb: Move IDL attributes and functions to the prototype
Instead of each IDL interface wrapper having its own set of all the
attributes and functions, they are moved to the prototype. This matches
what we already do in LibJS.

Also, this should be spec compliant with the web as well, though there
may be *some* content out there that expects some things to be directly
on the wrapper since that's how things used to work in major browsers
a long time ago. But let's just not worry about that for now.

More work towards #4789
2021-01-18 12:18:29 +01:00
Andreas Kling 630cbc947a LibWeb: Construct the IDL interface prototype chains automatically
Have each IDL prototype trigger the construction of its own prototype.
2021-01-18 12:18:29 +01:00
Andreas Kling ee7fa49b88 LibWeb: Actually instantiate all the web constructors/prototypes
We now instantiate all the generated web API constructors and expose
them on the window object. We also set the generated prototypes on
instantiated wrappers.

Also, we should obviously find a way to generate this code. :^)
2021-01-18 12:18:29 +01:00
Andreas Kling 252a98042d LibWeb: Generate constructor and prototype classes for IDL interfaces
This patch adds a FooPrototype and FooConstructor class for each IDL
interface we generate JS bindings for.

These classes are very primitive and don't do everything they should
yet, but we have to start somewhere. :^)

Work towards #4789
2021-01-18 12:18:29 +01:00
Andreas Kling 81839ea1bd LibJS: Add JS::NativeFunction to the forwarding header 2021-01-18 12:18:29 +01:00
Andreas Kling 0db6835e73 LibWeb: Move HTML::SubmitEvent functions out of line 2021-01-18 12:18:29 +01:00
Tom 1d621ab172 Kernel: Some futex improvements
This adds support for FUTEX_WAKE_OP, FUTEX_WAIT_BITSET, FUTEX_WAKE_BITSET,
FUTEX_REQUEUE, and FUTEX_CMP_REQUEUE, as well well as global and private
futex and absolute/relative timeouts against the appropriate clock. This
also changes the implementation so that kernel resources are only used when
a thread is blocked on a futex.

Global futexes are implemented as offsets in VMObjects, so that different
processes can share a futex against the same VMObject despite potentially
being mapped at different virtual addresses.
2021-01-17 20:30:31 +01:00
Nico Weber 1382bbfc57 LibGfx: Make Painter take the scale factor as constructor argument
I want to give Bitmap an intrinsic scale factor and this is a step
in that direction.

No behavior change.
2021-01-17 16:10:21 +01:00
Andreas Kling 7a0bc2fdb8 LibGfx: Convert all the dbg() in BMPLoader to dbgln()
Also get rid of the awkward IF_BMP_DEBUG macro while we're here.
2021-01-17 15:42:10 +01:00
Andreas Kling fd441b954d LibWeb: Add fast_is<T>() for some DOM and layout node subclasses
The generic is<T>() uses dynamic_cast which is fine in the majority
of cases, but when one of them shows up in profiles, we can make it
faster by answering the is-a question manually.
2021-01-17 14:42:50 +01:00
Andreas Kling 4da913bfab LibJS: Replace ASTNode::class_name() with RTTI
This is only used for debugging anyway, so performance doesn't matter
too much.
2021-01-17 14:36:53 +01:00
Andreas Kling bf0719092f Kernel+Userland: Remove shared buffers (shbufs)
All users of this mechanism have been switched to anonymous files and
passing file descriptors with sendfd()/recvfd().

Shbufs got us where we are today, but it's time we say good-bye to them
and welcome a much more idiomatic replacement. :^)
2021-01-17 09:07:32 +01:00
Andreas Kling 2cd16778b5 AudioServer+LibAudio: Pass audio buffers as Core::AnonymousBuffer
This was the last remaining user of shbufs! :^)
2021-01-17 09:07:32 +01:00
Linus Groh b42f0b9650 LibC: Change a couple of ASSERT_NOT_REACHED() to TODO()
Just for semantic correctness and better visibility of those
unimplemented stub functions.
2021-01-17 08:43:46 +01:00
Linus Groh 95988b44a0 LibGfx: Let PNGLoader handle failed chunk decoding gracefully
decode_png_chunks() is not handling "critical" chunks, unlike
decode_png_size() for example. When we encounter a chunk decoding
failure, e.g. because not enough bytes were left to read, just continue
with decoding the bitmap - which will fail on its own, if we're missing
some required chunk(s).

Fixes #4984.
2021-01-17 08:09:20 +01:00
Andreas Kling 05dbfe9ab6 Kernel: Remove sys$shbuf_seal() and userland wrappers
There are no remaining users of this syscall so let it go. :^)
2021-01-17 00:18:01 +01:00
Andreas Kling 5522e8f59d Clipboard+LibGUI: Move clipboard service to anonymous files 2021-01-17 00:14:37 +01:00
Andreas Kling 1cb44ec5ee Everywhere: Remove more <AK/SharedBuffer.h> includes 2021-01-17 00:04:42 +01:00
Andreas Kling fe96418a70 LibGfx: Remove remaining SharedBuffer support in Gfx::Bitmap 2021-01-17 00:03:33 +01:00
Andreas Kling 447e6da52c ImageDecoder: Use Core::AnonymousBuffer and Gfx::ShareableBitmap
...instead of sending shbufs back and forth. :^)
2021-01-16 23:58:57 +01:00
Andreas Kling 8a61aba1e5 LibGfx+LibGUI: Make Gfx::ShareableBitmap transmit indexed palettes 2021-01-16 23:58:47 +01:00
Andreas Kling b5d98c0945 LibWeb+WebContent: Use anonymous files for OOPWV backing stores
To support this, the GUI process and the WebContent service will now
coordinate their backing store bitmaps. Each backing store can be
referred to by a serial ID, and we don't need to keep resending it
as a file descriptor.

We should probably do something similar in WindowServer. :^)
2021-01-16 23:21:52 +01:00
Andreas Kling 04b2aeef33 LibGfx: Make Gfx::Bitmap::create_shareable() use an anonymous file
Note that this is only used by OOPWV in LibWeb at the moment.
2021-01-16 23:21:52 +01:00
Andreas Kling c16e36be48 LibVT: Convert dbgprintf() => dbgln() and remove some debug code 2021-01-16 23:21:52 +01:00
Andreas Kling b818cf898e Kernel+Userland: Remove sys$shbuf_allow_all() and userland wrappers
Nobody is using globally shared shbufs anymore, so let's remove them.
2021-01-16 22:43:03 +01:00
Ben Wiederhake ea5825f2c9 Kernel+LibC: Make sys$getcwd truncate the result silently
This gives us the superpower of knowing the ideal buffer length if it fails.
See also https://github.com/SerenityOS/serenity/discussions/4357
2021-01-16 22:40:53 +01:00
Ben Wiederhake 5dc29065e1 LibC: Avoid silent truncation after overlong realpath
The realpath syscall can attempt to return arbitrarily long paths, in particular
paths that are longer than PATH_MAX. The only way to detect this case is
checking whether 'rc', the true length of the returned path including NUL byte,
exceeds our buffer length. In such a case, the buffer contains invalid data.

All Serenity code calls LibC's realpath() with a nullptr buffer, meaning that
realpath is supposed to allocate memory on its own. All Serenity code can handle
arbitrarily long paths returned by LibC's realpath, so it is safe to "do the
dance" and repeat the syscall with a new buffer.

Ports are likely to be graceful in this regard, too. If a Port calls realpath()
with a pre-allocated buffer, however, there is nothing better we can do than
return a truncated buffer.
2021-01-16 22:40:53 +01:00
Ben Wiederhake 6f607742dd LibCore: Fix invalid errno
Noone seems to check 'errno' when using LibCore, but let's make sure it's correct anyway.
2021-01-16 22:40:53 +01:00
Ben Wiederhake 72ac97ef6a LibC: Fix memory leak in getcwd 2021-01-16 22:40:53 +01:00
Ben Wiederhake ed857bc06e LibC: Fix memory leak in realpath 2021-01-16 22:40:53 +01:00
Brendan Coles 66b0012bfd LibELF: validate_program_headers: Validate PT_INTERP header p_filesz > 1 2021-01-16 22:39:26 +01:00
Tom 20f53c7462 LibGUI: Don't bubble window events up to parent windows
Always accept the events so that they don't bubble up to the
parent object.

Fixes #4967
2021-01-16 19:35:02 +01:00
Andreas Kling 04f95f9160 WindowServer+LibGUI: Pass the system theme using Core::AnonymousBuffer
This was the last remaining user of shbufs in WindowServer, and so
WindowServer no longer pledges "shared_buffer" :^)
2021-01-16 17:20:53 +01:00
Andreas Kling 9c6c18d9b6 LibCore+LibIPC: Add Core::AnonymousBuffer, an IPC-friendly buffer class
This will be used to migrate remaining clients off of shbufs.
2021-01-16 17:20:24 +01:00
Andreas Kling 01c2480eb3 Kernel+LibC+WindowServer: Remove unused thread/process boost mechanism
The priority boosting mechanism has been broken for a very long time.
Let's remove it from the codebase and we can bring it back the day
someone feels like implementing it in a working way. :^)
2021-01-16 14:52:04 +01:00
Andreas Kling 43109f9614 Kernel: Remove unused syscall sys$minherit()
This is no longer used. We can bring it back the day we need it.
2021-01-16 14:52:04 +01:00
asynts adbb8d62d1 Everywhere: Replace a bundle of dbg with dbgln.
These changes are arbitrarily divided into multiple commits to make it
easier to find potentially introduced bugs with git bisect.
2021-01-16 11:54:35 +01:00
asynts 6b7602d33b Everywhere: Replace a bundle of dbg with dbgln.
These changes are arbitrarily divided into multiple commits to make it
easier to find potentially introduced bugs with git bisect.
2021-01-16 11:54:35 +01:00
asynts 01879d27c2 Everywhere: Replace a bundle of dbg with dbgln.
These changes are arbitrarily divided into multiple commits to make it
easier to find potentially introduced bugs with git bisect.
2021-01-16 11:54:35 +01:00
Andreas Kling e8512b8cd7 LibC: Bump FD_SETSIZE to 1024
64 was cutting it pretty close, especially now as we start using file
descriptor passing more and more.

This (1024) matches many other systems, and if we need more there's
always sys$poll().
2021-01-16 11:26:53 +01:00
Andreas Kling 58b435f49e LibGfx: Short-circuit ShareableBitmap construction in IPC decoder
When decoding a ShareableBitmap that came over IPC, it's safe to assume
that it's backed by an anonymous file (since we just decoded it.)
2021-01-16 11:26:53 +01:00
Andreas Kling f18d89b36d LibGfx: Make sure Bitmap::create_with_anon_fd() always closes if needed
If this is called with ShouldCloseAnonymousFile::Yes, it's entrusted
with closing the anon_fd and nobody else will take care of it.
2021-01-16 11:26:53 +01:00
Andreas Kling 1a157d3f50 LibGfx: Don't expose anon_fd inside Gfx::ShareableBitmap
Nobody outside needs to see this, so let's just hide it.
2021-01-16 11:26:53 +01:00
Andreas Kling 4277be356a WindowServer+LibGUI: Send menu item icons as Gfx::ShareableBitmap 2021-01-16 11:26:53 +01:00
Andreas Kling 7c1df68be3 LibGfx: Don't encode invalid Gfx::ShareableBitmap as IPC::File
IPC::File should only be used when there's an actual file to pass.
Invalid ShareableBitmaps don't have a backing file, so fix this by
first encoding a "valid" flag.
2021-01-16 11:26:53 +01:00
Andreas Kling 64610ca80e Everywhere: Remove a bunch of <AK/SharedBuffer.h> includes 2021-01-16 11:26:53 +01:00
Andreas Kling ab0dad5ea2 WindowServer+LibGUI: Pass drag&drop bitmaps via Gfx::ShareableBitmap
This makes them backed by anonymous files instead of shbufs and also
simplifies the code significantly on both client and server side.
2021-01-16 11:26:53 +01:00
Nick Vella fcf50af53d WindowServer, LibGUI: RefreshSystemTheme implementation
Adds a mechanism through which windowing clients can re-request an
UpdateSystemTheme message. This is currently used in SystemMenu's
ShutdownDialog to refresh it's theme when the dialog is instantiated.
2021-01-16 09:09:04 +01:00
Andreas Kling 6536a9c79a LibGfx: Fix fuzzer build (put anon_create() behind __serenity__) 2021-01-16 09:02:17 +01:00
Linus Groh 0187fd4fdd LibCoreDump: Expose arguments and environment
We can pull those from the coredump's ProcessInfo JSON, do some basic
sanity checks and expose them as ready-to-use Vector<String>s.
2021-01-15 23:26:47 +01:00
Linus Groh 7668e968af LibCoreDump+Crash{Daemon,Reporter}: Make backtraces thread-specific
We want to show an individual backtrace for each thread, not one
containing backtrace entries from all threads.

Fixes #4778.
2021-01-15 23:26:47 +01:00
Linus Groh 568cde5e23 Kernel+LibELF+LibCoreDump+CrashReporter: Use JSON for ProcessInfo
This is in preparation of adding (much) more process information to
coredumps. As we can only have one null-terminated char[] of arbitrary
length in each struct it's now a single JSON blob, which is a great fit:
easily extensible in the future and allows for key/value pairs and even
nested objects, which will be used e.g. for the process environment, for
example.
2021-01-15 23:26:47 +01:00
Andreas Kling 4839f36f5e LibGUI: Fix OpacitySlider hairline disappearing towards the left
Whoops, we were scaling the alpha channel of the hairline color along
with the RGB channels.
2021-01-15 23:24:07 +01:00
Andreas Kling 71f50b6e94 LibGUI: Window icons no longer need to be backed by shbufs
This allows us to remove Window::create_shared_bitmap() entirely.
2021-01-15 23:24:07 +01:00
Andreas Kling 333366a99d WindowServer+Taskbar: Send WM icon updates as Gfx::ShareableBitmap
Window icons in Taskbar were previously received in WM events with
shbuf ID's. Now that Gfx::ShareableBitmap is backed by anonymous files,
we can easily switch to using those.
2021-01-15 23:24:07 +01:00
Andreas Kling 633915e792 LibGfx: Make Gfx::ShareableBitmap use anonymous files instead of shbufs 2021-01-15 23:24:07 +01:00
Nico Weber 56cad36ef2 LibGfx: Make Painter::draw_rect() scale-aware
Needed for the window server minimize animation.

draw_rect() can't just call draw_line() because that isn't
draw_op()-aware. The draw_op()-awareness in Painter looks a bit ad-hoc,
but that's for another day.
2021-01-15 19:13:29 +01:00
Andreas Kling 0b0514d46b LibGUI+WindowServer: Use anonymous files for window backing stores :^)
This patch replaces the use of shbufs for GUI::Window backing stores
with the new anonymous files mechanism.

Backing bitmaps are now built on memory allocated with anon_create().
They are passed across the IPC socket as IPC::File. This means that
WindowServer now pledges "recvfd" and graphical clients need to pledge
"sendfd" to work.

To support the cached bitmap swapping optimization on the WindowServer
side, each backing store is assigned an incrementing serial number on
the client side. (This allows us to re-use an already mapped file.)
2021-01-15 13:57:00 +01:00
Andreas Kling 4d97b955e6 LibGfx: Allow creating a Gfx::Bitmap backed by an anonymous file
Gfx::Bitmap::create_with_anon_fd() creates such a Bitmap, and also
optionally takes ownership of the file, making sure to close() it
on destruction.
2021-01-15 13:56:54 +01:00
Andreas Kling fb4993f067 Kernel: Add anonymous files, created with sys$anon_create()
This patch adds a new AnonymousFile class which is a File backed by
an AnonymousVMObject that can only be mmap'ed and nothing else, really.

I'm hoping that this can become a replacement for shbufs. :^)
2021-01-15 13:56:47 +01:00
Andreas Kling 96f8fcdcba LibGUI: Add a WindowBackingStore class
Instead of storing the back/front buffers of a GUI::Window as just
Gfx::Bitmap, wrap them in a WindowBackingStore class.

This will allow us to add more information alongside the bitmaps while
keeping the back/front swapping logic simple.
2021-01-15 10:54:19 +01:00
Andreas Kling b8c3ea8b30 LibGUI: Hold on to notification icon until NotificationServer responds
This broke when switching IPC messages to support move-only types.
This pattern is not ideal, but the real fix for this will be using fd
passing instead of shbufs.

Fixes #4955.
2021-01-15 08:22:54 +01:00
Andreas Kling f1f7bf567b LibIPC: Add an expressive way to close an IPC::File after sending it
If you don't need a file descriptor after sending it to someone over
IPC, construct it with IPC::File(fd, IPC::File::CloseAfterSending)
and LibIPC will take care of it for you. :^)
2021-01-14 09:50:14 +01:00
Andreas Kling 7f2d8e8884 LibIPC: Close received IPC::File fd's by default unless taken
When receiving a file descriptor over IPC, the receiver must now call
take_fd() on the IPC::File to take over the descriptor. Otherwise,
IPC::File will close the file on destruction.
2021-01-14 09:50:14 +01:00
Linus Groh f253f68768 LibJS: Rename ErrorType::ProxyGetOwnDescriptor{Undef => Undefined}Return
This seems like an unnecessary and uncommon abbreviation.
2021-01-14 08:13:32 +01:00
Linus Groh cab3049dcc LibJS: Rename ErrorType::ToObjectNullOr{Undef => Undefined}
This seems like an unnecessary and uncommon abbreviation.
2021-01-14 08:13:32 +01:00
Andrew Kaster f67f8fdbf2 LibCore: Include fcntl.h in more places that we use fcntl for Lagom
Looks like it's more than just TcpServer where we do this :)
2021-01-13 15:02:11 +01:00
Andrew Kaster a65ccfee3a LibCore: Include fcntl before using it for non-linux lagom builds
SOCK_NONBLOCK is a linux-ism that serenity and linux support. For lagom
builds, we use ioctl/fcntl to get a non-blocking socket the old
fashioned way. Some file re-org unhid the fcntl.h dependency of TcpServer,
so add the header explicitly.
2021-01-13 09:52:32 +01:00
AnotherTest 72be904259 LibLine: Use StringView::find() to find '::' in history entries
Fixes an issue mentioned in #4926.
2021-01-12 23:36:20 +01:00
Andreas Kling 1a08ac72ad LibC+Everywhere: Remove open_with_path_length() in favor of open()
This API was a mostly gratuitous deviation from POSIX that gave up some
portability in exchange for avoiding the occasional strlen().

I don't think that was actually achieving anything valuable, so let's
just chill out and have the same open() API as everyone else. :^)
2021-01-12 23:34:01 +01:00
Nico Weber d551263b11 LibGfx: Make it possible to apply an (integer) scale to a Painter
This adds a scale factor to Painter, which will be used for HighDPI
support. It's also a step towards general affine transforms on Painters.

All of Painter's public API takes logical coordinates, while some
internals deal with physical coordinates now. If scale == 1, logical
and physical coordinates are the same. For scale == 2, a 200x100 bitmap
would be covered by a logical {0, 0, 100, 50} rect, while its physical
size would be {0, 0, 200, 100}.

Most of Painter's functions just assert that scale() == 1 is for now,
but most functions called by WindowServer are updated to handle
arbitrary (integer) scale.

Also add a new Demo "LibGfxScaleDemo" that covers the converted
functions and that can be used to iteratively add scaling support
to more functions.

To make Painter's interface deal with logical coordinates only,
make translation() and clip_rect() non-public.
2021-01-12 23:32:54 +01:00
Linus Groh 545b4879e4 LibGfx: Make Painter::draw_pixel() with thickness = 1 work with RGBA
The underlying fill_rect() works correctly, but the special case for
thickness = 1 was not blending the new color with the target pixel's
color, causing RGBA colors to be painted as their RGB counterpart.
2021-01-12 21:41:14 +01:00
AnotherTest b2b3ccb12d LibCore: Don't create an RPC server when built for lagom
There's no reason to have this, and it will most likely fail anyway
(since there's likely no /tmp/rpc).
2021-01-12 16:21:34 +01:00
Andreas Kling f2a6ee76c0 LibPthread: Add pthread_equal() 2021-01-12 13:42:45 +01:00
Andreas Kling bee1145bdf LibPthread: Stub pthread_setcancelstate() and pthread_setcanceltype() 2021-01-12 13:40:48 +01:00
Andreas Kling 51a2d3c1fa Libraries: Remove LibUnwind
This was not used for anything.
2021-01-12 13:32:34 +01:00
Andreas Kling 13d7c09125 Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00