[Webkit-unassigned] [Bug 202739] [GTK] Implement conic gradient

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Oct 11 06:31:53 PDT 2019


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

Carlos Alberto Lopez Perez <clopez at igalia.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |clopez at igalia.com

--- Comment #3 from Carlos Alberto Lopez Perez <clopez at igalia.com> ---
Comment on attachment 380525
  --> https://bugs.webkit.org/attachment.cgi?id=380525
Patch

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

> Source/WebCore/css/CSSGradientValue.cpp:1364
> +    float startRadius = sqrt(powf(size.width() - centerPoint.x(), 2) + powf(size.width() - centerPoint.y(), 2));

You can use std::hypot here instead (see bug 198483)

> Source/WebCore/platform/graphics/cairo/GradientCairo.cpp:62
> +static void
> +add_color_stop_rgba(cairo_pattern_t* gradient, Gradient::ColorStop thisColor, float globalAlpha);
> +
> +static cairo_pattern_t*
> +create_conic(float xo, float yo, float r, float angleRadians,
> +    Gradient::ColorStopVector stops, float globalAlpha);
> +
> +static void
> +conic_sector(cairo_pattern_t* gradient, float cx, float cy, float r, float angleRadians,
> +    Gradient::ColorStop firstColor, Gradient::ColorStop lastColor, float globalAlpha);
> +
> +static Gradient::ColorStop
> +interpolate_color(Gradient::ColorStop firstColor, Gradient::ColorStop lastColor);
> +
> +static void
> +set_corner_color_rgba(cairo_pattern_t* gradient, int id, Gradient::ColorStop thisColor, float globalAlpha);

In webkit code the preferred style is to put the return value of the function and the function header on the same line

> Source/WebCore/platform/graphics/cairo/GradientCairo.cpp:104
> +static void
> +add_color_stop_rgba(cairo_pattern_t *gradient, Gradient::ColorStop stop, float globalAlpha)

same here

> Source/WebCore/platform/graphics/cairo/GradientCairo.cpp:117
> +static cairo_pattern_t*
> +create_conic(float xo, float yo, float r, float angleRadians,

same here

> Source/WebCore/platform/graphics/cairo/GradientCairo.cpp:142
> +static void
> +conic_sector(cairo_pattern_t *gradient, float cx, float cy, float r, float angleRadians,

and here

> Source/WebCore/platform/graphics/cairo/GradientCairo.cpp:180
> +static void
> +set_corner_color_rgba(cairo_pattern_t* gradient, int id, Gradient::ColorStop stop, float globalAlpha)

here also

> Source/WebCore/platform/graphics/cairo/GradientCairo.cpp:193
> +static Gradient::ColorStop
> +interpolate_color(Gradient::ColorStop from, Gradient::ColorStop to)

and here

-- 
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/20191011/9d58a637/attachment-0001.html>


More information about the webkit-unassigned mailing list