Title: [209397] trunk
Revision
209397
Author
[email protected]
Date
2016-12-06 08:55:49 -0800 (Tue, 06 Dec 2016)

Log Message

PDF markup/annotations visible in Mail on macOS but not on iOS
https://bugs.webkit.org/show_bug.cgi?id=165444
<rdar://problem/28942896>

Reviewed by Simon Fraser.

No new tests, but enabled an existing test for this feature.

* platform/graphics/cg/PDFDocumentImage.cpp:
(WebCore::PDFDocumentImage::drawPDFPage):
* platform/spi/cg/CoreGraphicsSPI.h:
Make use of CGContextDrawPDFPageWithAnnotations where available,
to paint the page with annotations.

* platform/ios-simulator/TestExpectations:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (209396 => 209397)


--- trunk/LayoutTests/ChangeLog	2016-12-06 16:54:30 UTC (rev 209396)
+++ trunk/LayoutTests/ChangeLog	2016-12-06 16:55:49 UTC (rev 209397)
@@ -1,3 +1,13 @@
+2016-12-06  Tim Horton  <[email protected]>
+
+        PDF markup/annotations visible in Mail on macOS but not on iOS
+        https://bugs.webkit.org/show_bug.cgi?id=165444
+        <rdar://problem/28942896>
+
+        Reviewed by Simon Fraser.
+
+        * platform/ios-simulator/TestExpectations:
+
 2016-12-06  Dave Hyatt  <[email protected]>
 
         [CSS Parser] Avoid more test

Modified: trunk/LayoutTests/platform/ios-simulator/TestExpectations (209396 => 209397)


--- trunk/LayoutTests/platform/ios-simulator/TestExpectations	2016-12-06 16:54:30 UTC (rev 209396)
+++ trunk/LayoutTests/platform/ios-simulator/TestExpectations	2016-12-06 16:55:49 UTC (rev 209397)
@@ -1447,7 +1447,6 @@
 fast/images/icon-decoding.html [ Failure ]
 fast/images/image-in-map.html [ Failure ]
 fast/images/imagemap-focus-ring-zoom.html [ Failure ]
-fast/images/pdf-as-image-with-annotations.html [ ImageOnlyFailure ]
 fast/images/repaint-subrect-grid.html [ Failure ]
 fast/images/support-broken-image-delegate.html [ Failure ]
 fast/images/webp-image-decoding.html [ Failure ]

Modified: trunk/Source/WebCore/ChangeLog (209396 => 209397)


--- trunk/Source/WebCore/ChangeLog	2016-12-06 16:54:30 UTC (rev 209396)
+++ trunk/Source/WebCore/ChangeLog	2016-12-06 16:55:49 UTC (rev 209397)
@@ -1,3 +1,19 @@
+2016-12-06  Tim Horton  <[email protected]>
+
+        PDF markup/annotations visible in Mail on macOS but not on iOS
+        https://bugs.webkit.org/show_bug.cgi?id=165444
+        <rdar://problem/28942896>
+
+        Reviewed by Simon Fraser.
+
+        No new tests, but enabled an existing test for this feature.
+
+        * platform/graphics/cg/PDFDocumentImage.cpp:
+        (WebCore::PDFDocumentImage::drawPDFPage):
+        * platform/spi/cg/CoreGraphicsSPI.h:
+        Make use of CGContextDrawPDFPageWithAnnotations where available,
+        to paint the page with annotations.
+
 2016-12-06  Dave Hyatt  <[email protected]>
 
         [CSS Parser] Turn on the new CSS parser

Modified: trunk/Source/WebCore/platform/graphics/cg/PDFDocumentImage.cpp (209396 => 209397)


--- trunk/Source/WebCore/platform/graphics/cg/PDFDocumentImage.cpp	2016-12-06 16:54:30 UTC (rev 209396)
+++ trunk/Source/WebCore/platform/graphics/cg/PDFDocumentImage.cpp	2016-12-06 16:55:49 UTC (rev 209397)
@@ -349,8 +349,12 @@
     notImplemented();
 #else
     // CGPDF pages are indexed from 1.
+#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200) || (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 100000)
+    CGContextDrawPDFPageWithAnnotations(context.platformContext(), CGPDFDocumentGetPage(m_document.get(), 1), nullptr);
+#else
     CGContextDrawPDFPage(context.platformContext(), CGPDFDocumentGetPage(m_document.get(), 1));
 #endif
+#endif
 }
 
 #endif // !USE(PDFKIT_FOR_PDFDOCUMENTIMAGE)

Modified: trunk/Source/WebCore/platform/spi/cg/CoreGraphicsSPI.h (209396 => 209397)


--- trunk/Source/WebCore/platform/spi/cg/CoreGraphicsSPI.h	2016-12-06 16:54:30 UTC (rev 209396)
+++ trunk/Source/WebCore/platform/spi/cg/CoreGraphicsSPI.h	2016-12-06 16:55:49 UTC (rev 209397)
@@ -188,6 +188,12 @@
 CGFontAntialiasingStyle CGContextGetFontAntialiasingStyle(CGContextRef);
 void CGContextSetFontAntialiasingStyle(CGContextRef, CGFontAntialiasingStyle);
 
+#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200) || (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 100000)
+typedef struct CGPDFAnnotation *CGPDFAnnotationRef;
+typedef bool (^CGPDFAnnotationDrawCallbackType)(CGContextRef context, CGPDFPageRef page, CGPDFAnnotationRef annotation);
+void CGContextDrawPDFPageWithAnnotations(CGContextRef, CGPDFPageRef, CGPDFAnnotationDrawCallbackType);
+#endif
+
 #if USE(IOSURFACE)
 CGContextRef CGIOSurfaceContextCreate(IOSurfaceRef, size_t, size_t, size_t, size_t, CGColorSpaceRef, CGBitmapInfo);
 CGImageRef CGIOSurfaceContextCreateImage(CGContextRef);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to