Using int was a mistake. This patch changes String, StringImpl,
StringView and StringBuilder to use size_t instead of int for lengths.
Obviously a lot of code needs to change as a result of this.
This function returns the bitmap itself if it's already backed by a
SharedBuffer object, otherwise it creates a shareable copy of itself
and returns that.
Callers of draw_pixel() are not expecting it to apply translation since
they will have already done that themselves.
This was causing draw_line() with thickness>1 to have an offset applied
in case the painter was already translated.
Painter::draw_line() now has an optional "bool dotted" parameter that
causes it to only render every other pixel.
Note that this only works with horizontal and vertical lines at the
moment and we'll assert if called with dotted=true for a diagonal line.
Here comes the first part of a GIF decoder. It decodes up to the point
of gathering all the LZW-compressed data. The next step is to implement
decompression, and then turn the decompressed data into a bitmap using
the color maps, etc.
Ports/.port_include.sh, Toolchain/BuildIt.sh, Toolchain/UseIt.sh
have been left largely untouched due to use of Bash-exclusive
functions and variables such as $BASH_SOURCE, pushd and popd.
Get rid of the dedicated Emoji class to make it easier to store a null
value signifying a failed lookup.
This allows us to remember failed lookups, making subsequent failures
for the same codepoint much faster. :^)
Also change the API to take a destination rect instead of a source rect
since internally it was basically creating a destination rect from the
source rect anyway. It was a little confusing.
An ImageLoader is a generic interface for loading encoded image data of
any supported format. It has an ImageLoaderPlugin internally that does
all the work.
This patch adds an initial PNGImageLoaderPlugin that knows how to
retrieve the size of a PNG, and the bitmap. The API is divided into
size() and bitmap() to facilitate geometry-only decoding.
This will be useful in places like LibHTML where we need dimensions for
layout purposes but can wait with the bitmap until later.
This patch adds the 17 color names from CSS2.1, as well as support for
the "#rgb" shorthand where each component is a hex digit that gets
multiplied by 17.
- Implemented support for more PNG formats including 16-bit per channel
and 8-bit indexed with palette.
- Made the library a little more resistant to crashes by returning
false for known but unsupported formats.
Sometimes you want to move the Rect by its right or bottom edge without
resizing the rect in the process. There are probably better names for
this but nothing comes to mind at the moment.
This was a workaround to be able to build on case-insensitive file
systems where it might get confused about <string.h> vs <String.h>.
Let's just not support building that way, so String.h can have an
objectively nicer name. :^)
From here on, all strings displayed to the user are expected to
be encoded as UTF-8. The next few commits will deal with a few
existing places where this requirement is currently violated.
https://github.com/SerenityOS/serenity/issues/490
This class can locate and load emojis, which are expected to be stored
as regular PNG images at /res/emoji/U+XXXX.png, where XXXX is the
character codepoint.
https://github.com/SerenityOS/serenity/issues/490
We shouldn't assume that the pitch of some arbitrary bitmap memory that
we're wrapping is going to be 16-byte aligned. Instead, just take the
pitch as a parameter.
Also update WindowServer to pass the pitch to the framebuffer bitmaps.
It was a tad too bright. Also make sure we're using the same color in
all the different places. At some point it would be nice to improve global
color settings, etc.
We were installing libraries into /Libraries/Root, rather than in /Root.
This made the ports system behave rather unpredictable, since I had old
versions of things in /Root and new versions of things in /Libraries/Root.
These are useful when doing widgets that can be switched between vertical
and horizontal mode, such as GSlider. The idea is that instead of using
"x" and "y" directly, you use the "primary" and "secondary" offset/size
for the Orientation you're configured in.