[Webkit-unassigned] [Bug 119955] Support interpolation between cross-fade() images

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Sep 4 09:06:50 PDT 2013


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


Darin Adler <darin at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #210459|review?                     |review+
               Flag|                            |




--- Comment #2 from Darin Adler <darin at apple.com>  2013-09-04 09:06:07 PST ---
(From update of attachment 210459)
View in context: https://bugs.webkit.org/attachment.cgi?id=210459&action=review

> LayoutTests/ChangeLog:10
> +        * animations/cross-fade-background-image.html:

Can we change this into a reference test instead of a pixel test?

Also, we normally try to avoid having any red in expected results from tests, but I see red in this one.

> Source/WebCore/css/CSSCrossfadeValue.h:72
> +    bool equalInputImages(const CSSCrossfadeValue&) const;

Naming here is a bit awkward. The function name “equal input images” sounds like a function that returns two equal images, not a function that answers the question, do these fades have input images that are equal.

> Source/WebCore/page/animation/CSSPropertyAnimation.cpp:332
> +            CSSCrossfadeValue* fromCrossfade = toCSSCrossfadeValue(fromGenerated);
> +            CSSCrossfadeValue* toCrossfade = toCSSCrossfadeValue(toGenerated);
> +            if (fromCrossfade->equalInputImages(*toCrossfade)) {
> +                RefPtr<CSSCrossfadeValue> result = toCrossfade->blend(*fromCrossfade, progress);
> +                return StyleGeneratedImage::create(result.get());
> +            }

I recommend writing this with references instead of pointers and eliminating the local variable for tighter code:

    if (fromGenerated->isCrossfadeValue() && toGenerated->isCrossfadeValue()) {
        CSSCrossfadeValue& fromCrossfade = *toCSSCrossfadeValue(fromGenerated);
        CSSCrossfadeValue& toCrossFade = *toCSSCrossfadeValue(toGenerated);
        if (fromCrossfade.equalInputImages(toCrossfade))
            return StyleGeneratedImage::create(toCrossfade.blend(fromCrossfade, progress).get());
    }

Might even want to use shorter variable names since these have tiny scope.

-- 
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