Commit deb93998 authored by Xianzhu Wang's avatar Xianzhu Wang Committed by Commit Bot

Fix clip-path with offset mix-blending-mode

The synthethized clip layer should use the current transform instead of
the clip rect's transform.

Bug: 1144473
Change-Id: I6cd7457706d6b82b043a0b4bf20863a8a698d521
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2515206
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Reviewed-by: default avatarStephen Chenney <schenney@chromium.org>
Cr-Commit-Position: refs/heads/master@{#824093}
parent 0bb979be
......@@ -3911,7 +3911,7 @@ TEST_P(PaintArtifactCompositorTest, SynthesizedClipDelegateBackdropFilter) {
EXPECT_EQ(gfx::RRectF(),
mask_isolation_1.mask_filter_info.rounded_corner_bounds());
EXPECT_EQ(t0_id, clip_mask1->transform_tree_index());
EXPECT_EQ(t1_id, clip_mask1->transform_tree_index());
EXPECT_EQ(c2_id, clip_mask1->clip_tree_index());
const cc::EffectNode& mask =
*GetPropertyTrees().effect_tree.Node(clip_mask1->effect_tree_index());
......
......@@ -666,16 +666,16 @@ void PropertyTreeManager::EmitClipMaskLayer() {
cc::PictureLayer* mask_layer = clip.Layer();
const auto& clip_space = current_.clip->LocalTransformSpace().Unalias();
layer_list_builder_.Add(mask_layer);
mask_layer->set_property_tree_sequence_number(
root_layer_.property_tree_sequence_number());
mask_layer->SetTransformTreeIndex(EnsureCompositorTransformNode(clip_space));
mask_layer->SetTransformTreeIndex(
EnsureCompositorTransformNode(*current_.transform));
// TODO(pdr): This could be a performance issue because it crawls up the
// transform tree for each pending layer. If this is on profiles, we should
// cache a lookup of transform node to scroll translation transform node.
int scroll_id =
EnsureCompositorScrollNode(clip_space.NearestScrollTranslationNode());
int scroll_id = EnsureCompositorScrollNode(
current_.transform->NearestScrollTranslationNode());
mask_layer->SetScrollTreeIndex(scroll_id);
mask_layer->SetClipTreeIndex(mask_effect.clip_id);
mask_layer->SetEffectTreeIndex(mask_effect.id);
......
<!DOCTYPE html>
<div style="width: 100px; height: 30px; background: green"></div>
<div style="width: 30px; height: 70px; background: green"></div>
<!DOCTYPE html>
<title>CSS Masking: Test clip-path with mix-blend-mode with offset</title>
<link rel="author" title="Xianzhu Wang" href="mailto:wangxianzhu@chromium.org">
<link rel="help" href="http://www.w3.org/TR/css-masking-1/#the-clip-path">
<link rel="match" href="clip-path-blending-offset-ref.html">
<style>
div {
width: 100px;
height: 100px;
}
#clip-path {
overflow: hidden;
background: green;
clip-path: polygon(0 0, 100px 0, 100px 30px, 30px 30px, 30px 100px, 0 100px);
}
#blend {
position: absolute;
mix-blend-mode: multiply;
left: 40px;
top: 50px;
background: red;
}
</style>
<div id="clip-path">
<div id="blend"></div>
</div>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment