summaryrefslogtreecommitdiff
path: root/Libraries/LibDraw
AgeCommit message (Collapse)Author
2019-11-03POSIX compliance: (most) shell scripts converted to generic shellGeorge Pickering
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.
2019-10-20LibDraw: Add FloatPoint, FloatSize and FloatRectAndreas Kling
These are floating point varians of Point, Size and Rect.
2019-10-19LibDraw: Rename ImageLoader => ImageDecoderAndreas Kling
ImageLoader was not the right name for this, as there is no loading happening, only decoding. :^)
2019-10-19LibDraw: Store emojis in a HashMap<u32, RefPtr<GraphicsBitmap>>Andreas Kling
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. :^)
2019-10-19LibDraw: Have the PNGImageLoaderPlugin remember if it failed to decodeAndreas Kling
Instead of trying again when asked repeatedly, just remember if it didn't work out the first time.
2019-10-19LibDraw: Rename Painter::blit_tiled() => draw_tiled_bitmap()Andreas Kling
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.
2019-10-16LibDraw: Teach PNGLoader to only decode enough of learn the image sizeAndreas Kling
2019-10-15LibDraw: Add ImageLoader, a simple abstraction for image loadingAndreas Kling
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.
2019-10-06LibDraw: Parse some more color string formats found on the webAndreas Kling
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.
2019-09-30ByteBuffer: Remove pointer() in favor of data()Andreas Kling
We had two ways to get the data inside a ByteBuffer. That was silly.
2019-09-29LibDraw: Some build fixes for strange platformsAndreas Kling
Patch from Anonymous.
2019-09-29LibDraw: Implemented support for more PNG formats (#614)Brandon Scott
- 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.
2019-09-27Point: Add operator+=, operator-=, and Point+PointAndreas Kling
2019-09-16Rect: Add set_right_without_resize() and set_bottom_without_resize()Andreas Kling
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.
2019-09-16PNGLoader: Add load_png_from_memory methodConrad Pankoff
2019-09-14GraphicsBitmap: Allow constructing a wrapper bitmap around 8-bit pixelsAndreas Kling
This will be very useful for optimizing games like DOOM. :^)
2019-09-07LibDraw: Make sure we install libdraw.a so ports can link with -ldrawAndreas Kling
2019-09-06LibDraw: Add TextAlignment::TopRightAndreas Kling
Also tidy up the alignment code to use switch statements.
2019-09-06AK: Rename <AK/AKString.h> to <AK/String.h>Andreas Kling
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. :^)
2019-09-05LibDraw: Add emoji drawing support to PainterSergey Bugaev
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
2019-09-05LibDraw: Add emoji support to the Font classSergey Bugaev
https://github.com/SerenityOS/serenity/issues/490
2019-09-05LibDraw: Introduce an Emoji classSergey Bugaev
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
2019-09-01Rect: Add contains_vertically(y) and contains_horizontally(x)Andreas Kling
2019-08-25LibDraw: Fix wrong installation pathAndreas Kling
2019-08-19GraphicsBitmap: create_wrapper() should take pitch as a parameterAndreas Kling
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.
2019-08-14StylePainter: Move progress bar painting from GProgressBar to hereAndreas Kling
We need to be able to paint progress bars without having a widget. :^)
2019-08-09Painter: Fix off-by-one in bounding rects for right-aligned textAndreas Kling
Another instance of "Rect::right() is the last pixel *inside* the rect, not the first pixel outside the rect" messing me up.
2019-08-04LibDraw: Add Font::default_bold_fixed_width_font()Andreas Kling
We need a way to get a bold version of the default fixed-width font.
2019-08-03LibDraw: Add Color::from_string(StringView)Andreas Kling
This parses hex colors in either #RRGGBBAA or #RRGGBB format. No other formats are supported at the moment.
2019-08-01Painter: Scaling RGBA32 bitmaps treated the source as alpha-less RGB32Andreas Kling
Found by PVS-Studio.
2019-07-27LibDraw: Tweak the hover highlight color.Andreas Kling
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.
2019-07-23LibDraw: Add LogStream operator<< overload for Color.Andreas Kling
2019-07-21Libraries: Fix wrong paths to "Root" in the various install.sh scripts.Andreas Kling
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.
2019-07-21Libraries: Remove unused "install" targets.Andreas Kling
We've been using a per-directory "install.sh" for some time, so let's get rid of the old way of doing things.
2019-07-20LibDraw: Add orientation-based size helpers to Size as well.Andreas Kling
Now you can ask for e.g Size::primary_size_for_orientation(Orientation).
2019-07-20LibDraw: Add orientation-based offset/size manipulation helpers.Andreas Kling
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.
2019-07-20LibDraw: Move the Orientation enum to its own LibDraw header file.Andreas Kling
2019-07-18StylePainter: Tweak surface highlight color to match the system warm gray.Andreas Kling
2019-07-18LibDraw: Introduce (formerly known as SharedGraphics.)Andreas Kling
Instead of LibGUI and WindowServer building their own copies of the drawing and graphics code, let's it in a separate LibDraw library. This avoids building the code twice, and will encourage better separation of concerns. :^)