1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-10-13 20:12:06 +00:00
serenity/Documentation
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
..
Browser LibWeb: Rename WebContentView => OutOfProcessWebView 2020-08-17 18:05:35 +02:00
BuildInstructions.md Documentation: Add patch to fedora build deps (#4968) 2021-01-17 08:08:11 +01:00
CLionConfiguration.md Meta: Update CLion and WSL configuration documentations 2020-05-17 23:07:35 +02:00
CodingStyle.md Meta+Docs+CI: Require clang-format >= 11 2020-12-31 21:51:00 +01:00
HardwareCompatibility.md Meta: Add Hardware Compatbility List 2020-12-16 17:30:09 +01:00
HighDPI.md LibGfx: Give Bitmap a scale factor 2021-01-20 10:28:27 +01:00
INSTALL.md Meta: Update install guide with link to hardware compatibility list 2020-12-24 11:02:43 +01:00
NotesOnWSL.md Docs: Update WSL notes with some workarounds for known issues 2020-12-30 20:31:30 +01:00
SmartPointers.md Documentation: Tweak document about smart pointers a bit 2020-03-20 14:41:02 +01:00
UsingQtCreator.md Documentation: Make serenity.includes more easily copyable 2021-01-15 21:51:19 +01:00
VirtualBox.md Documentation: Add an installation guide for VirtualBox 2020-08-05 10:52:48 +02:00
VirtualBox_Creation_Reference.png Documentation: Add an installation guide for VirtualBox 2020-08-05 10:52:48 +02:00