Title: [211601] trunk/Source/WebKit2
Revision
211601
Author
megan_gard...@apple.com
Date
2017-02-02 15:21:34 -0800 (Thu, 02 Feb 2017)

Log Message

Don't attempt wide gammut on older OSes
https://bugs.webkit.org/show_bug.cgi?id=167754
<rdar://problem/29931587>

Reviewed by Tim Horton.

We need to guard our extended color checks the same way throughout the code, or we will attempt to set up
support for wide gamut partially, which causes crashes when using sharable bitmap.

* WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
(WebKit::convertImageToBitmap):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::getPositionInformation):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (211600 => 211601)


--- trunk/Source/WebKit2/ChangeLog	2017-02-02 23:18:34 UTC (rev 211600)
+++ trunk/Source/WebKit2/ChangeLog	2017-02-02 23:21:34 UTC (rev 211601)
@@ -1,3 +1,19 @@
+2017-02-02  Megan Gardner  <megan_gard...@apple.com>
+
+        Don't attempt wide gammut on older OSes
+        https://bugs.webkit.org/show_bug.cgi?id=167754
+        <rdar://problem/29931587>
+
+        Reviewed by Tim Horton.
+
+        We need to guard our extended color checks the same way throughout the code, or we will attempt to set up
+        support for wide gamut partially, which causes crashes when using sharable bitmap.
+
+        * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
+        (WebKit::convertImageToBitmap):
+        * WebProcess/WebPage/ios/WebPageIOS.mm:
+        (WebKit::WebPage::getPositionInformation):
+
 2017-02-02  Enrica Casucci  <enr...@apple.com>
 
         WK2: cannot tap on candidate view with hardware keyboard.

Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm (211600 => 211601)


--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm	2017-02-02 23:18:34 UTC (rev 211600)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm	2017-02-02 23:21:34 UTC (rev 211601)
@@ -62,8 +62,10 @@
 static PassRefPtr<ShareableBitmap> convertImageToBitmap(NSImage *image, const IntSize& size, Frame& frame)
 {
     ShareableBitmap::Flags flags = ShareableBitmap::SupportsAlpha;
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200
     if (screenSupportsExtendedColor(frame.mainFrame().view()))
         flags |= ShareableBitmap::SupportsExtendedColor;
+#endif
     auto bitmap = ShareableBitmap::createShareable(size, flags);
     if (!bitmap)
         return nullptr;

Modified: trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm (211600 => 211601)


--- trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm	2017-02-02 23:18:34 UTC (rev 211600)
+++ trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm	2017-02-02 23:21:34 UTC (rev 211601)
@@ -2488,7 +2488,9 @@
                                     FloatSize bitmapSize = scaledSize.width() < image->size().width() ? scaledSize : image->size();
                                     // FIXME: Only select ExtendedColor on images known to need wide gamut
                                     ShareableBitmap::Flags flags = ShareableBitmap::SupportsAlpha;
+#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 100000
                                     flags |= screenSupportsExtendedColor() ? ShareableBitmap::SupportsExtendedColor : 0;
+#endif
                                     if (RefPtr<ShareableBitmap> sharedBitmap = ShareableBitmap::createShareable(IntSize(bitmapSize), flags)) {
                                         auto graphicsContext = sharedBitmap->createGraphicsContext();
                                         graphicsContext->drawImage(*image, FloatRect(0, 0, bitmapSize.width(), bitmapSize.height()));
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to