Title: [231535] trunk/Source/WebKit
Revision
231535
Author
pvol...@apple.com
Date
2018-05-08 18:34:56 -0700 (Tue, 08 May 2018)

Log Message

Set colorspace in the PDF plugin.
https://bugs.webkit.org/show_bug.cgi?id=185445
<rdar://problem/40030981>

Reviewed by Simon Fraser.

* WebProcess/Plugins/PDF/PDFLayerControllerSPI.h:
* WebProcess/Plugins/PDF/PDFPlugin.mm:
(WebKit::PDFPlugin::PDFPlugin):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (231534 => 231535)


--- trunk/Source/WebKit/ChangeLog	2018-05-09 01:11:40 UTC (rev 231534)
+++ trunk/Source/WebKit/ChangeLog	2018-05-09 01:34:56 UTC (rev 231535)
@@ -1,3 +1,15 @@
+2018-05-08  Per Arne Vollan  <pvol...@apple.com>
+
+        Set colorspace in the PDF plugin.
+        https://bugs.webkit.org/show_bug.cgi?id=185445
+        <rdar://problem/40030981>
+
+        Reviewed by Simon Fraser.
+
+        * WebProcess/Plugins/PDF/PDFLayerControllerSPI.h:
+        * WebProcess/Plugins/PDF/PDFPlugin.mm:
+        (WebKit::PDFPlugin::PDFPlugin):
+
 2018-05-08  Megan Gardner  <megan_gard...@apple.com>
 
         Don't clear selection until we are actually interacting with a Node.

Modified: trunk/Source/WebKit/WebProcess/Plugins/PDF/PDFLayerControllerSPI.h (231534 => 231535)


--- trunk/Source/WebKit/WebProcess/Plugins/PDF/PDFLayerControllerSPI.h	2018-05-09 01:11:40 UTC (rev 231534)
+++ trunk/Source/WebKit/WebProcess/Plugins/PDF/PDFLayerControllerSPI.h	2018-05-09 01:34:56 UTC (rev 231535)
@@ -166,6 +166,9 @@
 - (id)accessibilityElementForAnnotation:(PDFAnnotation *)annotation;
 #endif
 
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
+- (void)setDeviceColorSpace:(CGColorSpaceRef)colorSpace;
+#endif
 @end
 
 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300

Modified: trunk/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm (231534 => 231535)


--- trunk/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm	2018-05-09 01:11:40 UTC (rev 231534)
+++ trunk/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm	2018-05-09 01:34:56 UTC (rev 231535)
@@ -74,6 +74,7 @@
 #import <WebCore/PDFDocumentImage.h>
 #import <WebCore/Page.h>
 #import <WebCore/Pasteboard.h>
+#import <WebCore/PlatformScreen.h>
 #import <WebCore/PluginData.h>
 #import <WebCore/PluginDocument.h>
 #import <WebCore/RenderBoxModelObject.h>
@@ -632,6 +633,12 @@
 
     [m_containerLayer addSublayer:m_contentLayer.get()];
     [m_containerLayer addSublayer:m_scrollCornerLayer.get()];
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
+    if ([m_pdfLayerController respondsToSelector:@selector(setDeviceColorSpace:)]) {
+        auto view = webFrame()->coreFrame()->view();
+        [m_pdfLayerController setDeviceColorSpace:screenColorSpace(view)];
+    }
+#endif
 }
 
 PDFPlugin::~PDFPlugin()
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to