Commit 68d4609e authored by Chris Harrelson's avatar Chris Harrelson Committed by Commit Bot

[BGPT] Add fast border radius support behind a flag

"Fast border radius" means using a procedural GL shader to
draw rounded corners, not a mask layer.

Bug: 947715

Change-Id: I51503223d4b4291cea0496fc44ecd72888af6710
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1566727Reviewed-by: default avatarXianzhu Wang <wangxianzhu@chromium.org>
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Commit-Queue: Chris Harrelson <chrishtr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#650563}
parent 92e2e514
......@@ -1036,6 +1036,8 @@ static bool IsRenderSurfaceCandidate(
blink_effects[effect.id] &&
blink_effects[effect.id]->HasActiveOpacityAnimation())
return true;
if (effect.is_fast_rounded_corner)
return true;
return false;
}
......
......@@ -504,6 +504,9 @@ int PropertyTreeManager::EnsureCompositorScrollNode(
}
void PropertyTreeManager::EmitClipMaskLayer() {
if (RuntimeEnabledFeatures::FastBorderRadiusEnabled())
return;
cc::EffectNode& mask_isolation = *GetEffectTree().Node(current_.effect_id);
if (pending_synthetic_mask_layers_.Contains(mask_isolation.id))
return;
......@@ -755,8 +758,15 @@ SkBlendMode PropertyTreeManager::SynthesizeCcEffectsForClipsIfNeeded(
const auto& transform = pending_clip.clip->LocalTransformSpace();
synthetic_effect.transform_id = EnsureCompositorTransformNode(transform);
synthetic_effect.double_sided = !transform.IsBackfaceHidden();
if (RuntimeEnabledFeatures::FastBorderRadiusEnabled()) {
synthetic_effect.rounded_corner_bounds =
gfx::RRectF(pending_clip.clip->ClipRect());
synthetic_effect.is_fast_rounded_corner = true;
} else {
synthetic_effect.has_render_surface = true;
pending_synthetic_mask_layers_.insert(synthetic_effect.id);
}
// Clip and kDstIn do not commute. This shall never be reached because
// kDstIn is only used internally to implement CSS clip-path and mask,
......
......@@ -524,6 +524,9 @@
{
name: "FallbackCursorMode",
},
{
name: "FastBorderRadius",
},
{
name: "FastFlatTreeTraversal",
status: "stable",
......
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