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: http://svn.webkit.org/repository/webkit/trunk@68176 268f45cc-cd09-0410-ab3c-d52691b4dbfc
9 files changed