Age | Commit message (Collapse) | Author |
|
|
|
The custom TTF path rasterizer is actually generic enough for it to be
used for other fonts. To make this more clear, it now lives on its own
in the "Font" directory.
|
|
This patch optimizes the drawing of aa-lines by rotating the drawn
rectangle to the direction where the line points. That enables us to
draw non-straight lines with the proper width.
If a aa-line is drawn that is infact a straigt line we now dont plot
those lines with multipe rectangles across the line - insted we draw
straight lines in one go with just one rectangle of proper size.
Stroking of lines has been enhanced to take care of the edges between
two lines with drawing the stroke till the intersections of two
connected lines.
|
|
In order to avoid the base encode/decode methods from being used (and
failing a static assertion), we must be sure to declare/define the
custom type implementations as template specializations.
After this, LibIPC is no longer sensitive to include order.
|
|
This table seems to only exist for OpenType compatibility. There are
some font files, including most embedded fonts in PDF documents, that
don't include one.
For those cases, we now just zero-initialize one to the largest
supported size.
|
|
|
|
C++20 can automatically synthesize `operator!=` from `operator==`, so
there is no point in writing such functions by hand if all they do is
call through to `operator==`.
This fixes a compile error with compilers that implement P2468 (Clang
16 currently). This paper restores the C++17 behavior that if both
`T::operator==(U)` and `T::operator!=(U)` exist, `U == T` won't be
rewritten in reverse to call `T::operator==(U)`. Removing `!=` operators
makes the rewriting possible again.
See https://reviews.llvm.org/D134529#3853062
|
|
This PR adds resize ability to PixelPaint as per issue 11862.
The previous behaviour was to always rescale the canvas when
resizing an image. This adds a checkbox to toggle between
rescaling, and resizing which blits the existing canvas to
the top left of the new, resized canvas.
As part of this, a new ScalingMode is added to
LibGfx - None.
|
|
Otherwise, we end up propagating those dependencies into targets that
link against that library, which creates unnecessary link-time
dependencies.
Also included are changes to readd now missing dependencies to tools
that actually need them.
|
|
For convenience, `DisjointIntRectSet` is an alias for
`DisjointRectSet<int>`, and is used everywhere for now.
|
|
This is in preparation for converting it to a template. No changes here,
only moving code around.
|
|
This looks like a copy-paste issue from Rect::to_string().
|
|
Line, Point, Rect, and Size now all have Formatters that will work with
any type that itself has a Formatter.
|
|
This allows the copy constructor of Matrix to be called constexpr,
which should allow more values to be compile-time calculated.
Likewise, VectorN.data() is now constexpr so that it can be compile-time
evaluated.
|
|
|
|
Since this is used by LibWeb when parsing CSS colors we should not use
strtod here.
|
|
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.
|
|
Putting the implementations in the .cpp file meant that they only
existed for `IntRect` and `FloatRect`, since those were instantiated at
the bottom of the file. Now they work for other types. :^)
A couple of places in WindowServer had to be modified to disambiguate
between the two `Rect::intersected()` overloads.
Co-authored-by: davidot <davidot@serenityos.org>
|
|
This change implements a flood fill algorithm for the Bitmap class. This
will be leveraged by various Tools in PixelPaint. Moving the code into
Bitmap reduces the duplication of the algorithm throughout the
PixelPaint Tools (currently Bucket Tool and Wand Select).
The flood fill function requires you to pass in a threshold value (0 -
100) as well as a lambda for what to do when a pixel gets reached. The
lambda is provided an IntPoint representing the coordinates of the pixel
that was just reached.
The genericized lambda approach allows for a variety of things to be
done as the flood algorithm progresses. For example, the Bucket Tool
will paint each pixel that gets reached with the fill_color. The Wand
Select tool wont actually alter the bitmap itself, instead it uses the
reached pixels to alter a selection mask.
|
|
|
|
Now that we have OS macros for essentially every supported OS, let's try
to use them everywhere.
|
|
This is a very simpler filter that tints an image with a color.
|
|
|
|
This implements the saturate operation as defined in the SVG filter
specification.
(https://drafts.fxtf.org/filter-effects-1/#feColorMatrixElement)
|
|
This moves the apply a matrix operation to each [r,g,b] vector in an
image to a general class.
|
|
Currently the default is false, but this is not the best strategy
for most filters producing artifacts on the borders, and wrap-around
option ends up being better, producing less artifacts.
|
|
Doesn't use them in libc headers so that those don't have to pull in
AK/Platform.h.
AK_COMPILER_GCC is set _only_ for gcc, not for clang too. (__GNUC__ is
defined in clang builds as well.) Using AK_COMPILER_GCC simplifies
things some.
AK_COMPILER_CLANG isn't as much of a win, other than that it's
consistent with AK_COMPILER_GCC.
|
|
This bug has long been fixed.
|
|
This implements a simple and fairly efficient hue rotation filter.
It is based off the SVG feColorMatrix "hueRotate" matrix operation.
https://drafts.fxtf.org/filter-effects-1/#elementdef-fecolormatrix
|
|
|
|
|
|
|
|
|
|
This fixes an issue where, when looping over the components of a
composite glyph, we used to mutate the affine transformation of the
glyph itself when computing the transformations of its components.
(AffineTransform::multiply() is non-const).
|
|
Even though this code is obnoxiously slow, it still belongs in LibGfx
and should not be hidden away in LibWeb's CanvasRenderingContext2D.
|
|
This remained undetected for a long time as HeaderCheck is disabled by
default. This commit makes the following file compile again:
// file: compile_me.cpp
#include <LibDNS/Question.h>
// That's it, this was enough to cause a compilation error.
Likewise for most other files touched by this commit.
|
|
|
|
|
|
Span<u32 const> is the type used when converting a constant Vector<u32>
to a Span.
|
|
This fixes a bug in ladybird where it was crashing while rendering
characters like ščćž in the Noto Sans Regular font.
That font renders those characters as a composite where the caret
has numberOfContours = -1. When using the rasterize_impl simple path
for that, it would negatively overflow the offsets.
|
|
This will be needed so we can apply filter effects to the backdrop
of an element in LibWeb.
This now also allows getting a crop of a bitmap in a different format
than the source bitmap. This is for if the painter's bitmap does not
have an alpha channel, but you want to ensure the cropped bitmap does.
|
|
These filters are based off the ones defined in:
https://drafts.fxtf.org/filter-effects-1/#supported-filter-functions
|
|
This amount can be handled in the filter's implementation or if
not it will default to mixing between the new and previous pixel.
This behaviour is used for implementing CSS filters that allow stuff
like grayscale(70%).
|
|
This will be needed for mixing filters in LibGfx (and may be
generally useful elsewhere).
|
|
Instead of just keeping them in an unsorted Vector, which led to
increasingly noticeable O(n) lookups, we now cache a list of Typefaces
per family name.
|
|
In some artificial full screen blitting profiling, I've seen `memcpy`
take up about 4% fewer samples each time I measure. It seems like
`fast_u32_copy` is not as fast as it'd like to believe.
|
|
Spelling fixes found by `codespell`.
|
|
This allows us to get a `float` length from an `IntVector3` without
needing to convert to `FloatVector3` first.
|
|
Also make the font discovery algorithm search subdirectories as well.
This will be used by Ladybird to discover more fonts on non-Serenity
systems. :^)
|
|
Our bilinear scaling logic worked well for upscaling, but during
downscaling the bitmap was often shifted one pixel to the bottom right.
This is a common problem, described here in more detail:
https://bartwronski.com/2021/02/15/bilinear-down-upsampling-pixel-grids-and-that-half-pixel-offset/
Fix it by calculating coordinate shift values that align the pixel's
boundaries between the source and target pixels before selecting the
source pixels to interpolate.
|