summaryrefslogtreecommitdiff
path: root/Libraries/LibGfx
AgeCommit message (Collapse)Author
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. :^)
2020-08-09LibGfx: Add a basic abstract WindowTheme classAndreas Kling
This class will provide painting and metrics for window themes. :^)
2020-08-07LibGfx: Add dummy Font::x_height() getterAndreas Kling
Right now we just guess that the x-height is glyph_height/2, which is obviously not accurate. We currently don't store the x-height in fonts, so that's something we'll need to fix.
2020-08-06Refactor: Expose const_cast by removing ByteBuffer::warp(const void*, size_t)asynts
This function did a const_cast internally which made the call side look "safe". This method is removed completely and call sites are replaced with ByteBuffer::wrap(const_cast<void*>(data), size) which makes the behaviour obvious.
2020-08-05Unicode: Try s/codepoint/code_point/g againNico Weber
This time, without trailing 's'. Ran: git grep -l 'codepoint' | xargs sed -ie 's/codepoint/code_point/g
2020-08-05Revert "Unicode: s/codepoint/code_point/g"Nico Weber
This reverts commit ea9ac3155d1774f13ac4e9a96605c0e85a8f299e. It replaced "codepoint" with "code_points", not "code_point".
2020-08-05LibGfx: Make draw_scaled_bitmap() apply relative opacityAndreas Kling
Instead of overriding the alpha value of all source pixels, apply the override opacity by multiplying with the source alpha. Fixes #3004.
2020-08-04Revert "LibM: Always include <math.h> instead of <LibM/math.h>"Andreas Kling
This reverts commit dc12cbca41b8b667ae7ced1066647d47186d1557. Sadly this broke the build due to some confusion about <new>. Reverting until this can be solved fully.
2020-08-04LibM: Always include <math.h> instead of <LibM/math.h>Andreas Kling
This makes Lagom pick up the host math.h, which is what we want.
2020-08-03Unicode: s/codepoint/code_point/gAndreas Kling
Unicode calls them "code points" so let's follow their style.
2020-08-01Themes: Fix default theme window stripes and shadow after #2811Nico Weber
Change #2811 made window title stripes and window title shadow themable, but it used the same stripe and shadow color for all window modes. This is fine for the new 'basalt' theme which uses the same color in all four window modes, but it changed the default theme so that background windows had brown stripes and a brown shadow. Instead, make the title stripe and title shadow themable per window mode, and change the default theme to restore the colors it had before change #2811: The title stripe color is the same as Border1 for all window modes, and the title shadow is the same as the title stripe darkened by 0.6.
2020-08-01LibGfx: Add Paths to themesthankyouverycool
Paths allows themes to specify directories/files where custom resources are located.
2020-07-27LibGfx: Fix dumb typo in PNG decoderAndreas Kling
'=' is not the same as '*', indeed.
2020-07-27LibGfx: Simplify some excessive use of pow() in scanline unfilteringAndreas Kling
2020-07-27LibGfx: Templatize Point, Size, and RectMatthew Olsson
2020-07-26LibWeb: Abstract common operations of graphical SVG elementsMatthew Olsson
2020-07-26LibGfx: Add FloatPoint methodsMatthew Olsson
Adds some conversion constructors, as well as the missing arithmetic operations.
2020-07-26LibGfx: Add elliptical curves to PathMatthew Olsson
2020-07-26LibWeb: Begin SVG element supportMatthew Olsson
This commit starts adding a basic SVG element. Currently, svg elements have support for the width and height properties, as well as the stroke, stroke-width, and fill properties. The only child element supported is the path element, as most other graphical elements are just shorthand for paths.
2020-07-25LibGfx: Add a generic Matrix variantAnotherTest
2020-07-25LibGfx: Add Matrix4x4::elements() gettersAnotherTest
2020-07-23Lagom: Add LibGemini, LibGfxNico Weber
They are dependencies of LibWeb and might be useful for running test-web on GitHub actions one day.
2020-07-23LibGfx: Add an "opacity" argument to Painter::draw_scaled_bitmap()Andreas Kling
This API is not super perfect as it merely overrides the source alpha on all source pixels instead of blending the alpha values. There is room for improvement here for sure.
2020-07-17WindowServer: New title bar vars for themesNullspeak
The theming system can now control title bar height, title button size, title stripe color and the title text shadow color. The implemented theme metrics system could be later extended to LibGUI to allow themes to change widget padding, border width, etc.
2020-07-16LibGfx: Set correct frame type on JPEG imagesstelar7
2020-07-15LibGfx: Minor IntRect::shatter and FloatRect::shatter optimizationTom
All the shards always intersect unless they're empty. So rather than checking for intersection, just check whether they're empty or not.
2020-06-28LibGfx+JPGLoader: Print failure message for progressive JPEGsdevashish
2020-06-27LibGfx+JPGLoader: Fix decoding outside of LibWebdevashish
The DC reset interval was initialized to garbage :)
2020-06-27LibGfx: Add PGM image file type supportHüseyin ASLITÜRK
2020-06-26LibGfx: Teach AffineTransform how to rotate and multiplyAndreas Kling
2020-06-23JPGLoader: Move JPGLoader internal structs and #defines to JPGLoader.cppdevashish
2020-06-23LibGfx: Integrate JPEG decoder with rest of the systemdevashish
This patch adds functions like `load_jpeg` to JPGLoader to make the JPEG decoder conform to the API that bitmap loader uses :^)
2020-06-23LibGfx+LibWeb: Add JPEG decoder and integrate with LibWebDevashish
This patch adds support for JPEG decoding. The JPEG decoder is capable of handling standard 2x1 horizontal, 2x1 vertical and quartered chroma subsampling. The implemented Inverse DCT performs with a decent speed. As of interchange formats, since we tend to ignore the metadata in APPn markers, the decoder can handle any format compatible with JFIF, which includes EXIFs and sometimes WebMs too. The decoder does not support progressive JPEGs yet.
2020-06-22ImageDecoder: Add a new service for out-of-process image decoding :^)Andreas Kling
The new ImageDecoder service (available for members of "image" via /tmp/portal/image) allows you to decode images in a separate process. This will allow programs to confidently load untrusted images, since the bulk of the security concerns are sandboxed to a separate process. The only API right now is a synchronous IPC DecodeImage() call that takes a shbuf with encoded image data and returns a shared buffer and metadata for the decoded image. It also comes with a very simple library for interfacing with the ImageDecoder service: LibImageDecoderClient. The name is a bit of a mouthful but I guess we can rename it later if we think of something nicer to call it. There's obviously a bit of overhead to spawning a separate process for every image decode, so this is mostly only appropriate for untrusted images (e.g stuff downloaded from the web) and not necessary for trusted local images (e.g stuff in /res)
2020-06-22LibGfx: Add PPM image file type supportHüseyin ASLITÜRK
2020-06-21LibGfx: Prefer the largest image in the file when loading an ICOPaul Roukema
Since the current image handling APIs don't provide a way to handle a file which can contain multiple images, we just pick the largest one. This gives the best chance of a good looking result.
2020-06-21 LibGfx: Add support for uncompressed/classic ICO filesPaul Roukema
This add support to the ICO file decoder for loading uncompressed bitmap icon files. It is limited to 32-bit color icons, no 4/8/16 bit or paletted formats yet. This is in addition to the PNG compressed ICO format support added previously. With this we can now load the favicons for github, google and twitter.
2020-06-21LibGfx: Initial support for ICO image files.Paul Roukema
This adds support for loading the first image from ICO format images only if they are PNG encoded. This is useful for loading favicons, which are sometimes PNGs with an ICO extension and sometimes actual ICO files. In particular we can now load the favicon from new.ycombinator.com
2020-06-21LibGfx: Add PBM image file type supportHüseyin ASLITÜRK
2020-06-21LibGfx: Add BMP loaderMatthew Olsson
Adds an *almost fully featured BMP loader to process .bmp files. Features: - All header formats are supported - Full RLE4/8/24 support - Color scaling (e.g. distributing a 5-bit color throughout the 8-bit color spectrum, so 5-bit white is still 0xffffff) - Full BITMASK/ALPHABITMASK support *Not included: - 1D Huffman compression. Good luck actually finding a bmp in the wild that uses this - Use of any field in the V4/V5 header. Color spaces? Endpoints? No thanks :) This loader was tested with the images at https://entropymine.com/jason/bmpsuite/bmpsuite/html/bmpsuite.html. This loader correctly displays 81 out of the 90 total images (for reference, firefox displays 64 correctly). Note that not rendering the images at the bottom is counted as displaying correctly.
2020-06-18LibGfx: Fix color alfa for transparent color in GIFLoaderHüseyin ASLITÜRK
2020-06-15LibGfx: Add a new Bitmap::is_path_a_supported_image_format() methodHüseyin ASLITÜRK
Move the image file detection code to the File class to prevent code duplication.
2020-06-13LibGfx: Painter::draw_line() can just return early if alpha == 0Andreas Kling
2020-06-13LibGfx: Add Color::Transparent as a named colorAndreas Kling
2020-06-13LibGfx: Implement support for decoding interlaced PNGsPaul Roukema
This adds support for decoding the Adam7 interlacing used in some PNGs. Notably this includes many of the images (such as the eyes) used in the acid2 test :^) Note that the HTML engine still doesn't understand the <object> tag well enough to show the eyes on the test.
2020-06-13LibGfx: Fix PNG decoder handling of 16-bit RGB imagesPaul Roukema