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

Set contents_opaque(false) if the background color is transparent #34930

Merged
merged 1 commit into from
Jul 26, 2022

Conversation

chromium-wpt-export-bot
Copy link
Collaborator

@chromium-wpt-export-bot chromium-wpt-export-bot commented Jul 21, 2022

Previously if a layer's background was transparent and the layer is
opaque, we used the layer_tree_host's background as
SafeOpaqueBackgroundColor(). One of the usages of
SafeOpaqueBackgroundColor() is to fill the otherwise translucent
antialiased pixels along the edge of rasterization, when the layer
has non-integral raster transform, to ensure the layer is still
fully opaque. However, the color might be dramatically
different from the normal color in the layer, causing edge artifacts.

Now set contents_opaque(false) in the case.

The case of opaque layer not having a background color only happens
in cases such as the layer has an opaque background image. In such
cases, using any heuristic color as the
SafeOpaqueBackgroundColor() may be inappropriate because the color
may be visibly different from the background image.

This also prevents seams between adjacent image layers when the layers
layer have non-integral to-screen transforms.

Bug: 1330509
Change-Id: I91edeb1c02da5eaa38ea0431f0559775b273f418
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3779000
Reviewed-by: Stefan Zager <szager@chromium.org>
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1028113}

Copy link
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

Choose a reason for hiding this comment

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

The review process for this patch is being conducted in the Chromium project.

@chromium-wpt-export-bot chromium-wpt-export-bot force-pushed the chromium-export-cl-3779000 branch 4 times, most recently from 85742f8 to c931b0e Compare July 23, 2022 15:53
Previously if a layer's background was transparent and the layer is
opaque, we used the layer_tree_host's background as
SafeOpaqueBackgroundColor(). One of the usages of
SafeOpaqueBackgroundColor() is to fill the otherwise translucent
antialiased pixels along the edge of rasterization, when the layer
has non-integral raster transform, to ensure the layer is still
fully opaque. However, the color might be dramatically
different from the normal color in the layer, causing edge artifacts.

Now set contents_opaque(false) in the case.

The case of opaque layer not having a background color only happens
in cases such as the layer has an opaque background image. In such
cases, using any heuristic color as the
SafeOpaqueBackgroundColor() may be inappropriate because the color
may be visibly different from the background image.

This also prevents seams between adjacent image layers when the layers
layer have non-integral to-screen transforms.

Bug: 1330509
Change-Id: I91edeb1c02da5eaa38ea0431f0559775b273f418
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3779000
Reviewed-by: Stefan Zager <szager@chromium.org>
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1028113}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants