summaryrefslogtreecommitdiff
path: root/Libraries/LibGfx
AgeCommit message (Collapse)Author
2020-09-12LibGUI: Use new Bitmap::minimum_pitch methodBen Wiederhake
Also, make sure that the painter actually draws on a RGB(A) bitmap. Closes #3460.
2020-09-12LibGfx: Validate size of incoming shared bitmapBen Wiederhake
Errors like this became more likely due to the 'optimized' memory usage. Also, this prevents the WindowServer from being killed by a goofy program sharing an incomplete bitmap, and likely some other scenarios.
2020-09-12LibGfx: Saner memory usage of indexed bitmapsBen Wiederhake
Indexed bitmaps used to allocate four times the required amount of memory. Also, we should acknowledge that the underlying data is not always RGBA32, and instead cast it only when the true type is known.
2020-09-12LibGfx: Remove redundant bits() methodBen Wiederhake
In all circumstances, this returned exactly the same thing as scanline_u8(), so let's just remove the silly detour. This does not add any new dependency on Bitmap-internals, because that already existed.
2020-09-12LibGfx: Don't blindly trust file-internal offsetBen Wiederhake
This also touches the return type of dib_size(), because kjdsfg
2020-09-12LibGfx: Nicer error reporting for bitmap allocationBen Wiederhake
2020-09-12LibGfx: Protect against over-large bitmapsBen Wiederhake
2020-09-11LibGUI+LibGfx: Move check box painting to Gfx::StylePainterAndreas Kling
This will allow us to render check boxes from other places. :^)
2020-09-10LibGfx: Move StandardCursor enum to LibGfxAndreas Kling
This enum existed both in LibGUI and WindowServer which was silly and error-prone.
2020-09-10JPGLoader: Check existence of Huffman tables in scan header segment (#3442)Devashish Jaiswal
DC and AC table IDs read in the scan header segment weren't validated against the IDs of Huffman tables read in the DHT segment. This caused an OOB read when a Huffman table was accessed using the ID read in the scan header segment. Furthermore, the decoder now replaces the old DC or AC table if a redefinition has been found prior to the scan header. Fixes #3439.
2020-09-08LibGfx: Add ability to draw inverted rectanglesTom
2020-09-01LibGfx: Make fill_rect_with_dither_pattern() skip transparent colorsAndreas Kling
Maybe this should do full blending, but for now at least skip source pixels that have zero alpha.
2020-08-31LibGfx: implement GIF RestorePrevious frame disposal modePeter Nelson
2020-08-31LibGfx: clear previous GIF frame to transparent instead of whole imagePeter Nelson
2020-08-30LibGfx: Fix Lagom build (possible uninitialized variable warnings)Andreas Kling
2020-08-30LibGfx: use Gfx::Color instead of local struct for GIF colour mapPeter Nelson
2020-08-30LibGfx: only cache last decoded GIF framePeter Nelson
GIFLoader now uses a single frame buffer to cache the last decoded frame. This drastically reduces memory usage at the small expense of re-decoding frames on each loop.
2020-08-30LibGfx: add support for interlaced GIFsPeter Nelson
2020-08-30LibGfx: correctly handle GIF frame disposal modesPeter Nelson
RestoreBackground disposal mode is now a transparent fill to allow background to show through. RestorePrevious disposal mode now restores the previous frame.
2020-08-30Libraries: Unbreak building with extra debug macrosBen Wiederhake
2020-08-27Base: Create /res/icons/serenity for misc. sized system iconsthankyouverycool
2020-08-27Meta: Force semi-colon after MAKE_AK_NONXXXABLE()Ben Wiederhake
Before, we had about these occurrence counts: COPY: 13 without, 33 with MOVE: 12 without, 28 with Clearly, 'with' was the preferred way. However, this introduced double-semicolons all over the place, and caused some warnings to trigger. This patch *forces* the usage of a semi-colon when calling the macro, by removing the semi-colon within the macro. (And thus also gets rid of the double-semicolon.)
2020-08-26WindowServer+LibGfx: Move title bar button layout to WindowThemethankyouverycool
2020-08-26LibGfx: Use valid hsv values in painter debugLepkoQQ
2020-08-26LibGfx: Always use 0..360 0..1 0..1 in HSV colorsLepkoQQ
2020-08-25AK: Add Endian.h header to replace NetworkOrdered.h.asynts
2020-08-23LibGUI+LibGfx: Implement upside-down appearance for bottom-side tabsAndreas Kling
GUI::TabWidget has long has a TabPosition::Bottom option, but we still rendered the tab buttons the same as TabPosition::Top. This patch implements a custom look for bottom-side tabs. I've done my best to match the look of the top-side ones, but there might be some improvements we can make here. :^)
2020-08-23LibGfx+WindowServer: Simplify notification window frame themingAndreas Kling
Don't require theme clients to provide the frame rect, the theme can compute that internally based on the window rect.
2020-08-23LibGfx: Add TextAlignment::BottomRightPeter Elliott
2020-08-21LibGfx: Use an enumerator macro for color rolesAndreas Kling
2020-08-21LibGfx+WindowServer: Simplify WindowTheme::paint_normal_frame() APIAndreas Kling
Don't require passing in the outer frame rect since the theme can compute that itself, based on the window rect.
2020-08-20LibGfx: Support loading GIF local color maps if present :^)Andreas Kling
2020-08-20LibGfx: Initialize some uninitialized things in GIFLoaderAndreas Kling
2020-08-19LibGfx: Small improvement for DisjointRectSet::shatterTom
This avoids a call to clone() which would be discarded immediately. Also, avoid essentially cloning for each hammer rectangle unless there is actually a need for it.
2020-08-18LibGfx: Add convenience helpers for RectTom
2020-08-18LibGfx: Add convenience method Point::constrainedTom
2020-08-18LibGfx: Add a few convenience methods to DisjointRectSetTom
2020-08-17LibGfx: Move original StylePainter code to ClassicStylePainterSarah
StylePainter should continue to work the same as before.
2020-08-17LibGfx: Add abstract StylePainter classSarah
StylePainter's behavior is now handled by a static instance of BaseStylePainter. The original static behavior of StylePainter is left as-is for API compatibility.
2020-08-16LibGfx: Add initial font family matchingthankyouverycool
Fonts following the TypefaceWeightSize naming scheme now associate with bold weights of the same name and glyph size on construction.
2020-08-16AK: Rename KB, MB, GB to KiB, MiB, GiBNico Weber
The SI prefixes "k", "M", "G" mean "10^3", "10^6", "10^9". The IEC prefixes "Ki", "Mi", "Gi" mean "2^10", "2^20", "2^30". Let's use the correct name, at least in code. Only changes the name of the constants, no other behavior change.
2020-08-13LibGfx: use disposal method of previous frame in GIF transparencyPeter Nelson
The disposal method on a GIF animation frame now correctly applies to rendering of the next frame.
2020-08-13LibGfx: correctly handle transparency between GIF framesPeter Nelson
This fixes an issue where transparent pixels in GIF animation frames have their alpha values incorrectly set to zero, allowing the background behind the GIF to show through, instead of the previous animation frame. Additionally, transparent pixels are now correctly identified based on their index matching the image transparency index, instead of their color values.
2020-08-12LibGfx: Mark compilation-unit-only functions as staticBen Wiederhake
This enables a nice warning in case a function becomes dead code.
2020-08-12Meta: Replace remaining LibM/math.h includes with math.hLinus Groh
2020-08-10LibGfx: Correct copyright years for {Classic,}WindowTheme.{cpp,h}Andreas Kling
2020-08-10WindowServer+LibGfx: Move window frame rect calculation to WindowThemeAndreas Kling
2020-08-10ClassicWindowTheme: Fix titlebar redraw issuesSarah
This fixes titlebar rects being overly large and leaving smeary undrawn areas when using a theme with a titlebar height different to 19px.
2020-08-09WindowServer+LibGfx: Move notification window frame painting to LibGfxAndreas Kling
ClassicWindowTheme can now also paint notification window frames.
2020-08-09WindowServer+LibGfx: Move normal window frame painting to a WindowThemeAndreas Kling
This patch introduces the ClassicWindowTheme, which is our default theme implemented as a Gfx::WindowTheme subclass. In this initial cut, we move normal window frame painting and title bar metrics helpers out of WindowServer and into LibGfx. This will eventually allow us much greater flexibility with theming windows, and also makes it easier to build applications that want to render a window with a specific style for some reason. :^)