2007-04-05 Oliver Hunt <oliver@apple.com>
authoroliver <oliver@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 5 Apr 2007 10:20:22 +0000 (10:20 +0000)
committeroliver <oliver@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 5 Apr 2007 10:20:22 +0000 (10:20 +0000)
commit9faaedb6305f846b1d5143e9e348571de248c9a0
tree2424c75d8e2d79cdfa180b8564a5a7b7cc7742bc
parentcb23f6e5cb41f4c3d46566f29c4988f7a431d123
2007-04-05  Oliver Hunt  <oliver@apple.com>

        Reviewed by Adam.

WebCore:
        Fix rdar://problem/5030934 -- landscape PDFs embedded as an image are cut off
        also fixes scaling of pdf images

        PDFDocumentImage was not accounting for page rotation in a number of places

        * platform/graphics/cg/PDFDocumentImage.cpp:
        (WebCore::PDFDocumentImage::size):
          we need to account for rotation of the pdf image effecting our bounds
        (WebCore::PDFDocumentImage::draw):
          When compensating for flipped coords we need to use the correct rect for the
          coordinate space.  We can't pass size() to CGContextDrawPDFDocument as it
          returns the rotated bounds now -- this is also save the old
          FloatSize -> IntSize -> FloatSize conversions.
LayoutTests:
        Testcase for landscape pdfs as image

        rdar://problem/5030934 -- landscape PDFs embedded as an image are cut off

        * fast/images/pdf-as-image-landscape-expected.txt: Added.
        * fast/images/pdf-as-image-landscape.html: Added.
        * fast/images/resources/pdf_test_landscape.pdf: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@20720 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/images/pdf-as-image-landscape-expected.txt [new file with mode: 0644]
LayoutTests/fast/images/pdf-as-image-landscape.html [new file with mode: 0644]
LayoutTests/fast/images/resources/pdf_test_landscape.pdf [new file with mode: 0644]
WebCore/ChangeLog
WebCore/platform/graphics/cg/PDFDocumentImage.cpp