[webkit-changes] [WebKit/WebKit] e281c3: Images jiggle when swapping between bitmaps and CG...
Tim Horton
noreply at github.com
Wed Jul 19 17:13:51 PDT 2023
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: e281c3d178cb32c0c965879cac7c6f7322fcb7c9
https://github.com/WebKit/WebKit/commit/e281c3d178cb32c0c965879cac7c6f7322fcb7c9
Author: Tim Horton <thorton at apple.com>
Date: 2023-07-19 (Wed, 19 Jul 2023)
Changed paths:
M Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp
M Source/WebCore/platform/graphics/cg/GraphicsContextCG.h
M Source/WebKit/Shared/RemoteLayerTree/CGDisplayListImageBufferBackend.mm
Log Message:
-----------
Images jiggle when swapping between bitmaps and CGDisplayList rendering
https://bugs.webkit.org/show_bug.cgi?id=259345
rdar://107957041
Reviewed by Aditya Keerthi.
Instead of skipping pixel rounding entirely for CGDisplayList contexts, round
to their "hidden" scale (the scale of the bitmap tiles that they are shadowing).
This way, the rounding precisely matches between the 2x bitmaps and replayed
display list, regardless of target scale.
* Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::GraphicsContextCG::scaleForRoundingToDevicePixels const):
(WebCore::GraphicsContextCG::roundToDevicePixels const):
Factor determination of the device scale out from roundToDevicePixels.
* Source/WebCore/platform/graphics/cg/GraphicsContextCG.h:
* Source/WebKit/Shared/RemoteLayerTree/CGDisplayListImageBufferBackend.mm:
Override it in the CGDisplayList case and multiply in the "hidden" resolutionScale.
Canonical link: https://commits.webkit.org/266172@main
More information about the webkit-changes
mailing list