[Webkit-unassigned] [Bug 67652] Negative width/height values not always treated properly by 2D canvas drawImage

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jun 26 18:56:43 PDT 2013


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





--- Comment #13 from Gyuyoung Kim <gyuyoung.kim at samsung.com>  2013-06-26 18:58:38 PST ---
(From update of attachment 205451)
View in context: https://bugs.webkit.org/attachment.cgi?id=205451&action=review

I think you need to check if there is regression on whole layout test.

> Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp:92
> +static bool clipRectangles(FloatRect &imageRect, FloatRect &normalizedSrcRect, FloatRect &normalizedDstRect)

Wrong & place.

> Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp:104
> +        float clipRatio = (normalizedSrcRect.width() - (imageRect.x() + imageRect.width() - normalizedSrcRect.x()) )/ normalizedSrcRect.width();

Missing a space in )/ normalizedSrcRect.width();

> Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp:120
> +        float clipRatio = (normalizedSrcRect.height() - (imageRect.y() + imageRect.height() - normalizedSrcRect.y()) )/ normalizedSrcRect.height();

ditto.

> Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp:1339
> +    if (!imageRect.contains(normalizedSrcRect)) 

Remove indentation after ).

> Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp:1340
> +        if (!clipRectangles(imageRect, normalizedSrcRect, normalizedDstRect))

Why can't we use below ?

if (!videoRect.contains(normalizedSrcRect) && !clipRectangles(videoRect, normalizedSrcRect, normalizedDstRect))
    return;

> Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp:1418
> +        if (!clipRectangles(srcCanvasRect, normalizedSrcRect, normalizedDstRect))

ditto.

> Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp:1516
> +        if (!clipRectangles(videoRect, normalizedSrcRect, normalizedDstRect))

ditto ?

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