2010-09-18 Matthew Delaney <mdelaney@apple.com>
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 18 Sep 2010 21:47:04 +0000 (21:47 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 18 Sep 2010 21:47:04 +0000 (21:47 +0000)
commit5788573ae629ecbabe1a0642b5088d01dafad30d
tree0d42383b27df31b604f313dee05561926e4c9b36
parent73c86f65f86c1f8a21e827714bd9fc526d3e9bb0
2010-09-18  Matthew Delaney  <mdelaney@apple.com>

        Reviewed by Oliver Hunt.

        Canvas drawImage with source or destination widths/heights of -1 renders incorrectly.
        https://bugs.webkit.org/show_bug.cgi?id=45976

        * canvas/philip/tests/2d.drawImage.negativeOneDest-expected.txt: Added.
        * canvas/philip/tests/2d.drawImage.negativeOneDest.html: Added. Tests that using -1
        for the destination width/height renders correctly.
        * canvas/philip/tests/2d.drawImage.negativeOneSource-expected.txt: Added.
        * canvas/philip/tests/2d.drawImage.negativeOneSource.html: Added. Tests that using -1
        for the source width/height renders correctly.
2010-09-18  Matthew Delaney  <mdelaney@apple.com>

        Reviewed by Oliver Hunt.

        Canvas drawImage with source or destination widths/heights of -1 renders incorrectly.
        https://bugs.webkit.org/show_bug.cgi?id=45976

        Specifying a -1 width or height for either the source or destination rectangle in drawImage
        get improperly drawn with -1 replaced as the corresponding image width or height. This was because
        the value -1 was being passed around to signal non-specified widths and heights and thus was
        interpreted lower down in the drawImage implementation which disallowed any calls that actually
        wanted to use -1 as the widths or heights. Fixed this by moving the default logic up and not using
        -1 in-band signaling to denote default behavior.

        Tests: canvas/philip/tests/2d.drawImage.negativeOneDest.html
               canvas/philip/tests/2d.drawImage.negativeOneSource.html

        * platform/graphics/GraphicsContext.cpp: Removed -1 in-band signals and replaced cascased calls to have
        the desired replaces for unspecified widths and heights earlier on.
        * platform/graphics/GraphicsContext.h: Removed faulty default value.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@67792 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/canvas/philip/tests/2d.drawImage.negativeOneDest-expected.txt [new file with mode: 0644]
LayoutTests/canvas/philip/tests/2d.drawImage.negativeOneDest.html [new file with mode: 0644]
LayoutTests/canvas/philip/tests/2d.drawImage.negativeOneSource-expected.txt [new file with mode: 0644]
LayoutTests/canvas/philip/tests/2d.drawImage.negativeOneSource.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/platform/graphics/GraphicsContext.cpp
WebCore/platform/graphics/GraphicsContext.h