[Webkit-unassigned] [Bug 70634] Mark GraphicsLayers as opaque when possible

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Oct 25 11:06:25 PDT 2011


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





--- Comment #13 from Simon Fraser (smfr) <simon.fraser at apple.com>  2011-10-25 11:06:22 PST ---
(From update of attachment 112351)
View in context: https://bugs.webkit.org/attachment.cgi?id=112351&action=review

> Source/WebCore/rendering/RenderBoxModelObject.cpp:2569
> +static bool opaqueBorder(EBorderStyle bstyle)
> +{
> +    switch (bstyle) {
> +    case BNONE:
> +    case BHIDDEN:
> +    case INSET:
> +    case GROOVE:
> +    case OUTSET:
> +    case RIDGE:
> +    case SOLID:
> +        return true;
> +    case DOTTED:
> +    case DASHED:
> +    case DOUBLE:
> +        return false;
> +    }
> +    ASSERT_NOT_REACHED();
> +}

Seems like this would work as a method on BorderEdge nicely.

> Source/WebCore/rendering/RenderBoxModelObject.cpp:2589
> +    if (style()->hasBorder()
> +        && ((style()->borderLeftWidth() && !opaqueBorder(style()->borderLeftStyle()))
> +         || (style()->borderTopWidth() && !opaqueBorder(style()->borderTopStyle()))
> +         || (style()->borderRightWidth() && !opaqueBorder(style()->borderRightStyle()))
> +         || (style()->borderBottomWidth() && !opaqueBorder(style()->borderBottomStyle())))) {
> +        if (bgClip == BorderFillBox)
> +            bgVisible = true; // Can see the background through the border
> +        else
> +            return false; // Can see through the border, and it isn't filled by the background
> +    }

Would also be better to fit into the BorderEdge logic.

> Source/WebCore/rendering/RenderBoxModelObject.h:123
> +    virtual bool opaqueContentsBackground() const
> +    {
> +        const Color color = style()->visitedDependentColor(CSSPropertyBackgroundColor);
> +        return color.isValid() && !color.hasAlpha();
> +    }

I think you should check for border-radius here.

> Source/WebCore/rendering/RenderObject.h:739
> +    virtual bool opaqueContentsForeground() const { return false; }
> +
> +    // Returns true if the background within the object's contents bounds is known to be completely opaque.
> +    virtual bool opaqueContentsBackground() const { return false; }

We try to use method names that read well; these do not. If you're adding these methods, I'd prefer you pass a rect as required for bug 49135, so they become:

virtual bool foregroundIsOpaqueInRect(const LayoutRect&) const
virtual bool backgroundIsOpaqueInRect(const LayoutRect&) const

> Source/WebCore/rendering/RenderObject.h:743
> +    virtual bool opaqueContentsExterior() const { return false; }

We use 'box decorations' to refer to border, outline, shadow etc. The method name doesn't really say what it does.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list