Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use device pixel scaled backing store for <canvas> with image-rendering: pixelated. #5950

Conversation

mattwoodrow
Copy link
Contributor

@mattwoodrow mattwoodrow commented Oct 31, 2022

8ed3d52

Use device pixel scaled backing store for <canvas> with image-rendering: pixelated.
https://bugs.webkit.org/show_bug.cgi?id=247251
<rdar://99895407>

Reviewed by Simon Fraser.

We need to do scaling during painting to apply the image-rendering effect. An alternative fix would
be to set the image-rendering value on the GraphicsLayer, but its complicated to make that change
dependent on having computed isUnscaledBitmapOnly.

* LayoutTests/platform/ios-wk2/TestExpectations:
* Source/WebCore/rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::isUnscaledBitmapOnly const):
* Source/WebCore/rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::layerStyleChanged):

Canonical link: https://commits.webkit.org/256299@main

307f4ae

Misc iOS, tvOS & watchOS macOS Linux Windows
βœ… πŸ§ͺ style βœ… πŸ›  ios βœ… πŸ›  mac βœ… πŸ›  wpe βœ… πŸ›  πŸ§ͺ win
βœ… πŸ§ͺ bindings βœ… πŸ›  ios-sim βœ… πŸ›  mac-debug βœ… πŸ›  gtk βœ… πŸ›  wincairo
βœ… πŸ§ͺ webkitperl βœ… πŸ§ͺ ios-wk2 βœ… πŸ›  mac-AS-debug βœ… πŸ§ͺ gtk-wk2
βœ… πŸ§ͺ api-ios βœ… πŸ§ͺ api-mac βœ… πŸ§ͺ api-gtk
βœ… πŸ›  tv βœ… πŸ§ͺ mac-wk1
βœ… πŸ›  tv-sim βœ… πŸ§ͺ mac-wk2
βœ… πŸ›  πŸ§ͺ merge βœ… πŸ›  watch βœ… πŸ§ͺ mac-AS-debug-wk2
βœ… πŸ›  watch-sim βœ… πŸ§ͺ mac-wk2-stress

@mattwoodrow mattwoodrow self-assigned this Oct 31, 2022
@mattwoodrow mattwoodrow added Layout and Rendering For bugs with layout and rendering of Web pages. WebKit Nightly Build labels Oct 31, 2022

// image rendering mode can determine whether we use device pixel ratio for the backing store.
if (oldStyle && oldStyle->imageRendering() != newStyle.imageRendering())
layer.setNeedsCompositingGeometryUpdate();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

contentsInfo.isUnscaledBitmapOnly()is consulted in RenderLayerBacking::updateConfiguration() so this should be setNeedsCompositingConfigurationUpdate().

@mattwoodrow mattwoodrow force-pushed the eng/Use-device-pixel-scaled-backing-store-for-canvas-with-image-rendering-pixelated branch from 50db1d6 to 307f4ae Compare October 31, 2022 19:22
@mattwoodrow mattwoodrow requested a review from smfr November 2, 2022 22:04
@mattwoodrow mattwoodrow added the merge-queue Applied to send a pull request to merge-queue label Nov 3, 2022
…ng: pixelated.

https://bugs.webkit.org/show_bug.cgi?id=247251
<rdar://99895407>

Reviewed by Simon Fraser.

We need to do scaling during painting to apply the image-rendering effect. An alternative fix would
be to set the image-rendering value on the GraphicsLayer, but its complicated to make that change
dependent on having computed isUnscaledBitmapOnly.

* LayoutTests/platform/ios-wk2/TestExpectations:
* Source/WebCore/rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::isUnscaledBitmapOnly const):
* Source/WebCore/rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::layerStyleChanged):

Canonical link: https://commits.webkit.org/256299@main
@webkit-commit-queue webkit-commit-queue force-pushed the eng/Use-device-pixel-scaled-backing-store-for-canvas-with-image-rendering-pixelated branch from 307f4ae to 8ed3d52 Compare November 3, 2022 23:55
@webkit-commit-queue
Copy link
Collaborator

Committed 256299@main (8ed3d52): https://commits.webkit.org/256299@main

Reviewed commits have been landed. Closing PR #5950 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit 8ed3d52 into WebKit:main Nov 3, 2022
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Nov 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Layout and Rendering For bugs with layout and rendering of Web pages.
Projects
None yet
4 participants