Commit Graph

18 Commits

Author SHA1 Message Date
Andreas Kling
e46deec846 LibGfx: Inline some AffineTransform functions
Asking if an AffineTransform is identity or translate-only can be done
inline and avoid the cost of a function call in tight loops.
2024-03-02 13:00:09 +01:00
MacDue
9ecc78db1b LibGfx: Add AffineTransform::determinant() 2023-07-14 06:51:05 +02:00
Andreas Kling
a77accf3f4 LibGfx: Add AffineTransform::rotation()
Extracts the rotation from a 2D matrix.
2023-04-27 07:24:53 +02:00
MacDue
b8d1fae31f LibGfx: Add AffineTransform::skew_radians() 2023-04-12 07:40:22 +02:00
MacDue
27fae78335 Meta+Userland: Pass Gfx::IntSize by value
Just two ints like Gfx::IntPoint.
2022-12-07 11:48:27 +01:00
MacDue
e011eafd37 Meta+Userland: Pass Gfx::FloatPoint by value
Just a small 8-byte value like Gfx::IntPoint.
2022-12-07 11:48:27 +01:00
MacDue
7be0b27dd3 Meta+Userland: Pass Gfx::IntPoint by value
This is just two ints or 8 bytes or the size of the reference on
x86_64 or AArch64.
2022-12-07 11:48:27 +01:00
Sam Atkins
e5a25171fe LibGfx: Mark AffineTransform<T>::map() as only working for numeric T
The implementations for these methods is manually defined in the .cpp
file for `int` and `float`, meaning that other `T` values would fail -
but only once we got to the linking stage. This patch makes the error
happen much earlier, so it's more obvious.
2022-10-22 18:17:58 +02:00
sin-ack
3f3f45580a Everywhere: Add sv suffix to strings relying on StringView(char const*)
Each of these strings would previously rely on StringView's char const*
constructor overload, which would call __builtin_strlen on the string.
Since we now have operator ""sv, we can replace these with much simpler
versions. This opens the door to being able to remove
StringView(char const*).

No functional changes.
2022-07-12 23:11:35 +02:00
Andreas Kling
b4c3882d9c LibGfx: Add AffineTransform::is_identity_or_translation()
This will allow us to implement fast paths in cases where a simple
translation can be handled faster than a full affine transform.
2022-04-10 21:35:55 +02:00
Andreas Kling
2af8bb14d7 LibGfx: Add AffineTransform::map_to_quad(Rect)
Unlike map(Rect) which returns a Rect, mapping a Rect to a Quad allows
us to represent the actual result of mapping all four corners of the
Rect through the matrix.
2022-04-07 17:06:02 +02:00
Idan Horowitz
086969277e Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
Simon Wanner
9c97bd0de4 LibGfx: Add AffineTransform::inverse 2022-03-18 18:51:42 +01:00
Andreas Kling
216e21a1fa AK: Convert AK::Format formatting helpers to returning ErrorOr<void>
This isn't a complete conversion to ErrorOr<void>, but a good chunk.
The end goal here is to propagate buffer allocation failures to the
caller, and allow the use of TRY() with formatting functions.
2021-11-17 00:21:13 +01:00
Matthew Olsson
ac238b3bd6 LibGfx: Add some helper methods to AffineTransform
Also makes some basic getters ALWAYS_INLINE and [[nodiscard]], as well
as fixing as error with the map method.
2021-05-02 22:48:06 +02:00
Brian Gianforcaro
1682f0b760 Everything: Move to SPDX license identifiers in all files.
SPDX License Identifiers are a more compact / standardized
way of representing file license information.

See: https://spdx.dev/resources/use/#identifiers

This was done with the `ambr` search and replace tool.

 ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-04-22 11:22:27 +02:00
Andreas Kling
ef1e5db1d0 Everywhere: Remove klog(), dbg() and purge all LogStream usage :^)
Good-bye LogStream. Long live AK::Format!
2021-03-12 17:29:37 +01:00
Andreas Kling
13d7c09125 Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00