ladybird/Userland
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
..
Applications AudioServer+LibAudio: Pass audio buffers as Core::AnonymousBuffer 2021-01-17 09:07:32 +01:00
Demos LibGfx: Give Bitmap a scale factor 2021-01-20 10:28:27 +01:00
DevTools Kernel+Userland: Remove shared buffers (shbufs) 2021-01-17 09:07:32 +01:00
DynamicLoader Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
Games Everywhere: Drop "shared_buffer" in most GUI programs, pledge "recvfd" 2021-01-16 19:30:32 +01:00
Libraries LibGfx: Give Bitmap a scale factor 2021-01-20 10:28:27 +01:00
MenuApplets Everywhere: Drop "shared_buffer" in most GUI programs, pledge "recvfd" 2021-01-16 19:30:32 +01:00
Services LibGfx: Give Bitmap a scale factor 2021-01-20 10:28:27 +01:00
Shell Shell: Don't spam perror() on kill_job() 2021-01-19 08:19:43 +01:00
Tests LibC: Test behavior around overlong paths 2021-01-16 22:40:53 +01:00
Utilities Everywhere: Remove more <AK/SharedBuffer.h> includes 2021-01-17 00:04:42 +01:00
CMakeLists.txt Services: Move to Userland/Services/ 2021-01-12 12:23:01 +01:00