2010-09-23 Matthew Delaney <mdelaney@apple.com>
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 23 Sep 2010 19:15:48 +0000 (19:15 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 23 Sep 2010 19:15:48 +0000 (19:15 +0000)
commit91466be0e1409cf5d203169218a60faad8e046e4
tree445751cdc7dfb79fdeb4bff675e7bd122b3727d3
parent02566c91f3ca36161664e0aa0c328cf47e133f15
2010-09-23  Matthew Delaney  <mdelaney@apple.com>

        Reviewed by Oliver Hunt.

        context.drawImage with (source rect's height) = -(input image's native height) draws nothing
        https://bugs.webkit.org/show_bug.cgi?id=46243

        These test simply exercise using negative widths and heights for the source rect in ctx.drawImage calls.

        * canvas/philip/tests/2d.drawImage.negativeSourceHeight-expected.txt: Added.
        * canvas/philip/tests/2d.drawImage.negativeSourceHeight.html: Added.
        * canvas/philip/tests/2d.drawImage.negativeSourceHeight2-expected.txt: Added.
        * canvas/philip/tests/2d.drawImage.negativeSourceHeight2.html: Added.
        * canvas/philip/tests/2d.drawImage.negativeSourceHeightAndWidth-expected.txt: Added.
        * canvas/philip/tests/2d.drawImage.negativeSourceHeightAndWidth.html: Added.
2010-09-23  Matthew Delaney  <mdelaney@apple.com>

        Reviewed by Oliver Hunt.

        context.drawImage with (source rect's height) = -(input image's native height) draws nothing
        https://bugs.webkit.org/show_bug.cgi?id=46243

        This patch changes canvasrenderingcontext2d's drawImage with an image element to
        normalize the source and dest rects to acheive the desired canvas spec behavior
        of allowing negative widths and heights that don't cause flipping and fix the
        adverse behavior of specifying a source rect height of negative the source image's height

        Tests: canvas/philip/tests/2d.drawImage.negativeSourceHeight.html
               canvas/philip/tests/2d.drawImage.negativeSourceHeight2.html
               canvas/philip/tests/2d.drawImage.negativeSourceHeightAndWidth.html

        * html/canvas/CanvasRenderingContext2D.cpp: Normalize rects in drawImage before calling
        lower level draw calls.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@68176 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/canvas/philip/tests/2d.drawImage.negativeSourceHeight-expected.txt [new file with mode: 0644]
LayoutTests/canvas/philip/tests/2d.drawImage.negativeSourceHeight.html [new file with mode: 0644]
LayoutTests/canvas/philip/tests/2d.drawImage.negativeSourceHeight2-expected.txt [new file with mode: 0644]
LayoutTests/canvas/philip/tests/2d.drawImage.negativeSourceHeight2.html [new file with mode: 0644]
LayoutTests/canvas/philip/tests/2d.drawImage.negativeSourceHeightAndWidth-expected.txt [new file with mode: 0644]
LayoutTests/canvas/philip/tests/2d.drawImage.negativeSourceHeightAndWidth.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/html/canvas/CanvasRenderingContext2D.cpp