summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGfx/ShareableBitmap.cpp
AgeCommit message (Collapse)Author
2021-07-21LibGfx: Use "try_" prefix for static factory functionsAndreas Kling
Also mark them as [[nodiscard]].
2021-05-24LibGfx: Use anonymous buffer instead of raw anon_fd for Gfx::BitmapJean-Baptiste Boric
Instead of using a low-level, proprietary API inside LibGfx, let's use Core::AnonymousBuffer which already abstracts anon_fd and offers a higher-level API too.
2021-04-22Everything: Move to SPDX license identifiers in all files.Brian Gianforcaro
SPDX License Identifiers are a more compact / standardized way of representing file license information. See: https://spdx.dev/resources/use/#identifiers This was done with the `ambr` search and replace tool. ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-01-20LibGfx: Give Bitmap a scale factorNico Weber
Gfx::Bitmap can now store its scale factor. Normally it's 1, but in high dpi mode it can be 2. If a Bitmap with a scale factor of 2 is blitted to a Painter with scale factor of 2, the pixels can be copied over without any resampling. (When blitting a Bitmap with a scale factor of 1 to a Painter with scale factor of 2, the Bitmap is painted at twice its width and height at paint time. Blitting a Bitmap with a scale factor of 2 to a Painter with scale factor 1 is not supported.) A Bitmap with scale factor of 2 reports the same width() and height() as one with scale factor 1. That's important because many places in the codebase use a bitmap's width() and height() to layout Widgets, and all widget coordinates are in logical coordinates as well, per Documentation/HighDPI.md. Bitmap grows physical_width() / physical_height() to access the actual pixel size. Update a few callers that work with pixels to call this instead. Make Painter's constructor take its scale factor from the target bitmap that's passed in, and update its various blit() methods to handle blitting a 2x bitmap to a 2x painter. This allows removing some gnarly code in Compositor. (In return, put some new gnarly code in LibGfxScaleDemo to preserve behavior there.) No intended behavior change.
2021-01-16LibGfx+LibGUI: Make Gfx::ShareableBitmap transmit indexed palettesAndreas Kling
2021-01-16LibGfx: Short-circuit ShareableBitmap construction in IPC decoderAndreas Kling
When decoding a ShareableBitmap that came over IPC, it's safe to assume that it's backed by an anonymous file (since we just decoded it.)
2021-01-16LibGfx: Don't expose anon_fd inside Gfx::ShareableBitmapAndreas Kling
Nobody outside needs to see this, so let's just hide it.
2021-01-16LibGfx: Don't encode invalid Gfx::ShareableBitmap as IPC::FileAndreas Kling
IPC::File should only be used when there's an actual file to pass. Invalid ShareableBitmaps don't have a backing file, so fix this by first encoding a "valid" flag.
2021-01-16Everywhere: Remove a bunch of <AK/SharedBuffer.h> includesAndreas Kling
2021-01-15WindowServer+Taskbar: Send WM icon updates as Gfx::ShareableBitmapAndreas Kling
Window icons in Taskbar were previously received in WM events with shbuf ID's. Now that Gfx::ShareableBitmap is backed by anonymous files, we can easily switch to using those.
2021-01-15LibGfx: Make Gfx::ShareableBitmap use anonymous files instead of shbufsAndreas Kling
2021-01-12Libraries: Move to Userland/Libraries/Andreas Kling