Add support for wide gamut for ShareableBitmap for image popovers
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 28 Oct 2016 00:50:53 +0000 (00:50 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 28 Oct 2016 00:50:53 +0000 (00:50 +0000)
commit57e9eb1ed2ff953a45010fa543d8e4f63cda45c6
treef77801947271afcb11517b8f875e8793a487e580
parent8365e14a93a848f2dc8c0760a7032d0a9a95bb6a
Add support for wide gamut for ShareableBitmap for image popovers
https://bugs.webkit.org/show_bug.cgi?id=164001

Patch by Megan Gardner <megan_gardner@apple.com> on 2016-10-27
Reviewed by Simon Fraser.

Source/WebCore:

Add a function to return a CGColorSpaceRef for extended sRGB.

This is currently untestable, so no tests added.

* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::extendedSRGBColorSpaceRef):

Source/WebKit2:

Added suppport for wide gamut in ShareableBitmap. SharableBitmaps now know the size of their pixels,
and that data is passed back and forth between the processes. The callers of SharedBitmap will determine
if their image should support wide gamut, but ShareableBitmap will override a set flag on a device that
is incapbable of supporting a wide gamut image.
This makes it possible to show wide gamut images in image popovers on iOS.
This is currently untestable, so no tests added.

* Platform/IPC/Decoder.cpp:
(IPC::Decoder::decode):
* Platform/IPC/Decoder.h:
* Platform/IPC/Encoder.cpp:
(IPC::Encoder::encode):
* Platform/IPC/Encoder.h:
* Shared/ShareableBitmap.cpp:
(WebKit::bytesPerPixel):
(WebKit::ShareableBitmap::Handle::encode):
(WebKit::ShareableBitmap::Handle::decode):
(WebKit::ShareableBitmap::Handle::clear):
(WebKit::ShareableBitmap::create):
(WebKit::ShareableBitmap::createShareable):
(WebKit::ShareableBitmap::createHandle):
(WebKit::ShareableBitmap::ShareableBitmap):
* Shared/ShareableBitmap.h:
(WebKit::ShareableBitmap::numBytesForSize):
(WebKit::ShareableBitmap::sizeInBytes):
* Shared/cg/ShareableBitmapCG.cpp:
(WebKit::bitmapInfo):
(WebKit::ShareableBitmap::createGraphicsContext):
(WebKit::ShareableBitmap::createCGImage):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::getPositionInformation):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@208020 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp
Source/WebCore/platform/graphics/cg/GraphicsContextCG.h
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/ShareableBitmap.cpp
Source/WebKit2/Shared/ShareableBitmap.h
Source/WebKit2/Shared/cg/ShareableBitmapCG.cpp
Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm