summaryrefslogtreecommitdiff
path: root/SharedGraphics
AgeCommit message (Collapse)Author
2019-07-12Painter: Don't add line spacing after the very last line in draw_text().Andreas Kling
This means that single-line draw_text() calls don't get any additional line spacing added. Which makes things look right.
2019-07-12Painter: Implement multi-line support in Painter::draw_text().Andreas Kling
This patch makes it possible to draw_text() things like "ABC\nDEF\nGHI". It works by breaking the string into lines, then computing a bounding rect for all the lines, and finally aligning each line appropriately within the bounding rect and drawing them one by one. Fixes #297.
2019-07-08Kernel: Have the open() syscall take an explicit path length parameter.Andreas Kling
Instead of computing the path length inside the syscall handler, let the caller do that work. This allows us to implement to new variants of open() and creat(), called open_with_path_length() and creat_with_path_length(). These are suitable for use with e.g StringView.
2019-07-08StringView: Rename characters() to characters_without_null_termination().Andreas Kling
This should make you think twice before trying to use the const char* from a StringView as if it's a null-terminated string.
2019-07-04SharedGraphics: Add LogStream operator<<'s for Rect, Point and Size.Andreas Kling
2019-07-03AK: Rename the common integer typedefs to make it obvious what they are.Andreas Kling
These types can be picked up by including <AK/Types.h>: * u8, u16, u32, u64 (unsigned) * i8, i16, i32, i64 (signed)
2019-06-30Meta: Removed all gitignore in the source tree only keeping the root oneVAN BOSSUYT Nicolas
2019-06-30GUI: Use Win2K-like "warm gray" color instead of the older colder gray.Andreas Kling
Someone suggested this a long time ago and I never got around to it. So here we go, here's the warm gray! I have to admit I like it better. :^)
2019-06-25GraphicsBitmap: Add bpp(), returns the number of bits per pixel.Andreas Kling
2019-06-23PaintBrush: Implement a thickness setting for the pen tool.Andreas Kling
Painter gains the ability to draw lines with arbitrary thickness. It's basically implemented by drawing filled rects for thickness>1. In PaintBrush, Tool classes can now override on_contextmenu() to provide a context menu for the toolbox button. :^)
2019-06-22LibGUI: Fix compiler warnings.Andreas Kling
2019-06-21AK: Rename Retainable.h => RefCounted.h.Andreas Kling
2019-06-21AK: Rename RetainPtr.h => RefPtr.h, Retained.h => NonnullRefPtr.h.Andreas Kling
2019-06-21AK: Rename RetainPtr => RefPtr and Retained => NonnullRefPtr.Andreas Kling
2019-06-21AK: Rename Retainable => RefCounted.Andreas Kling
(And various related renames that go along with it.)
2019-06-16Color: Add setters for the red, green and blue components.Andreas Kling
2019-06-15GraphicsBitmap: Provide templated versions of get_pixel() and set_pixel().Andreas Kling
If we already know the bitmap format used, we can use these functions to bypass the format checks and go straight to pixel manipulation.
2019-06-14GraphicsBitmap: Add set_pixel(x, y, Color)Andreas Kling
This only works for RGB32 and RGBA32 formats.
2019-06-14Color: Add equality operators.Andreas Kling
2019-06-11Color: Add inverted().Andreas Kling
Patch contributed by "pd"
2019-06-10GraphicsBitmap: Add a fill(Color) helper.Andreas Kling
This only works for RGB32 and RGBA32 bitmaps at the moment, since it's not obvious what should happen in an Indexed8 bitmap.
2019-06-07Meta: Tweak .clang-format to not wrap braces after enums.Andreas Kling
2019-06-07SharedGraphics: Run clang-format on everything.Andreas Kling
2019-06-06WindowServer: New API for Scaled BlitChristopher Dumas
2019-06-06WindowServer: Implement scaled backgrounds and scaled blitting functionChristopher Dumas
2019-06-06WindowServer: Clang-FormatChristopher Dumas
2019-06-03Painter: Reduce the number of draw_text overloads to only involve StringViewRobin Burchell
No more char + int sequences, as that's literally what StringView is for.
2019-06-03StringViewize a bunch of things -- mostly LibGUIRobin Burchell
2019-06-01PNGLoader: Annotate the decompression buffer mmap with a name.Andreas Kling
2019-05-27removed extra impl of scalingChristopher Dumas
2019-05-27centered backgrounds are now an optionChristopher Dumas
2019-05-27tiled backgrounds no longer has strange off-by-one pixel errorsChristopher Dumas
2019-05-27can now tile background and made sure the IRC choose server popup still worksChristopher Dumas
2019-05-27SharedGraphics: Make Rect::shatter() return a Vector<Rect, 4>.Andreas Kling
We know that shatter() will never return more than four rects, so we can use vector inline capacity to always avoid heap allocation here.
2019-05-26WSCompositor: Allow a compose to bypass the timer when it first happensRobin Burchell
d66fa60fcf23fa7217a065479af6b1f5a851a506 introduced the use of a timer to coalesce screen updates. This is OK, but it does introduce update latency. To help mitigate the impact of this, we now have a second (immediate) timer. When a compose pass is first triggered, the immediate timer will allow the compose to happen on the next spin of the event loop (so, only coalescing updates across a single event loop pass). Any updates that trigger while the delayed timer is running, though, will be delayed to that (~60fps) timer. This fixes #103.
2019-05-25WindowServer: Tweak window titlebar look somewhat.Andreas Kling
Add a subtle shadow to the titlebar text. Also make the titlebar one pixel taller to fully accomodate the 90s "3D frame" effect. :^)
2019-05-25GButton: Align the button text according to text_alignment().Andreas Kling
Added a Rect::align_within(other_rect, alignment) helper that seemed useful.
2019-05-25StylePainter: Remove some unused code.Andreas Kling
2019-05-19LibC: Add mmap_with_name() that names the allocation immediately.Andreas Kling
This allows us to skip the separate call to set_mmap_name() in code that we control, e.g malloc() and GraphicsBitmap.
2019-05-17Build: Install most headers to Root (and libcore.a/libgui.a)Robin Burchell
This makes out-of-tree linking possible. And at the same time, add a CMakeToolchain.txt file that can be used to build arbitrary cmake-using applications on Serenity by pointing to the CMAKE_TOOLCHAIN_FILE when running cmake: -DCMAKE_TOOLCHAIN_FILE=~/code/serenity/Toolchain/CMakeToolchain.txt
2019-05-11Painter: Always optimize with -O3.Andreas Kling
Use a GCC #pragma to always optimize the Painter code with -O3. This code is performance critical and hotter than anything else in the system, and this helps quite a bit. The 2x, 3x and 4x upscaling fast paths benefit greatly from this.
2019-05-11Painter: Simplify the draw_scaled_bitmap() fast path for integer scale.Andreas Kling
Iterate over the source image instead of the destination image, and blow it up pixel by pixel. This code will only run for upscaling so we don't need to worry about anything else.
2019-05-11Painter: Fix typo in 4x scaling fast path.Andreas Kling
2019-05-11Painter: Add a fast path for draw_scaled_bitmap() with integer scale.Andreas Kling
When both the x and y scale factors are integers, we can avoid a whole bunch of the pixel lookups in the source image. This makes 2x scaling a 320x200 bitmap another ~25% faster. :^)
2019-05-11Painter: Templatize the inner loop of draw_scaled_bitmap().Andreas Kling
Use templates to specialize draw_scaled_bitmap() so we don't have to blend() for source without alpha, and also inline the GraphicsBitmap::get_pixel() logic so we don't have to branch on the bitmap format on every iteration. This is another ~30% speedup on top of the previous changes. :^)
2019-05-11StylePainter: Remove some unused variables.Andreas Kling
2019-05-11Painter: Improve draw_scaled_bitmap() performance.Andreas Kling
- Removed extra bounds checking. - Converted it to use integer math for the scale factors. - Using blend() for everything. Patch contributed by "pd"
2019-05-11WindowServer: Improve window frames by giving them a raised frame look. :^)Andreas Kling
2019-05-08GraphicsBitmap: size_in_bytes() was overshooting by 4x, oops!Andreas Kling
2019-05-07Painter: Support diagonal lines with dy>dx, and apply clipping as well.Andreas Kling