1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 10:57:35 +00:00
serenity/Userland/Libraries
Nico Weber 5f9c42c404 LibGfx: Give Bitmap a scale factor
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-20 10:28:27 +01:00
..
LibAudio AudioServer+LibAudio: Pass audio buffers as Core::AnonymousBuffer 2021-01-17 09:07:32 +01:00
LibC LibC: Return ENOSYS from clock_getres() rather than asserting 2021-01-18 22:28:56 +01:00
LibChess Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
LibCompress Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
LibCore LibCore: Fix invalid errno 2021-01-16 22:40:53 +01:00
LibCoreDump LibCoreDump: Expose arguments and environment 2021-01-15 23:26:47 +01:00
LibCpp Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
LibCrypt Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
LibCrypto Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
LibDebug Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
LibDesktop Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
LibDiff Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
LibELF LibELF: Remove unused m_global_symbol_lookup_func from DynamicObject 2021-01-18 19:17:52 +01:00
LibGemini Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
LibGfx LibGfx: Give Bitmap a scale factor 2021-01-20 10:28:27 +01:00
LibGUI LibGfx: Give Bitmap a scale factor 2021-01-20 10:28:27 +01:00
LibHTTP Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
LibImageDecoderClient ImageDecoder: Use Core::AnonymousBuffer and Gfx::ShareableBitmap 2021-01-16 23:58:57 +01:00
LibIPC LibCore+LibIPC: Add Core::AnonymousBuffer, an IPC-friendly buffer class 2021-01-16 17:20:24 +01:00
LibJS LibJS: Add JS::NativeFunction to the forwarding header 2021-01-18 12:18:29 +01:00
LibKeyboard Everywhere: Replace a bundle of dbg with dbgln. 2021-01-16 11:54:35 +01:00
LibLine Everywhere: Replace a bundle of dbg with dbgln. 2021-01-16 11:54:35 +01:00
LibM LibM: Add nextafter() and nexttoward() stubs 2021-01-18 22:28:56 +01:00
LibMarkdown Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
LibPCIDB LibC+Everywhere: Remove open_with_path_length() in favor of open() 2021-01-12 23:34:01 +01:00
LibProtocol Everywhere: Remove a bunch of <AK/SharedBuffer.h> includes 2021-01-16 11:26:53 +01:00
LibPthread Kernel: Some futex improvements 2021-01-17 20:30:31 +01:00
LibRegex Everywhere: Replace a bundle of dbg with dbgln. 2021-01-16 11:54:35 +01:00
LibTar Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
LibTextCodec Everywhere: Replace a bundle of dbg with dbgln. 2021-01-16 11:54:35 +01:00
LibThread Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
LibTLS Everywhere: Replace a bundle of dbg with dbgln. 2021-01-16 11:54:35 +01:00
LibTTF Everywhere: Replace a bundle of dbg with dbgln. 2021-01-16 11:54:35 +01:00
LibVT LibVT: Convert dbgprintf() => dbgln() and remove some debug code 2021-01-16 23:21:52 +01:00
LibWeb LibGfx: Give Bitmap a scale factor 2021-01-20 10:28:27 +01:00
LibX86 Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
CMakeLists.txt Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00