<rdar://problem/5702947> WebCore: CGContextDrawPDFDocument will be deprecated
authorddkilzer@apple.com <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 24 Jan 2008 00:47:00 +0000 (00:47 +0000)
committerddkilzer@apple.com <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 24 Jan 2008 00:47:00 +0000 (00:47 +0000)
        Reviewed by Darin.

        No test cases added since there is no change in behavior.

        * platform/graphics/cg/PDFDocumentImage.cpp:
        (WebCore::PDFDocumentImage::draw): Replace CGContextDrawPDFDocument() with
        calls to CG methods that perform the equivalent work.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@29753 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/platform/graphics/cg/PDFDocumentImage.cpp

index 1a14696..d53b501 100644 (file)
@@ -1,3 +1,15 @@
+2008-01-23  David Kilzer  <ddkilzer@apple.com>
+
+        <rdar://problem/5702947> WebCore: CGContextDrawPDFDocument will be deprecated
+
+        Reviewed by Darin.
+
+        No test cases added since there is no change in behavior.
+
+        * platform/graphics/cg/PDFDocumentImage.cpp:
+        (WebCore::PDFDocumentImage::draw): Replace CGContextDrawPDFDocument() with
+        calls to CG methods that perform the equivalent work.
+
 2008-01-23  Antti Koivisto  <antti@apple.com>
 
         Reviewed by Hyatt, Adele.
index 09c6657..2578f08 100644 (file)
@@ -165,10 +165,9 @@ void PDFDocumentImage::draw(GraphicsContext* context, const FloatRect& dstRect,
     // Rotate translate image into position according to doc properties.
     adjustCTM(context);
 
-    // Media box may have non-zero origin which we ignore. Pass 1 for the page number.
-    CGContextDrawPDFDocument(context->platformContext(), FloatRect(FloatPoint(), m_mediaBox.size()),
-        m_document, m_currentPage + 1);
-    
+    CGContextTranslateCTM(context->platformContext(), -m_mediaBox.x(), -m_mediaBox.y());
+    CGContextDrawPDFPage(context->platformContext(), CGPDFDocumentGetPage(m_document, m_currentPage + 1));
+
     context->restore();
 
     if (imageObserver())