[Webkit-unassigned] [Bug 138551] Border-radius does not clip a composited decendent

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Nov 10 10:44:35 PST 2014


https://bugs.webkit.org/show_bug.cgi?id=138551

Simon Fraser (smfr) <simon.fraser at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #241288|review?                     |review-
              Flags|                            |

--- Comment #5 from Simon Fraser (smfr) <simon.fraser at apple.com> ---
Comment on attachment 241288
  --> https://bugs.webkit.org/attachment.cgi?id=241288
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=241288&action=review

> Source/WebCore/ChangeLog:18
> +        If an element's layer with accelerated children and border-radius reaches 
> +        the compositing state of |paintsIntoCompositedAncestor|, painting is 
> +        no longer performed due to the early bail in CompositedLayerMapping::doPaintTask, 
> +        which also triggers a debug assert.
> +
> +        The issue was caused by adding support for correctly rendering layers having 
> +        border-radius and overflow-hidden using masks, by the time 
> +        the |paintsIntoCompositedAncestor| compositing state was removed.
> +        However, this compositing state was reintroduced, causing the problem at matter.

This comment seems to come before the relevant comments about support border-radius clip with compositing.

> Source/WebCore/platform/graphics/GraphicsLayer.h:251
> +    GraphicsLayer* contentsClippingMaskLayer() const { return m_contentsClippingMaskLayer; }
> +    virtual void setContentsClippingMaskLayer(GraphicsLayer* layer) { m_contentsClippingMaskLayer = layer; }

You need to look at what I did for Mac in r175794.
On Mac/iOS we can use the existing contentsClippingLayer for border-radius clip, since CA supports clipping via a layer's corner radius. We use a mask shape layer in cases where that's not possible.

Because of that it's not appropriate to add a contentsClippingMaskLayer for all platforms here in the base class; you need to do this in a way that lets platforms optimally clip.

> Source/WebCore/rendering/RenderBox.cpp:1490
> +void RenderBox::paintClippingMask(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
> +{
> +    if (!paintInfo.shouldPaintWithinRoot(*this) || style().visibility() != VISIBLE || paintInfo.phase != PaintPhaseClippingMask || paintInfo.context->paintingDisabled())
> +        return;
> +
> +    LayoutRect paintRect = LayoutRect(paintOffset, size());
> +    paintInfo.context->fillRect(snappedIntRect(paintRect), Color::black, ColorSpaceDeviceRGB);
> +}

I don't understand why any new code in renderers is required.

> Source/WebCore/rendering/RenderLayerBacking.cpp:94
> +static inline bool isAcceleratedContents(const RenderObject& renderer)

This is a bad name: should be hasAcceleratedContents()

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20141110/3ed76663/attachment-0002.html>


More information about the webkit-unassigned mailing list