1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 02:47:35 +00:00
serenity/Userland/Libraries/LibWeb
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
..
Bindings LibWeb: Stub out the PerformanceTiming object from Navigation Timing 2021-01-18 15:11:20 +01:00
CodeGenerators LibWeb: Stub out the PerformanceTiming object from Navigation Timing 2021-01-18 15:11:20 +01:00
CSS LibWeb: Parse the CSS "flex-direction" property 2021-01-18 20:20:16 +01:00
DOM LibWeb: Parse "display: flex" and create BlockBox layout nodes for them 2021-01-18 20:20:00 +01:00
DumpLayoutTree Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
HighResolutionTime LibWeb: Stub out the PerformanceTiming object from Navigation Timing 2021-01-18 15:11:20 +01:00
HTML LibGfx: Give Bitmap a scale factor 2021-01-20 10:28:27 +01:00
Layout LibWeb: Very basic support for CSS flex-direction 2021-01-18 20:20:24 +01:00
Loader Everywhere: Remove a bunch of <AK/SharedBuffer.h> includes 2021-01-16 11:26:53 +01:00
NavigationTiming LibWeb: Stub out the PerformanceTiming object from Navigation Timing 2021-01-18 15:11:20 +01:00
Page Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
Painting Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
Scripts Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
SVG Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
Tests Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
UIEvents Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
CMakeLists.txt LibWeb: Add a very naive Layout::FlexFormattingContext :^) 2021-01-18 20:20:13 +01:00
DOMTreeModel.cpp Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
DOMTreeModel.h Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
Dump.cpp LibWeb: Parse "display: flex" and create BlockBox layout nodes for them 2021-01-18 20:20:00 +01:00
Dump.h Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
FontCache.cpp Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
FontCache.h Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
Forward.h LibWeb: Stub out the PerformanceTiming object from Navigation Timing 2021-01-18 15:11:20 +01:00
InProcessWebView.cpp Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
InProcessWebView.h Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
LayoutTreeModel.cpp Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
LayoutTreeModel.h Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
Namespace.cpp Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
Namespace.h Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
Origin.h Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
OutOfProcessWebView.cpp Everywhere: Remove more <AK/SharedBuffer.h> includes 2021-01-17 00:04:42 +01:00
OutOfProcessWebView.h LibWeb+WebContent: Use anonymous files for OOPWV backing stores 2021-01-16 23:21:52 +01:00
QualifiedName.h Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
StylePropertiesModel.cpp Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
StylePropertiesModel.h Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
TreeNode.h Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
URLEncoder.cpp Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
URLEncoder.h Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
WebContentClient.cpp LibWeb+WebContent: Use anonymous files for OOPWV backing stores 2021-01-16 23:21:52 +01:00
WebContentClient.h Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
WebViewHooks.h Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00