<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[277986] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/277986">277986</a></dd>
<dt>Author</dt> <dd>weinig@apple.com</dd>
<dt>Date</dt> <dd>2021-05-24 18:26:18 -0700 (Mon, 24 May 2021)</dd>
</dl>

<h3>Log Message</h3>
<pre>Convert DestinationColorSpace from an enum to class wrapping a platform color space (CGColorSpaceRef for CG ports, etc.)
https://bugs.webkit.org/show_bug.cgi?id=226143

Reviewed by Darin Adler.

Source/WebCore:

Replace enumeration based DestinationColorSpace with a struct wrapping
a platform color space (CGColorSpaceRef for CG ports, etc.). For ports
that don't have a platform level color space type, a builtin PlatformColorSpace
type is provided that is just the old enum renamed to PlatformColorSpace::Name.

The goal of this change is to unify the currently bifurcated concept of an
ImageBuffer's color space, which previosly could either be based on the
DestinationColorSpace (and reflected in the colorSpace() member function),
or (for CG ports) based on a CGColorSpaceRef, with the colorSpace() function
returning sRGB even if the ImageBuffer was not.

* Headers.cmake:
* Modules/async-clipboard/ClipboardItemBindingsDataSource.cpp:
(WebCore::ClipboardItemBindingsDataSource::ClipboardItemTypeLoader::sanitizeDataIfNeeded):
* Modules/mediasession/MediaMetadata.cpp:
(WebCore::ArtworkImageLoader::notifyFinished):
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneSerializer::dumpImageBitmap):
(WebCore::CloneDeserializer::readImageBitmap):
* css/CSSFilterImageValue.cpp:
(WebCore::CSSFilterImageValue::image):
* html/CustomPaintCanvas.cpp:
(WebCore::CustomPaintCanvas::copiedImage const):
* html/CustomPaintImage.cpp:
(WebCore::CustomPaintImage::drawPattern):
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::toMediaSample):
(WebCore::HTMLCanvasElement::createImageBuffer const):
* html/HTMLVideoElement.cpp:
(WebCore::HTMLVideoElement::createBufferForPainting const):
* html/HTMLVideoElement.h:
* html/ImageBitmap.cpp:
(WebCore::ImageBitmap::createImageBuffer):
(WebCore::ImageBitmap::createPromise):
* html/OffscreenCanvas.cpp:
(WebCore::OffscreenCanvas::commitToPlaceholderCanvas):
* html/canvas/CanvasRenderingContext.cpp:
(WebCore::CanvasRenderingContext::colorSpace const):
* html/canvas/CanvasRenderingContext.h:
* html/canvas/CanvasRenderingContext2D.cpp:
* html/canvas/ImageBitmapRenderingContext.cpp:
(WebCore::ImageBitmapRenderingContext::setOutputBitmap):
* html/canvas/PredefinedColorSpace.cpp:
(WebCore::toDestinationColorSpace):
(WebCore::toPredefinedColorSpace):
* html/canvas/PredefinedColorSpace.h:
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::LRUImageBufferCache::imageBuffer):
* html/shadow/MediaControlTextTrackContainerElement.cpp:
(WebCore::MediaControlTextTrackContainerElement::createTextTrackRepresentationImage):
* inspector/InspectorCanvas.cpp:
(WebCore::InspectorCanvas::indexForData):
(WebCore::InspectorCanvas::buildArrayForCanvasPattern):
* page/Chrome.cpp:
(WebCore::Chrome::createImageBuffer const):
* page/Chrome.h:
* page/ChromeClient.h:
(WebCore::ChromeClient::createImageBuffer const):
* page/FrameSnapshotting.cpp:
(WebCore::snapshotFrameRectWithClip):
* page/PageColorSampler.cpp:
(WebCore::sampleColor):
* page/PageConsoleClient.cpp:
(WebCore::PageConsoleClient::screenshot):
* platform/HostWindow.h:
* platform/PlatformColorSpace.h: Added.
(WebCore::PlatformColorSpace::get const):
* platform/PlatformScreen.h:
* platform/ScreenProperties.h:
(WebCore::ScreenProperties::encode const):
(WebCore::ScreenData::encode const):
(WebCore::ScreenData::decode):
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::preTransformedNativeImageForCurrentFrame):
(WebCore::BitmapImage::drawPattern):
* platform/graphics/Color.cpp:
(WebCore::Color::toColorComponentsInColorSpace const):
* platform/graphics/Color.h:
* platform/graphics/ColorConversion.cpp:
(WebCore::converColorComponents):
* platform/graphics/ColorConversion.h:
* platform/graphics/ColorSpace.cpp:
* platform/graphics/ColorSpace.h:
* platform/graphics/ConcreteImageBuffer.h:
(WebCore::ConcreteImageBuffer::create):
* platform/graphics/CrossfadeGeneratedImage.cpp:
(WebCore::CrossfadeGeneratedImage::drawPattern):
* platform/graphics/DestinationColorSpace.cpp: Added.
(WebCore::DestinationColorSpace::SRGB):
(WebCore::DestinationColorSpace::LinearSRGB):
(WebCore::DestinationColorSpace::DisplayP3):
(WebCore::DestinationColorSpace::DestinationColorSpace):
(WebCore::operator==):
(WebCore::operator!=):
(WebCore::operator<<):
* platform/graphics/DestinationColorSpace.h: Added.
(WebCore::DestinationColorSpace::platformColorSpace const):
(WebCore::DestinationColorSpace::encode const):
(WebCore::DestinationColorSpace::decode):
* platform/graphics/GradientImage.cpp:
(WebCore::GradientImage::drawPattern):
* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContext::clipToDrawingCommands):
* platform/graphics/GraphicsContext.h:
* platform/graphics/GraphicsContextImpl.h:
* platform/graphics/ImageBuffer.cpp:
(WebCore::ImageBuffer::create):
(WebCore::ImageBuffer::createCompatibleBuffer):
(WebCore::ImageBuffer::copyRectToBuffer):
* platform/graphics/ImageBuffer.h:
* platform/graphics/ImageBufferBackend.cpp:
(WebCore::ImageBufferBackend::getPixelBuffer const):
(WebCore::ImageBufferBackend::putPixelBuffer):
* platform/graphics/ImageBufferBackend.h:
(WebCore::ImageBufferBackend::transformColorSpace):
(WebCore::ImageBufferBackend::colorSpace const):
* platform/graphics/PixelBuffer.h:
(WebCore::PixelBuffer::decode):
* platform/graphics/PixelBufferConversion.cpp:
(WebCore::makeVImageCGImageFormat):
* platform/graphics/PixelBufferFormat.h:
(WebCore::PixelBufferFormat::decode):
* platform/graphics/RemoteVideoSample.cpp:
(WebCore::transferBGRAPixelBufferToIOSurface):
(WebCore::RemoteVideoSample::create):
(WebCore::RemoteVideoSample::RemoteVideoSample):
(WebCore::RemoteVideoSample::surface const):
* platform/graphics/RemoteVideoSample.h:
* platform/graphics/ShadowBlur.cpp:
(WebCore::ScratchBuffer::getScratchBuffer):
(WebCore::ShadowBlur::drawRectShadowWithoutTiling):
(WebCore::ShadowBlur::drawInsetShadowWithoutTiling):
(WebCore::ShadowBlur::drawRectShadowWithTiling):
(WebCore::ShadowBlur::drawInsetShadowWithTiling):
(WebCore::ShadowBlur::blurShadowBuffer):
(WebCore::ShadowBlur::drawShadowLayer):
* platform/graphics/angle/GraphicsContextGLANGLE.cpp:
(WebCore::GraphicsContextGLOpenGL::readPixelsForPaintResults):
* platform/graphics/cairo/ImageBufferCairoBackend.cpp:
(WebCore::ImageBufferCairoBackend::transformColorSpace):
* platform/graphics/cairo/ImageBufferCairoBackend.h:
* platform/graphics/cg/ColorCG.cpp:
(WebCore::convertToCGCompatibleComponents):
(WebCore::createCGColor):
(WebCore::platformConvertColorComponents):
* platform/graphics/cg/ColorSpaceCG.h:
(WebCore::cachedCGColorSpace): Deleted.
* platform/graphics/cg/GraphicsContextGLCG.cpp:
(WebCore::GraphicsContextGLOpenGL::paintToCanvas):
* platform/graphics/cg/IOSurfacePool.cpp:
(WebCore::surfaceMatchesParameters):
(WebCore::IOSurfacePool::takeSurface):
* platform/graphics/cg/IOSurfacePool.h:
* platform/graphics/cg/ImageBufferCGBackend.cpp:
(WebCore::createBitmapImageAfterScalingIfNeeded):
(WebCore::ImageBufferCGBackend::copyCGImageForEncoding const):
* platform/graphics/cg/ImageBufferCGBitmapBackend.cpp:
(WebCore::ImageBufferCGBitmapBackend::create):
(WebCore::ImageBufferCGBitmapBackend::copyNativeImage const):
* platform/graphics/cg/ImageBufferCGBitmapBackend.h:
* platform/graphics/cg/ImageBufferIOSurfaceBackend.cpp:
(WebCore::ImageBufferIOSurfaceBackend::create):
* platform/graphics/cg/ImageBufferIOSurfaceBackend.h:
* platform/graphics/cg/ImageBufferUtilitiesCG.cpp:
(WebCore::encode):
* platform/graphics/cg/NativeImageCG.cpp:
(WebCore::NativeImage::singlePixelSolidColor const):
* platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm:
(WebCore::GraphicsContextGLOpenGL::allocateAndBindDisplayBufferBacking):
* platform/graphics/cocoa/IOSurface.h:
* platform/graphics/cocoa/IOSurface.mm:
(WebCore::IOSurface::surfaceFromPool):
(WebCore::IOSurface::create):
(WebCore::IOSurface::createFromSendRight):
(WebCore::IOSurface::createFromSurface):
(WebCore::IOSurface::createFromImage):
(WebCore::IOSurface::createFromPixelBuffer):
(WebCore::IOSurface::IOSurface):
(WebCore::IOSurface::ensurePlatformContext):
(WebCore::IOSurface::migrateColorSpaceToProperties):
* platform/graphics/coreimage/FilterEffectRendererCoreImage.mm:
(WebCore::FilterEffectRendererCoreImage::renderToImageBuffer):
* platform/graphics/cv/ImageTransferSessionVT.mm:
(WebCore::ImageTransferSessionVT::createPixelBuffer):
* platform/graphics/cv/PixelBufferConformerCV.cpp:
(WebCore::PixelBufferConformerCV::createImageFromPixelBuffer):
* platform/graphics/displaylists/DisplayListImageBuffer.h:
(WebCore::DisplayList::ImageBuffer::create):
* platform/graphics/displaylists/DisplayListItemBuffer.cpp:
(WebCore::DisplayList::ItemHandle::destroy):
* platform/graphics/displaylists/DisplayListItems.h:
(WebCore::DisplayList::BeginClipToDrawingCommands::BeginClipToDrawingCommands):
(WebCore::DisplayList::BeginClipToDrawingCommands::colorSpace const):
(WebCore::DisplayList::BeginClipToDrawingCommands::encode const):
(WebCore::DisplayList::BeginClipToDrawingCommands::decode):
(WebCore::DisplayList::GetPixelBuffer::GetPixelBuffer):
(WebCore::DisplayList::GetPixelBuffer::outputFormat const):
(WebCore::DisplayList::GetPixelBuffer::encode const):
(WebCore::DisplayList::GetPixelBuffer::decode):
* platform/graphics/displaylists/DisplayListRecorder.cpp:
(WebCore::DisplayList::Recorder::clipToDrawingCommands):
* platform/graphics/displaylists/DisplayListRecorder.h:
* platform/graphics/filters/FEDisplacementMap.cpp:
(WebCore::FEDisplacementMap::setResultColorSpace):
* platform/graphics/filters/FEDisplacementMap.h:
* platform/graphics/filters/FEFlood.h:
* platform/graphics/filters/FETile.cpp:
(WebCore::FETile::platformApplySoftware):
* platform/graphics/filters/FilterEffect.cpp:
(WebCore::FilterEffect::convertPixelBufferToColorSpace):
(WebCore::FilterEffect::convertImageBufferToColorSpace):
(WebCore::FilterEffect::copyConvertedImageBufferToDestination):
(WebCore::FilterEffect::copyConvertedPixelBufferToDestination):
(WebCore::FilterEffect::requiresPixelBufferColorSpaceConversion):
(WebCore::FilterEffect::transformResultColorSpace):
* platform/graphics/filters/FilterEffect.h:
(WebCore::FilterEffect::operatingColorSpace const):
(WebCore::FilterEffect::setOperatingColorSpace):
(WebCore::FilterEffect::resultColorSpace const):
(WebCore::FilterEffect::setResultColorSpace):
* platform/graphics/filters/SourceGraphic.h:
(WebCore::SourceGraphic::SourceGraphic):
* platform/gtk/PlatformScreenGtk.cpp:
(WebCore::screenColorSpace):
* platform/ios/PlatformScreenIOS.mm:
(WebCore::screenColorSpace):
(WebCore::collectScreenProperties):
* platform/mac/PlatformScreenMac.mm:
(WebCore::collectScreenProperties):
(WebCore::screenColorSpace):
* platform/mac/ThemeMac.mm:
(WebCore::ThemeMac::drawCellOrFocusRingWithViewIntoContext):
* platform/mediastream/mac/ScreenDisplayCapturerMac.mm:
(WebCore::ScreenDisplayCapturerMac::createDisplayStream):
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::imageBuffer const):
* platform/playstation/PlatformScreenPlayStation.cpp:
(WebCore::screenColorSpace):
* platform/win/PlatformScreenWin.cpp:
(WebCore::screenColorSpace):
* platform/wpe/PlatformScreenWPE.cpp:
(WebCore::screenColorSpace):
* platform/xr/PlatformXR.h:
(PlatformXR::Device::FrameData::LayerData::decode):
* rendering/CSSFilter.cpp:
(WebCore::CSSFilter::buildReferenceFilter):
(WebCore::CSSFilter::build):
(WebCore::CSSFilter::allocateBackingStoreIfNeeded):
(WebCore::CSSFilter::apply):
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::paintFillLayerExtended):
* rendering/RenderLayerBacking.cpp:
(WebCore::patternForDescription):
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::paintSystemPreviewBadge):
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::paintProgressBar):
* rendering/shapes/Shape.cpp:
(WebCore::Shape::createRasterShape):
* rendering/svg/RenderSVGResourceClipper.cpp:
(WebCore::RenderSVGResourceClipper::applyClippingToContext):
* rendering/svg/RenderSVGResourceFilter.cpp:
(WebCore::RenderSVGResourceFilter::buildPrimitives const):
(WebCore::RenderSVGResourceFilter::applyResource):
(WebCore::RenderSVGResourceFilter::postApplyResource):
* rendering/svg/RenderSVGResourceGradient.cpp:
(WebCore::createMaskAndSwapContextForTextGradient):
* rendering/svg/RenderSVGResourceMasker.cpp:
(WebCore::RenderSVGResourceMasker::applyResource):
(WebCore::RenderSVGResourceMasker::drawContentIntoMaskImage):
* rendering/svg/RenderSVGResourceMasker.h:
* rendering/svg/RenderSVGResourcePattern.cpp:
(WebCore::RenderSVGResourcePattern::createTileImage const):
* rendering/svg/SVGRenderingContext.cpp:
(WebCore::SVGRenderingContext::createImageBuffer):
(WebCore::SVGRenderingContext::bufferForeground):
* rendering/svg/SVGRenderingContext.h:
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::nativeImage):
(WebCore::SVGImage::drawPatternForContainer):
* svg/graphics/filters/SVGFEImage.cpp:
(WebCore::FEImage::platformApplySoftware):

Source/WebCore/PAL:

* pal/spi/cg/CoreGraphicsSPI.h:
Add addional SPI for working with CGColorSpaceRefs.

Source/WebKit:

- Update ImageBuffer subclass signatures to use "const DestinationColorSpace&" to
  conform to the base class.
- Replace ColorSpaceData with Optional<DestinationColorSpace>. No reason to have two
  types that are the same.
- Give all ports a color space configuration for ShareableBitmap now that there is
  a common class for representing color space.
- Update DisplayList decoding to account for BeginClipToDrawingCommands and GetPixelBuffer
  no longer being inlineable due to now having non-trivial destructors due to
  DestinationColorSpace member.

* GPUProcess/graphics/RemoteImageBuffer.h:
(WebKit::RemoteImageBuffer::create):
* GPUProcess/graphics/RemoteRenderingBackend.cpp:
(WebKit::RemoteRenderingBackend::createImageBuffer):
* GPUProcess/graphics/RemoteRenderingBackend.h:
* GPUProcess/media/RemoteImageDecoderAVFProxy.cpp:
(WebKit::RemoteImageDecoderAVFProxy::createFrameImageAtIndex):
* GPUProcess/media/RemoteImageDecoderAVFProxy.h:
* GPUProcess/media/RemoteImageDecoderAVFProxy.messages.in:
* Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
(WebKit::RemoteLayerBackingStore::swapToValidFrontBuffer):
(WebKit::RemoteLayerBackingStore::applyBackingStoreToLayer):
* Shared/ShareableBitmap.cpp:
(WebKit::ShareableBitmap::Configuration::encode const):
(WebKit::ShareableBitmap::Configuration::decode):
* Shared/ShareableBitmap.h:
* Shared/WebCoreArgumentCoders.h:
* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
* Shared/cg/ShareableBitmapCG.cpp:
(WebKit::colorSpace):
* Shared/mac/ColorSpaceData.h: Removed.
* Shared/mac/ColorSpaceData.mm: Removed.
* SourcesCocoa.txt:
* UIProcess/API/ios/WKWebViewIOS.mm:
(-[WKWebView _takeViewSnapshot]):
(-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::colorSpace):
* UIProcess/PageClient.h:
* UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
(WebKit::recursivelyMapIOSurfaceBackingStore):
* UIProcess/WebPageProxy.h:
* UIProcess/mac/PageClientImplMac.h:
* UIProcess/mac/PageClientImplMac.mm:
(WebKit::PageClientImpl::colorSpace):
* UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::colorSpace):
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/GPU/graphics/ImageBufferShareableBitmapBackend.cpp:
(WebKit::ImageBufferShareableBitmapBackend::configuration):
* WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.cpp:
(WebKit::RemoteGraphicsContextGLProxy::prepareForDisplay):
* WebProcess/GPU/graphics/RemoteImageBufferProxy.h:
(WebKit::RemoteImageBufferProxy::create):
* WebProcess/GPU/graphics/RemoteRenderingBackendProxy.cpp:
(WebKit::RemoteRenderingBackendProxy::createImageBuffer):
* WebProcess/GPU/graphics/RemoteRenderingBackendProxy.h:
* WebProcess/GPU/graphics/cocoa/ImageBufferShareableMappedIOSurfaceBackend.cpp:
(WebKit::ImageBufferShareableMappedIOSurfaceBackend::create):
* WebProcess/GPU/media/RemoteImageDecoderAVF.cpp:
(WebKit::RemoteImageDecoderAVF::createFrameImageAtIndex):
* WebProcess/GPU/media/cocoa/MediaPlayerPrivateRemoteCocoa.mm:
(WebKit::MediaPlayerPrivateRemote::nativeImageForCurrentTime):
(WebKit::MediaPlayerPrivateRemote::pixelBufferForCurrentTime):
* WebProcess/Plugins/PDF/PDFPlugin.mm:
(WebKit::PDFPlugin::PDFPlugin):
* WebProcess/WebCoreSupport/ShareableBitmapUtilities.cpp:
(WebKit::createShareableBitmap):
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::createImageBuffer const):
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
(WebKit::convertDragImageToBitmap):
* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::setColorSpace):
* WebProcess/WebPage/DrawingArea.messages.in:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::snapshotOptionsToBitmapConfiguration):
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
(WebKit::TiledCoreAnimationDrawingArea::setColorSpace):

Source/WebKitLegacy/mac:

* WebCoreSupport/WebContextMenuClient.mm:
(WebContextMenuClient::imageForCurrentSharingServicePickerItem):
Update for new DestinationColorSpace class.

Tools:

* TestWebKitAPI/Tests/WebCore/cg/DisplayListTestsCG.cpp:
(TestWebKitAPI::TEST):
Upate test to use new DestinationColorSpace type.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreHeaderscmake">trunk/Source/WebCore/Headers.cmake</a></li>
<li><a href="#trunkSourceWebCoreModulesasyncclipboardClipboardItemBindingsDataSourcecpp">trunk/Source/WebCore/Modules/async-clipboard/ClipboardItemBindingsDataSource.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesmediasessionMediaMetadatacpp">trunk/Source/WebCore/Modules/mediasession/MediaMetadata.cpp</a></li>
<li><a href="#trunkSourceWebCorePALChangeLog">trunk/Source/WebCore/PAL/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorePALpalspicgCoreGraphicsSPIh">trunk/Source/WebCore/PAL/pal/spi/cg/CoreGraphicsSPI.h</a></li>
<li><a href="#trunkSourceWebCoreSourcestxt">trunk/Source/WebCore/Sources.txt</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorebindingsjsSerializedScriptValuecpp">trunk/Source/WebCore/bindings/js/SerializedScriptValue.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSFilterImageValuecpp">trunk/Source/WebCore/css/CSSFilterImageValue.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlCustomPaintCanvascpp">trunk/Source/WebCore/html/CustomPaintCanvas.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlCustomPaintImagecpp">trunk/Source/WebCore/html/CustomPaintImage.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLCanvasElementcpp">trunk/Source/WebCore/html/HTMLCanvasElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLVideoElementcpp">trunk/Source/WebCore/html/HTMLVideoElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLVideoElementh">trunk/Source/WebCore/html/HTMLVideoElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlImageBitmapcpp">trunk/Source/WebCore/html/ImageBitmap.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlOffscreenCanvascpp">trunk/Source/WebCore/html/OffscreenCanvas.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasCanvasRenderingContextcpp">trunk/Source/WebCore/html/canvas/CanvasRenderingContext.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasCanvasRenderingContexth">trunk/Source/WebCore/html/canvas/CanvasRenderingContext.h</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasCanvasRenderingContext2Dcpp">trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasImageBitmapRenderingContextcpp">trunk/Source/WebCore/html/canvas/ImageBitmapRenderingContext.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasPredefinedColorSpacecpp">trunk/Source/WebCore/html/canvas/PredefinedColorSpace.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasPredefinedColorSpaceh">trunk/Source/WebCore/html/canvas/PredefinedColorSpace.h</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasWebGLRenderingContextBasecpp">trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlshadowMediaControlTextTrackContainerElementcpp">trunk/Source/WebCore/html/shadow/MediaControlTextTrackContainerElement.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorCanvascpp">trunk/Source/WebCore/inspector/InspectorCanvas.cpp</a></li>
<li><a href="#trunkSourceWebCorepageChromecpp">trunk/Source/WebCore/page/Chrome.cpp</a></li>
<li><a href="#trunkSourceWebCorepageChromeh">trunk/Source/WebCore/page/Chrome.h</a></li>
<li><a href="#trunkSourceWebCorepageChromeClienth">trunk/Source/WebCore/page/ChromeClient.h</a></li>
<li><a href="#trunkSourceWebCorepageFrameSnapshottingcpp">trunk/Source/WebCore/page/FrameSnapshotting.cpp</a></li>
<li><a href="#trunkSourceWebCorepagePageColorSamplercpp">trunk/Source/WebCore/page/PageColorSampler.cpp</a></li>
<li><a href="#trunkSourceWebCorepagePageConsoleClientcpp">trunk/Source/WebCore/page/PageConsoleClient.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformHostWindowh">trunk/Source/WebCore/platform/HostWindow.h</a></li>
<li><a href="#trunkSourceWebCoreplatformPlatformScreenh">trunk/Source/WebCore/platform/PlatformScreen.h</a></li>
<li><a href="#trunkSourceWebCoreplatformScreenPropertiesh">trunk/Source/WebCore/platform/ScreenProperties.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsBitmapImagecpp">trunk/Source/WebCore/platform/graphics/BitmapImage.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsColorcpp">trunk/Source/WebCore/platform/graphics/Color.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsColorh">trunk/Source/WebCore/platform/graphics/Color.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsColorConversioncpp">trunk/Source/WebCore/platform/graphics/ColorConversion.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsColorConversionh">trunk/Source/WebCore/platform/graphics/ColorConversion.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsColorSpacecpp">trunk/Source/WebCore/platform/graphics/ColorSpace.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsColorSpaceh">trunk/Source/WebCore/platform/graphics/ColorSpace.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsConcreteImageBufferh">trunk/Source/WebCore/platform/graphics/ConcreteImageBuffer.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsCrossfadeGeneratedImagecpp">trunk/Source/WebCore/platform/graphics/CrossfadeGeneratedImage.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsGradientImagecpp">trunk/Source/WebCore/platform/graphics/GradientImage.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsGraphicsContextcpp">trunk/Source/WebCore/platform/graphics/GraphicsContext.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsGraphicsContexth">trunk/Source/WebCore/platform/graphics/GraphicsContext.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsGraphicsContextImplh">trunk/Source/WebCore/platform/graphics/GraphicsContextImpl.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsImageBuffercpp">trunk/Source/WebCore/platform/graphics/ImageBuffer.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsImageBufferh">trunk/Source/WebCore/platform/graphics/ImageBuffer.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsImageBufferBackendcpp">trunk/Source/WebCore/platform/graphics/ImageBufferBackend.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsImageBufferBackendh">trunk/Source/WebCore/platform/graphics/ImageBufferBackend.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsPixelBuffercpp">trunk/Source/WebCore/platform/graphics/PixelBuffer.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsPixelBufferh">trunk/Source/WebCore/platform/graphics/PixelBuffer.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsPixelBufferConversioncpp">trunk/Source/WebCore/platform/graphics/PixelBufferConversion.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsPixelBufferFormath">trunk/Source/WebCore/platform/graphics/PixelBufferFormat.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsRemoteVideoSamplecpp">trunk/Source/WebCore/platform/graphics/RemoteVideoSample.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsRemoteVideoSampleh">trunk/Source/WebCore/platform/graphics/RemoteVideoSample.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsShadowBlurcpp">trunk/Source/WebCore/platform/graphics/ShadowBlur.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsangleGraphicsContextGLANGLEcpp">trunk/Source/WebCore/platform/graphics/angle/GraphicsContextGLANGLE.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscairoGraphicsContextImplCairocpp">trunk/Source/WebCore/platform/graphics/cairo/GraphicsContextImplCairo.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscairoGraphicsContextImplCairoh">trunk/Source/WebCore/platform/graphics/cairo/GraphicsContextImplCairo.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscairoImageBufferCairoBackendcpp">trunk/Source/WebCore/platform/graphics/cairo/ImageBufferCairoBackend.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscairoImageBufferCairoBackendh">trunk/Source/WebCore/platform/graphics/cairo/ImageBufferCairoBackend.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscgColorCGcpp">trunk/Source/WebCore/platform/graphics/cg/ColorCG.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscgColorSpaceCGh">trunk/Source/WebCore/platform/graphics/cg/ColorSpaceCG.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscgGraphicsContextGLCGcpp">trunk/Source/WebCore/platform/graphics/cg/GraphicsContextGLCG.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscgIOSurfacePoolcpp">trunk/Source/WebCore/platform/graphics/cg/IOSurfacePool.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscgIOSurfacePoolh">trunk/Source/WebCore/platform/graphics/cg/IOSurfacePool.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscgImageBufferCGBackendcpp">trunk/Source/WebCore/platform/graphics/cg/ImageBufferCGBackend.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscgImageBufferCGBitmapBackendcpp">trunk/Source/WebCore/platform/graphics/cg/ImageBufferCGBitmapBackend.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscgImageBufferCGBitmapBackendh">trunk/Source/WebCore/platform/graphics/cg/ImageBufferCGBitmapBackend.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscgImageBufferIOSurfaceBackendcpp">trunk/Source/WebCore/platform/graphics/cg/ImageBufferIOSurfaceBackend.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscgImageBufferIOSurfaceBackendh">trunk/Source/WebCore/platform/graphics/cg/ImageBufferIOSurfaceBackend.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscgImageBufferUtilitiesCGcpp">trunk/Source/WebCore/platform/graphics/cg/ImageBufferUtilitiesCG.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscocoaGraphicsContextGLOpenGLCocoamm">trunk/Source/WebCore/platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscocoaIOSurfaceh">trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscocoaIOSurfacemm">trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscoreimageFilterEffectRendererCoreImagemm">trunk/Source/WebCore/platform/graphics/coreimage/FilterEffectRendererCoreImage.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsdisplaylistsDisplayListImageBufferh">trunk/Source/WebCore/platform/graphics/displaylists/DisplayListImageBuffer.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsdisplaylistsDisplayListItemBuffercpp">trunk/Source/WebCore/platform/graphics/displaylists/DisplayListItemBuffer.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsdisplaylistsDisplayListItemTypecpp">trunk/Source/WebCore/platform/graphics/displaylists/DisplayListItemType.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsdisplaylistsDisplayListItemsh">trunk/Source/WebCore/platform/graphics/displaylists/DisplayListItems.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsdisplaylistsDisplayListRecordercpp">trunk/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsdisplaylistsDisplayListRecorderh">trunk/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsfiltersFEDisplacementMapcpp">trunk/Source/WebCore/platform/graphics/filters/FEDisplacementMap.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsfiltersFEDisplacementMaph">trunk/Source/WebCore/platform/graphics/filters/FEDisplacementMap.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsfiltersFEFloodh">trunk/Source/WebCore/platform/graphics/filters/FEFlood.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsfiltersFETilecpp">trunk/Source/WebCore/platform/graphics/filters/FETile.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsfiltersFilterEffectcpp">trunk/Source/WebCore/platform/graphics/filters/FilterEffect.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsfiltersFilterEffecth">trunk/Source/WebCore/platform/graphics/filters/FilterEffect.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsfiltersSourceGraphich">trunk/Source/WebCore/platform/graphics/filters/SourceGraphic.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsnicosiacairoNicosiaCairoOperationRecordercpp">trunk/Source/WebCore/platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsnicosiacairoNicosiaCairoOperationRecorderh">trunk/Source/WebCore/platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsnicosiatexmapNicosiaGCGLLayercpp">trunk/Source/WebCore/platform/graphics/nicosia/texmap/NicosiaGCGLLayer.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsopenglGraphicsContextGLOpenGLBasecpp">trunk/Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGLBase.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsopenglGraphicsContextGLOpenGLEScpp">trunk/Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGLES.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicstexmapBitmapTexturecpp">trunk/Source/WebCore/platform/graphics/texmap/BitmapTexture.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgtkPlatformScreenGtkcpp">trunk/Source/WebCore/platform/gtk/PlatformScreenGtk.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformiosPlatformScreenIOSmm">trunk/Source/WebCore/platform/ios/PlatformScreenIOS.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformmacPlatformScreenMacmm">trunk/Source/WebCore/platform/mac/PlatformScreenMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformmacThemeMacmm">trunk/Source/WebCore/platform/mac/ThemeMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreamgstreamerMockRealtimeVideoSourceGStreamercpp">trunk/Source/WebCore/platform/mediastream/gstreamer/MockRealtimeVideoSourceGStreamer.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformmockMockRealtimeVideoSourcecpp">trunk/Source/WebCore/platform/mock/MockRealtimeVideoSource.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformplaystationPlatformScreenPlayStationcpp">trunk/Source/WebCore/platform/playstation/PlatformScreenPlayStation.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformwinPlatformScreenWincpp">trunk/Source/WebCore/platform/win/PlatformScreenWin.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformwpePlatformScreenWPEcpp">trunk/Source/WebCore/platform/wpe/PlatformScreenWPE.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformxrPlatformXRh">trunk/Source/WebCore/platform/xr/PlatformXR.h</a></li>
<li><a href="#trunkSourceWebCorerenderingCSSFiltercpp">trunk/Source/WebCore/rendering/CSSFilter.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBoxModelObjectcpp">trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLayerBackingcpp">trunk/Source/WebCore/rendering/RenderLayerBacking.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderThemeIOSmm">trunk/Source/WebCore/rendering/RenderThemeIOS.mm</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderThemeMacmm">trunk/Source/WebCore/rendering/RenderThemeMac.mm</a></li>
<li><a href="#trunkSourceWebCorerenderingshapesShapecpp">trunk/Source/WebCore/rendering/shapes/Shape.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgRenderSVGResourceClippercpp">trunk/Source/WebCore/rendering/svg/RenderSVGResourceClipper.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgRenderSVGResourceFiltercpp">trunk/Source/WebCore/rendering/svg/RenderSVGResourceFilter.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgRenderSVGResourceGradientcpp">trunk/Source/WebCore/rendering/svg/RenderSVGResourceGradient.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgRenderSVGResourceMaskercpp">trunk/Source/WebCore/rendering/svg/RenderSVGResourceMasker.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgRenderSVGResourceMaskerh">trunk/Source/WebCore/rendering/svg/RenderSVGResourceMasker.h</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgRenderSVGResourcePatterncpp">trunk/Source/WebCore/rendering/svg/RenderSVGResourcePattern.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgSVGRenderingContextcpp">trunk/Source/WebCore/rendering/svg/SVGRenderingContext.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgSVGRenderingContexth">trunk/Source/WebCore/rendering/svg/SVGRenderingContext.h</a></li>
<li><a href="#trunkSourceWebCoresvggraphicsSVGImagecpp">trunk/Source/WebCore/svg/graphics/SVGImage.cpp</a></li>
<li><a href="#trunkSourceWebCoresvggraphicsfiltersSVGFEImagecpp">trunk/Source/WebCore/svg/graphics/filters/SVGFEImage.cpp</a></li>
<li><a href="#trunkSourceWebKitChangeLog">trunk/Source/WebKit/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitGPUProcessgraphicsRemoteImageBufferh">trunk/Source/WebKit/GPUProcess/graphics/RemoteImageBuffer.h</a></li>
<li><a href="#trunkSourceWebKitGPUProcessgraphicsRemoteRenderingBackendcpp">trunk/Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.cpp</a></li>
<li><a href="#trunkSourceWebKitGPUProcessgraphicsRemoteRenderingBackendh">trunk/Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.h</a></li>
<li><a href="#trunkSourceWebKitGPUProcessmediaRemoteImageDecoderAVFProxycpp">trunk/Source/WebKit/GPUProcess/media/RemoteImageDecoderAVFProxy.cpp</a></li>
<li><a href="#trunkSourceWebKitGPUProcessmediaRemoteImageDecoderAVFProxyh">trunk/Source/WebKit/GPUProcess/media/RemoteImageDecoderAVFProxy.h</a></li>
<li><a href="#trunkSourceWebKitGPUProcessmediaRemoteImageDecoderAVFProxymessagesin">trunk/Source/WebKit/GPUProcess/media/RemoteImageDecoderAVFProxy.messages.in</a></li>
<li><a href="#trunkSourceWebKitSharedRemoteLayerTreeRemoteLayerBackingStoremm">trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.mm</a></li>
<li><a href="#trunkSourceWebKitSharedShareableBitmapcpp">trunk/Source/WebKit/Shared/ShareableBitmap.cpp</a></li>
<li><a href="#trunkSourceWebKitSharedShareableBitmaph">trunk/Source/WebKit/Shared/ShareableBitmap.h</a></li>
<li><a href="#trunkSourceWebKitSharedWebCoreArgumentCodersh">trunk/Source/WebKit/Shared/WebCoreArgumentCoders.h</a></li>
<li><a href="#trunkSourceWebKitSharedWebPageCreationParameterscpp">trunk/Source/WebKit/Shared/WebPageCreationParameters.cpp</a></li>
<li><a href="#trunkSourceWebKitSharedWebPageCreationParametersh">trunk/Source/WebKit/Shared/WebPageCreationParameters.h</a></li>
<li><a href="#trunkSourceWebKitSharedcgShareableBitmapCGcpp">trunk/Source/WebKit/Shared/cg/ShareableBitmapCG.cpp</a></li>
<li><a href="#trunkSourceWebKitSourcesCocoatxt">trunk/Source/WebKit/SourcesCocoa.txt</a></li>
<li><a href="#trunkSourceWebKitUIProcessAPIiosWKWebViewIOSmm">trunk/Source/WebKit/UIProcess/API/ios/WKWebViewIOS.mm</a></li>
<li><a href="#trunkSourceWebKitUIProcessCocoaWebViewImplh">trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.h</a></li>
<li><a href="#trunkSourceWebKitUIProcessCocoaWebViewImplmm">trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm</a></li>
<li><a href="#trunkSourceWebKitUIProcessPageClienth">trunk/Source/WebKit/UIProcess/PageClient.h</a></li>
<li><a href="#trunkSourceWebKitUIProcessRemoteLayerTreeRemoteLayerTreeHostmm">trunk/Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm</a></li>
<li><a href="#trunkSourceWebKitUIProcessWebPageProxyh">trunk/Source/WebKit/UIProcess/WebPageProxy.h</a></li>
<li><a href="#trunkSourceWebKitUIProcessmacPageClientImplMach">trunk/Source/WebKit/UIProcess/mac/PageClientImplMac.h</a></li>
<li><a href="#trunkSourceWebKitUIProcessmacPageClientImplMacmm">trunk/Source/WebKit/UIProcess/mac/PageClientImplMac.mm</a></li>
<li><a href="#trunkSourceWebKitUIProcessmacTiledCoreAnimationDrawingAreaProxymm">trunk/Source/WebKit/UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm</a></li>
<li><a href="#trunkSourceWebKitUIProcessmacWebPageProxyMacmm">trunk/Source/WebKit/UIProcess/mac/WebPageProxyMac.mm</a></li>
<li><a href="#trunkSourceWebKitWebKitxcodeprojprojectpbxproj">trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebKitWebProcessGPUgraphicsImageBufferShareableBitmapBackendcpp">trunk/Source/WebKit/WebProcess/GPU/graphics/ImageBufferShareableBitmapBackend.cpp</a></li>
<li><a href="#trunkSourceWebKitWebProcessGPUgraphicsRemoteGraphicsContextGLProxycpp">trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.cpp</a></li>
<li><a href="#trunkSourceWebKitWebProcessGPUgraphicsRemoteImageBufferProxyh">trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteImageBufferProxy.h</a></li>
<li><a href="#trunkSourceWebKitWebProcessGPUgraphicsRemoteRenderingBackendProxycpp">trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteRenderingBackendProxy.cpp</a></li>
<li><a href="#trunkSourceWebKitWebProcessGPUgraphicsRemoteRenderingBackendProxyh">trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteRenderingBackendProxy.h</a></li>
<li><a href="#trunkSourceWebKitWebProcessGPUgraphicscocoaImageBufferShareableMappedIOSurfaceBackendcpp">trunk/Source/WebKit/WebProcess/GPU/graphics/cocoa/ImageBufferShareableMappedIOSurfaceBackend.cpp</a></li>
<li><a href="#trunkSourceWebKitWebProcessGPUmediaRemoteImageDecoderAVFcpp">trunk/Source/WebKit/WebProcess/GPU/media/RemoteImageDecoderAVF.cpp</a></li>
<li><a href="#trunkSourceWebKitWebProcessGPUmediacocoaMediaPlayerPrivateRemoteCocoamm">trunk/Source/WebKit/WebProcess/GPU/media/cocoa/MediaPlayerPrivateRemoteCocoa.mm</a></li>
<li><a href="#trunkSourceWebKitWebProcessPluginsPDFPDFPluginmm">trunk/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebCoreSupportShareableBitmapUtilitiescpp">trunk/Source/WebKit/WebProcess/WebCoreSupport/ShareableBitmapUtilities.cpp</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebCoreSupportWebChromeClientcpp">trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebCoreSupportWebChromeClienth">trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebCoreSupportmacWebDragClientMacmm">trunk/Source/WebKit/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebPageDrawingAreah">trunk/Source/WebKit/WebProcess/WebPage/DrawingArea.h</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebPageDrawingAreamessagesin">trunk/Source/WebKit/WebProcess/WebPage/DrawingArea.messages.in</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebPageWebPagecpp">trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebPagemacTiledCoreAnimationDrawingAreah">trunk/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebPagemacTiledCoreAnimationDrawingAreamm">trunk/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm</a></li>
<li><a href="#trunkSourceWebKitLegacymacChangeLog">trunk/Source/WebKitLegacy/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitLegacymacWebCoreSupportWebContextMenuClientmm">trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebContextMenuClient.mm</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsDumpRenderTreeiosPixelDumpSupportIOSmm">trunk/Tools/DumpRenderTree/ios/PixelDumpSupportIOS.mm</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebCorecgDisplayListTestsCGcpp">trunk/Tools/TestWebKitAPI/Tests/WebCore/cg/DisplayListTestsCG.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreplatformgraphicsDestinationColorSpacecpp">trunk/Source/WebCore/platform/graphics/DestinationColorSpace.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsDestinationColorSpaceh">trunk/Source/WebCore/platform/graphics/DestinationColorSpace.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsPlatformColorSpaceh">trunk/Source/WebCore/platform/graphics/PlatformColorSpace.h</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebKitSharedmacColorSpaceDatah">trunk/Source/WebKit/Shared/mac/ColorSpaceData.h</a></li>
<li><a href="#trunkSourceWebKitSharedmacColorSpaceDatamm">trunk/Source/WebKit/Shared/mac/ColorSpaceData.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/ChangeLog      2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -1,3 +1,295 @@
</span><ins>+2021-05-24  Sam Weinig  <weinig@apple.com>
+
+        Convert DestinationColorSpace from an enum to class wrapping a platform color space (CGColorSpaceRef for CG ports, etc.)
+        https://bugs.webkit.org/show_bug.cgi?id=226143
+
+        Reviewed by Darin Adler.
+
+        Replace enumeration based DestinationColorSpace with a struct wrapping
+        a platform color space (CGColorSpaceRef for CG ports, etc.). For ports
+        that don't have a platform level color space type, a builtin PlatformColorSpace
+        type is provided that is just the old enum renamed to PlatformColorSpace::Name.
+
+        The goal of this change is to unify the currently bifurcated concept of an
+        ImageBuffer's color space, which previosly could either be based on the 
+        DestinationColorSpace (and reflected in the colorSpace() member function),
+        or (for CG ports) based on a CGColorSpaceRef, with the colorSpace() function
+        returning sRGB even if the ImageBuffer was not. 
+
+        * Headers.cmake:
+        * Modules/async-clipboard/ClipboardItemBindingsDataSource.cpp:
+        (WebCore::ClipboardItemBindingsDataSource::ClipboardItemTypeLoader::sanitizeDataIfNeeded):
+        * Modules/mediasession/MediaMetadata.cpp:
+        (WebCore::ArtworkImageLoader::notifyFinished):
+        * Sources.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/SerializedScriptValue.cpp:
+        (WebCore::CloneSerializer::dumpImageBitmap):
+        (WebCore::CloneDeserializer::readImageBitmap):
+        * css/CSSFilterImageValue.cpp:
+        (WebCore::CSSFilterImageValue::image):
+        * html/CustomPaintCanvas.cpp:
+        (WebCore::CustomPaintCanvas::copiedImage const):
+        * html/CustomPaintImage.cpp:
+        (WebCore::CustomPaintImage::drawPattern):
+        * html/HTMLCanvasElement.cpp:
+        (WebCore::HTMLCanvasElement::toMediaSample):
+        (WebCore::HTMLCanvasElement::createImageBuffer const):
+        * html/HTMLVideoElement.cpp:
+        (WebCore::HTMLVideoElement::createBufferForPainting const):
+        * html/HTMLVideoElement.h:
+        * html/ImageBitmap.cpp:
+        (WebCore::ImageBitmap::createImageBuffer):
+        (WebCore::ImageBitmap::createPromise):
+        * html/OffscreenCanvas.cpp:
+        (WebCore::OffscreenCanvas::commitToPlaceholderCanvas):
+        * html/canvas/CanvasRenderingContext.cpp:
+        (WebCore::CanvasRenderingContext::colorSpace const):
+        * html/canvas/CanvasRenderingContext.h:
+        * html/canvas/CanvasRenderingContext2D.cpp:
+        * html/canvas/ImageBitmapRenderingContext.cpp:
+        (WebCore::ImageBitmapRenderingContext::setOutputBitmap):
+        * html/canvas/PredefinedColorSpace.cpp:
+        (WebCore::toDestinationColorSpace):
+        (WebCore::toPredefinedColorSpace):
+        * html/canvas/PredefinedColorSpace.h:
+        * html/canvas/WebGLRenderingContextBase.cpp:
+        (WebCore::WebGLRenderingContextBase::LRUImageBufferCache::imageBuffer):
+        * html/shadow/MediaControlTextTrackContainerElement.cpp:
+        (WebCore::MediaControlTextTrackContainerElement::createTextTrackRepresentationImage):
+        * inspector/InspectorCanvas.cpp:
+        (WebCore::InspectorCanvas::indexForData):
+        (WebCore::InspectorCanvas::buildArrayForCanvasPattern):
+        * page/Chrome.cpp:
+        (WebCore::Chrome::createImageBuffer const):
+        * page/Chrome.h:
+        * page/ChromeClient.h:
+        (WebCore::ChromeClient::createImageBuffer const):
+        * page/FrameSnapshotting.cpp:
+        (WebCore::snapshotFrameRectWithClip):
+        * page/PageColorSampler.cpp:
+        (WebCore::sampleColor):
+        * page/PageConsoleClient.cpp:
+        (WebCore::PageConsoleClient::screenshot):
+        * platform/HostWindow.h:
+        * platform/PlatformColorSpace.h: Added.
+        (WebCore::PlatformColorSpace::get const):
+        * platform/PlatformScreen.h:
+        * platform/ScreenProperties.h:
+        (WebCore::ScreenProperties::encode const):
+        (WebCore::ScreenData::encode const):
+        (WebCore::ScreenData::decode):
+        * platform/graphics/BitmapImage.cpp:
+        (WebCore::BitmapImage::preTransformedNativeImageForCurrentFrame):
+        (WebCore::BitmapImage::drawPattern):
+        * platform/graphics/Color.cpp:
+        (WebCore::Color::toColorComponentsInColorSpace const):
+        * platform/graphics/Color.h:
+        * platform/graphics/ColorConversion.cpp:
+        (WebCore::converColorComponents):
+        * platform/graphics/ColorConversion.h:
+        * platform/graphics/ColorSpace.cpp:
+        * platform/graphics/ColorSpace.h:
+        * platform/graphics/ConcreteImageBuffer.h:
+        (WebCore::ConcreteImageBuffer::create):
+        * platform/graphics/CrossfadeGeneratedImage.cpp:
+        (WebCore::CrossfadeGeneratedImage::drawPattern):
+        * platform/graphics/DestinationColorSpace.cpp: Added.
+        (WebCore::DestinationColorSpace::SRGB):
+        (WebCore::DestinationColorSpace::LinearSRGB):
+        (WebCore::DestinationColorSpace::DisplayP3):
+        (WebCore::DestinationColorSpace::DestinationColorSpace):
+        (WebCore::operator==):
+        (WebCore::operator!=):
+        (WebCore::operator<<):
+        * platform/graphics/DestinationColorSpace.h: Added.
+        (WebCore::DestinationColorSpace::platformColorSpace const):
+        (WebCore::DestinationColorSpace::encode const):
+        (WebCore::DestinationColorSpace::decode):
+        * platform/graphics/GradientImage.cpp:
+        (WebCore::GradientImage::drawPattern):
+        * platform/graphics/GraphicsContext.cpp:
+        (WebCore::GraphicsContext::clipToDrawingCommands):
+        * platform/graphics/GraphicsContext.h:
+        * platform/graphics/GraphicsContextImpl.h:
+        * platform/graphics/ImageBuffer.cpp:
+        (WebCore::ImageBuffer::create):
+        (WebCore::ImageBuffer::createCompatibleBuffer):
+        (WebCore::ImageBuffer::copyRectToBuffer):
+        * platform/graphics/ImageBuffer.h:
+        * platform/graphics/ImageBufferBackend.cpp:
+        (WebCore::ImageBufferBackend::getPixelBuffer const):
+        (WebCore::ImageBufferBackend::putPixelBuffer):
+        * platform/graphics/ImageBufferBackend.h:
+        (WebCore::ImageBufferBackend::transformColorSpace):
+        (WebCore::ImageBufferBackend::colorSpace const):
+        * platform/graphics/PixelBuffer.h:
+        (WebCore::PixelBuffer::decode):
+        * platform/graphics/PixelBufferConversion.cpp:
+        (WebCore::makeVImageCGImageFormat):
+        * platform/graphics/PixelBufferFormat.h:
+        (WebCore::PixelBufferFormat::decode):
+        * platform/graphics/RemoteVideoSample.cpp:
+        (WebCore::transferBGRAPixelBufferToIOSurface):
+        (WebCore::RemoteVideoSample::create):
+        (WebCore::RemoteVideoSample::RemoteVideoSample):
+        (WebCore::RemoteVideoSample::surface const):
+        * platform/graphics/RemoteVideoSample.h:
+        * platform/graphics/ShadowBlur.cpp:
+        (WebCore::ScratchBuffer::getScratchBuffer):
+        (WebCore::ShadowBlur::drawRectShadowWithoutTiling):
+        (WebCore::ShadowBlur::drawInsetShadowWithoutTiling):
+        (WebCore::ShadowBlur::drawRectShadowWithTiling):
+        (WebCore::ShadowBlur::drawInsetShadowWithTiling):
+        (WebCore::ShadowBlur::blurShadowBuffer):
+        (WebCore::ShadowBlur::drawShadowLayer):
+        * platform/graphics/angle/GraphicsContextGLANGLE.cpp:
+        (WebCore::GraphicsContextGLOpenGL::readPixelsForPaintResults):
+        * platform/graphics/cairo/ImageBufferCairoBackend.cpp:
+        (WebCore::ImageBufferCairoBackend::transformColorSpace):
+        * platform/graphics/cairo/ImageBufferCairoBackend.h:
+        * platform/graphics/cg/ColorCG.cpp:
+        (WebCore::convertToCGCompatibleComponents):
+        (WebCore::createCGColor):
+        (WebCore::platformConvertColorComponents):
+        * platform/graphics/cg/ColorSpaceCG.h:
+        (WebCore::cachedCGColorSpace): Deleted.
+        * platform/graphics/cg/GraphicsContextGLCG.cpp:
+        (WebCore::GraphicsContextGLOpenGL::paintToCanvas):
+        * platform/graphics/cg/IOSurfacePool.cpp:
+        (WebCore::surfaceMatchesParameters):
+        (WebCore::IOSurfacePool::takeSurface):
+        * platform/graphics/cg/IOSurfacePool.h:
+        * platform/graphics/cg/ImageBufferCGBackend.cpp:
+        (WebCore::createBitmapImageAfterScalingIfNeeded):
+        (WebCore::ImageBufferCGBackend::copyCGImageForEncoding const):
+        * platform/graphics/cg/ImageBufferCGBitmapBackend.cpp:
+        (WebCore::ImageBufferCGBitmapBackend::create):
+        (WebCore::ImageBufferCGBitmapBackend::copyNativeImage const):
+        * platform/graphics/cg/ImageBufferCGBitmapBackend.h:
+        * platform/graphics/cg/ImageBufferIOSurfaceBackend.cpp:
+        (WebCore::ImageBufferIOSurfaceBackend::create):
+        * platform/graphics/cg/ImageBufferIOSurfaceBackend.h:
+        * platform/graphics/cg/ImageBufferUtilitiesCG.cpp:
+        (WebCore::encode):
+        * platform/graphics/cg/NativeImageCG.cpp:
+        (WebCore::NativeImage::singlePixelSolidColor const):
+        * platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm:
+        (WebCore::GraphicsContextGLOpenGL::allocateAndBindDisplayBufferBacking):
+        * platform/graphics/cocoa/IOSurface.h:
+        * platform/graphics/cocoa/IOSurface.mm:
+        (WebCore::IOSurface::surfaceFromPool):
+        (WebCore::IOSurface::create):
+        (WebCore::IOSurface::createFromSendRight):
+        (WebCore::IOSurface::createFromSurface):
+        (WebCore::IOSurface::createFromImage):
+        (WebCore::IOSurface::createFromPixelBuffer):
+        (WebCore::IOSurface::IOSurface):
+        (WebCore::IOSurface::ensurePlatformContext):
+        (WebCore::IOSurface::migrateColorSpaceToProperties):
+        * platform/graphics/coreimage/FilterEffectRendererCoreImage.mm:
+        (WebCore::FilterEffectRendererCoreImage::renderToImageBuffer):
+        * platform/graphics/cv/ImageTransferSessionVT.mm:
+        (WebCore::ImageTransferSessionVT::createPixelBuffer):
+        * platform/graphics/cv/PixelBufferConformerCV.cpp:
+        (WebCore::PixelBufferConformerCV::createImageFromPixelBuffer):
+        * platform/graphics/displaylists/DisplayListImageBuffer.h:
+        (WebCore::DisplayList::ImageBuffer::create):
+        * platform/graphics/displaylists/DisplayListItemBuffer.cpp:
+        (WebCore::DisplayList::ItemHandle::destroy):
+        * platform/graphics/displaylists/DisplayListItems.h:
+        (WebCore::DisplayList::BeginClipToDrawingCommands::BeginClipToDrawingCommands):
+        (WebCore::DisplayList::BeginClipToDrawingCommands::colorSpace const):
+        (WebCore::DisplayList::BeginClipToDrawingCommands::encode const):
+        (WebCore::DisplayList::BeginClipToDrawingCommands::decode):
+        (WebCore::DisplayList::GetPixelBuffer::GetPixelBuffer):
+        (WebCore::DisplayList::GetPixelBuffer::outputFormat const):
+        (WebCore::DisplayList::GetPixelBuffer::encode const):
+        (WebCore::DisplayList::GetPixelBuffer::decode):
+        * platform/graphics/displaylists/DisplayListRecorder.cpp:
+        (WebCore::DisplayList::Recorder::clipToDrawingCommands):
+        * platform/graphics/displaylists/DisplayListRecorder.h:
+        * platform/graphics/filters/FEDisplacementMap.cpp:
+        (WebCore::FEDisplacementMap::setResultColorSpace):
+        * platform/graphics/filters/FEDisplacementMap.h:
+        * platform/graphics/filters/FEFlood.h:
+        * platform/graphics/filters/FETile.cpp:
+        (WebCore::FETile::platformApplySoftware):
+        * platform/graphics/filters/FilterEffect.cpp:
+        (WebCore::FilterEffect::convertPixelBufferToColorSpace):
+        (WebCore::FilterEffect::convertImageBufferToColorSpace):
+        (WebCore::FilterEffect::copyConvertedImageBufferToDestination):
+        (WebCore::FilterEffect::copyConvertedPixelBufferToDestination):
+        (WebCore::FilterEffect::requiresPixelBufferColorSpaceConversion):
+        (WebCore::FilterEffect::transformResultColorSpace):
+        * platform/graphics/filters/FilterEffect.h:
+        (WebCore::FilterEffect::operatingColorSpace const):
+        (WebCore::FilterEffect::setOperatingColorSpace):
+        (WebCore::FilterEffect::resultColorSpace const):
+        (WebCore::FilterEffect::setResultColorSpace):
+        * platform/graphics/filters/SourceGraphic.h:
+        (WebCore::SourceGraphic::SourceGraphic):
+        * platform/gtk/PlatformScreenGtk.cpp:
+        (WebCore::screenColorSpace):
+        * platform/ios/PlatformScreenIOS.mm:
+        (WebCore::screenColorSpace):
+        (WebCore::collectScreenProperties):
+        * platform/mac/PlatformScreenMac.mm:
+        (WebCore::collectScreenProperties):
+        (WebCore::screenColorSpace):
+        * platform/mac/ThemeMac.mm:
+        (WebCore::ThemeMac::drawCellOrFocusRingWithViewIntoContext):
+        * platform/mediastream/mac/ScreenDisplayCapturerMac.mm:
+        (WebCore::ScreenDisplayCapturerMac::createDisplayStream):
+        * platform/mock/MockRealtimeVideoSource.cpp:
+        (WebCore::MockRealtimeVideoSource::imageBuffer const):
+        * platform/playstation/PlatformScreenPlayStation.cpp:
+        (WebCore::screenColorSpace):
+        * platform/win/PlatformScreenWin.cpp:
+        (WebCore::screenColorSpace):
+        * platform/wpe/PlatformScreenWPE.cpp:
+        (WebCore::screenColorSpace):
+        * platform/xr/PlatformXR.h:
+        (PlatformXR::Device::FrameData::LayerData::decode):
+        * rendering/CSSFilter.cpp:
+        (WebCore::CSSFilter::buildReferenceFilter):
+        (WebCore::CSSFilter::build):
+        (WebCore::CSSFilter::allocateBackingStoreIfNeeded):
+        (WebCore::CSSFilter::apply):
+        * rendering/RenderBoxModelObject.cpp:
+        (WebCore::RenderBoxModelObject::paintFillLayerExtended):
+        * rendering/RenderLayerBacking.cpp:
+        (WebCore::patternForDescription):
+        * rendering/RenderThemeIOS.mm:
+        (WebCore::RenderThemeIOS::paintSystemPreviewBadge):
+        * rendering/RenderThemeMac.mm:
+        (WebCore::RenderThemeMac::paintProgressBar):
+        * rendering/shapes/Shape.cpp:
+        (WebCore::Shape::createRasterShape):
+        * rendering/svg/RenderSVGResourceClipper.cpp:
+        (WebCore::RenderSVGResourceClipper::applyClippingToContext):
+        * rendering/svg/RenderSVGResourceFilter.cpp:
+        (WebCore::RenderSVGResourceFilter::buildPrimitives const):
+        (WebCore::RenderSVGResourceFilter::applyResource):
+        (WebCore::RenderSVGResourceFilter::postApplyResource):
+        * rendering/svg/RenderSVGResourceGradient.cpp:
+        (WebCore::createMaskAndSwapContextForTextGradient):
+        * rendering/svg/RenderSVGResourceMasker.cpp:
+        (WebCore::RenderSVGResourceMasker::applyResource):
+        (WebCore::RenderSVGResourceMasker::drawContentIntoMaskImage):
+        * rendering/svg/RenderSVGResourceMasker.h:
+        * rendering/svg/RenderSVGResourcePattern.cpp:
+        (WebCore::RenderSVGResourcePattern::createTileImage const):
+        * rendering/svg/SVGRenderingContext.cpp:
+        (WebCore::SVGRenderingContext::createImageBuffer):
+        (WebCore::SVGRenderingContext::bufferForeground):
+        * rendering/svg/SVGRenderingContext.h:
+        * svg/graphics/SVGImage.cpp:
+        (WebCore::SVGImage::nativeImage):
+        (WebCore::SVGImage::drawPatternForContainer):
+        * svg/graphics/filters/SVGFEImage.cpp:
+        (WebCore::FEImage::platformApplySoftware):
+
</ins><span class="cx"> 2021-05-24  Alan Bujtas  <zalan@apple.com>
</span><span class="cx"> 
</span><span class="cx">         [LFC] Add support for geometry/quirks virtual functions
</span></span></pre></div>
<a id="trunkSourceWebCoreHeaderscmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Headers.cmake (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Headers.cmake       2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/Headers.cmake  2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -1197,6 +1197,7 @@
</span><span class="cx">     platform/graphics/ConcreteImageBuffer.h
</span><span class="cx">     platform/graphics/DashArray.h
</span><span class="cx">     platform/graphics/DecodingOptions.h
</span><ins>+    platform/graphics/DestinationColorSpace.h
</ins><span class="cx">     platform/graphics/DisplayRefreshMonitor.h
</span><span class="cx">     platform/graphics/DisplayRefreshMonitorClient.h
</span><span class="cx">     platform/graphics/DisplayRefreshMonitorFactory.h
</span><span class="lines">@@ -1293,6 +1294,7 @@
</span><span class="cx">     platform/graphics/PixelBuffer.h
</span><span class="cx">     platform/graphics/PixelBufferFormat.h
</span><span class="cx">     platform/graphics/PixelFormat.h
</span><ins>+    platform/graphics/PlatformColorSpace.h
</ins><span class="cx">     platform/graphics/PlatformDisplay.h
</span><span class="cx">     platform/graphics/PlatformImage.h
</span><span class="cx">     platform/graphics/PlatformImageBuffer.h
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesasyncclipboardClipboardItemBindingsDataSourcecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/async-clipboard/ClipboardItemBindingsDataSource.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/async-clipboard/ClipboardItemBindingsDataSource.cpp 2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/Modules/async-clipboard/ClipboardItemBindingsDataSource.cpp    2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -285,7 +285,7 @@
</span><span class="cx"> 
</span><span class="cx">         auto bitmapImage = BitmapImage::create();
</span><span class="cx">         bitmapImage->setData(WTFMove(bufferToSanitize), true);
</span><del>-        auto imageBuffer = ImageBuffer::create(bitmapImage->size(), RenderingMode::Unaccelerated, 1, DestinationColorSpace::SRGB, PixelFormat::BGRA8);
</del><ins>+        auto imageBuffer = ImageBuffer::create(bitmapImage->size(), RenderingMode::Unaccelerated, 1, DestinationColorSpace::SRGB(), PixelFormat::BGRA8);
</ins><span class="cx">         if (!imageBuffer) {
</span><span class="cx">             m_data = { nullString() };
</span><span class="cx">             return;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediasessionMediaMetadatacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediasession/MediaMetadata.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediasession/MediaMetadata.cpp      2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/Modules/mediasession/MediaMetadata.cpp 2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -80,7 +80,7 @@
</span><span class="cx">     RefPtr<SharedBuffer> bufferToSanitize = m_cachedImage->image()->data();
</span><span class="cx">     auto bitmapImage = BitmapImage::create();
</span><span class="cx">     bitmapImage->setData(WTFMove(bufferToSanitize), true);
</span><del>-    auto imageBuffer = ImageBuffer::create(bitmapImage->size(), RenderingMode::Unaccelerated, 1, DestinationColorSpace::SRGB, PixelFormat::BGRA8);
</del><ins>+    auto imageBuffer = ImageBuffer::create(bitmapImage->size(), RenderingMode::Unaccelerated, 1, DestinationColorSpace::SRGB(), PixelFormat::BGRA8);
</ins><span class="cx">     if (!imageBuffer) {
</span><span class="cx">         m_callback(nullptr);
</span><span class="cx">         return;
</span></span></pre></div>
<a id="trunkSourceWebCorePALChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/PAL/ChangeLog (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/PAL/ChangeLog       2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/PAL/ChangeLog  2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2021-05-24  Sam Weinig  <weinig@apple.com>
+
+        Convert DestinationColorSpace from an enum to class wrapping a platform color space (CGColorSpaceRef for CG ports, etc.)
+        https://bugs.webkit.org/show_bug.cgi?id=226143
+
+        Reviewed by Darin Adler.
+
+        * pal/spi/cg/CoreGraphicsSPI.h:
+        Add addional SPI for working with CGColorSpaceRefs.
+
</ins><span class="cx"> 2021-05-24  Chris Fleizach  <cfleizach@apple.com>
</span><span class="cx"> 
</span><span class="cx">         AX: Settings: Increase contrast isn't detected in browser until an additional setting is applied
</span></span></pre></div>
<a id="trunkSourceWebCorePALpalspicgCoreGraphicsSPIh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/PAL/pal/spi/cg/CoreGraphicsSPI.h (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/PAL/pal/spi/cg/CoreGraphicsSPI.h    2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/PAL/pal/spi/cg/CoreGraphicsSPI.h       2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -242,6 +242,7 @@
</span><span class="cx"> 
</span><span class="cx"> WTF_EXTERN_C_BEGIN
</span><span class="cx"> 
</span><ins>+bool CGColorTransformConvertColorComponents(CGColorTransformRef, CGColorSpaceRef, CGColorRenderingIntent, const CGFloat srcComponents[], CGFloat dstComponents[]);
</ins><span class="cx"> CGColorRef CGColorTransformConvertColor(CGColorTransformRef, CGColorRef, CGColorRenderingIntent);
</span><span class="cx"> CGColorTransformRef CGColorTransformCreate(CGColorSpaceRef, CFDictionaryRef attributes);
</span><span class="cx"> 
</span><span class="lines">@@ -291,6 +292,8 @@
</span><span class="cx"> CGStyleType CGStyleGetType(CGStyleRef);
</span><span class="cx"> const void *CGStyleGetData(CGStyleRef);
</span><span class="cx"> CGColorRef CGStyleGetColor(CGStyleRef);
</span><ins>+bool CGColorSpaceEqualToColorSpace(CGColorSpaceRef, CGColorSpaceRef);
+CFStringRef CGColorSpaceCopyICCProfileDescription(CGColorSpaceRef);
</ins><span class="cx"> 
</span><span class="cx"> #if HAVE(CGPATH_GET_NUMBER_OF_ELEMENTS)
</span><span class="cx"> size_t CGPathGetNumberOfElements(CGPathRef);
</span></span></pre></div>
<a id="trunkSourceWebCoreSourcestxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Sources.txt (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Sources.txt 2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/Sources.txt    2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -1950,6 +1950,7 @@
</span><span class="cx"> platform/graphics/ColorUtilities.cpp
</span><span class="cx"> platform/graphics/ComplexTextController.cpp
</span><span class="cx"> platform/graphics/CrossfadeGeneratedImage.cpp
</span><ins>+platform/graphics/DestinationColorSpace.cpp
</ins><span class="cx"> platform/graphics/DisplayRefreshMonitor.cpp
</span><span class="cx"> platform/graphics/DisplayRefreshMonitorClient.cpp
</span><span class="cx"> platform/graphics/DisplayRefreshMonitorManager.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj   2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj      2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -3996,6 +3996,7 @@
</span><span class="cx">          BC23F0DB0DAFF4A4009FDC91 /* GeneratedImage.h in Headers */ = {isa = PBXBuildFile; fileRef = BC23F0DA0DAFF4A4009FDC91 /* GeneratedImage.h */; };
</span><span class="cx">          BC274B2F140EBEB200EADFA6 /* CSSBorderImageSliceValue.h in Headers */ = {isa = PBXBuildFile; fileRef = BC274B2E140EBEB200EADFA6 /* CSSBorderImageSliceValue.h */; };
</span><span class="cx">          BC2CBF4E140F1ABD003879BE /* JSWebGLContextEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = BC2CBF4B140F1A65003879BE /* JSWebGLContextEvent.h */; };
</span><ins>+               BC2CCA102655DDB200B8C035 /* DestinationColorSpace.h in Headers */ = {isa = PBXBuildFile; fileRef = BC2CCA0E2655DDB200B8C035 /* DestinationColorSpace.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">           BC305C7A0C076BB300CD20F0 /* JSHTMLObjectElement.h in Headers */ = {isa = PBXBuildFile; fileRef = BC305C780C076BB300CD20F0 /* JSHTMLObjectElement.h */; };
</span><span class="cx">          BC348BD40DB7F804004ABAB9 /* JSXMLHttpRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = BC348BD20DB7F804004ABAB9 /* JSXMLHttpRequest.h */; };
</span><span class="cx">          BC348BD40DB7F804004ABABA /* WebCoreJSBuiltins.h in Headers */ = {isa = PBXBuildFile; fileRef = BC348BD20DB7F804004ABABA /* WebCoreJSBuiltins.h */; };
</span><span class="lines">@@ -4007,6 +4008,7 @@
</span><span class="cx">          BC3BE9990E9C1E5D00835588 /* RenderScrollbarTheme.h in Headers */ = {isa = PBXBuildFile; fileRef = BC3BE9980E9C1E5D00835588 /* RenderScrollbarTheme.h */; };
</span><span class="cx">          BC3C39B70C0D3D8D005F4D7A /* JSMediaList.h in Headers */ = {isa = PBXBuildFile; fileRef = BC3C39B50C0D3D8D005F4D7A /* JSMediaList.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          BC3D85BC1C0E2E7A00D3B610 /* JSHTMLPictureElement.h in Headers */ = {isa = PBXBuildFile; fileRef = BC808B131C0E2B350066FD6B /* JSHTMLPictureElement.h */; };
</span><ins>+               BC3E62432659791800548ACD /* PlatformColorSpace.h in Headers */ = {isa = PBXBuildFile; fileRef = BC3E62422659791700548ACD /* PlatformColorSpace.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">           BC4368E80C226E32005EFB5F /* Rect.h in Headers */ = {isa = PBXBuildFile; fileRef = BC4368E70C226E32005EFB5F /* Rect.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          BC46C1FD0C0DDC8F0020CFC3 /* JSCSSFontFaceRule.h in Headers */ = {isa = PBXBuildFile; fileRef = BC46C1F30C0DDC8F0020CFC3 /* JSCSSFontFaceRule.h */; };
</span><span class="cx">          BC46C1FF0C0DDC8F0020CFC3 /* JSCSSImportRule.h in Headers */ = {isa = PBXBuildFile; fileRef = BC46C1F50C0DDC8F0020CFC3 /* JSCSSImportRule.h */; };
</span><span class="lines">@@ -14139,6 +14141,8 @@
</span><span class="cx">          BC29935C17A1DD5800BCE880 /* ColorInputType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ColorInputType.cpp; sourceTree = "<group>"; };
</span><span class="cx">          BC2CBF4B140F1A65003879BE /* JSWebGLContextEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWebGLContextEvent.h; sourceTree = "<group>"; };
</span><span class="cx">          BC2CBF7A140F1D58003879BE /* JSWebGLContextEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebGLContextEvent.cpp; sourceTree = "<group>"; };
</span><ins>+               BC2CCA0E2655DDB200B8C035 /* DestinationColorSpace.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DestinationColorSpace.h; sourceTree = "<group>"; };
+               BC2CCA0F2655DDB200B8C035 /* DestinationColorSpace.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = DestinationColorSpace.cpp; sourceTree = "<group>"; };
</ins><span class="cx">           BC2ED5540C6B9BD300920BFF /* JSElementCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSElementCustom.cpp; sourceTree = "<group>"; };
</span><span class="cx">          BC2ED6BB0C6BD2F000920BFF /* JSAttrCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSAttrCustom.cpp; sourceTree = "<group>"; };
</span><span class="cx">          BC305C770C076BB300CD20F0 /* JSHTMLObjectElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLObjectElement.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -14162,6 +14166,7 @@
</span><span class="cx">          BC3BE9AA0E9C242000835588 /* RenderScrollbarPart.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderScrollbarPart.cpp; sourceTree = "<group>"; };
</span><span class="cx">          BC3C39B40C0D3D8D005F4D7A /* JSMediaList.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSMediaList.cpp; sourceTree = "<group>"; };
</span><span class="cx">          BC3C39B50C0D3D8D005F4D7A /* JSMediaList.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSMediaList.h; sourceTree = "<group>"; };
</span><ins>+               BC3E62422659791700548ACD /* PlatformColorSpace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformColorSpace.h; sourceTree = "<group>"; };
</ins><span class="cx">           BC4368E70C226E32005EFB5F /* Rect.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Rect.h; sourceTree = "<group>"; };
</span><span class="cx">          BC46C1ED0C0DDBDF0020CFC3 /* JSCSSRuleCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSCSSRuleCustom.cpp; sourceTree = "<group>"; };
</span><span class="cx">          BC46C1F20C0DDC8F0020CFC3 /* JSCSSFontFaceRule.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSCSSFontFaceRule.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -26930,6 +26935,8 @@
</span><span class="cx">                          2D2FC0551460CD6F00263633 /* CrossfadeGeneratedImage.h */,
</span><span class="cx">                          A8CB41020E85B8A50032C4F0 /* DashArray.h */,
</span><span class="cx">                          555130001E7CCCCA00A69E38 /* DecodingOptions.h */,
</span><ins>+                               BC2CCA0F2655DDB200B8C035 /* DestinationColorSpace.cpp */,
+                               BC2CCA0E2655DDB200B8C035 /* DestinationColorSpace.h */,
</ins><span class="cx">                           49FC7A4F1444AF5F00A5D864 /* DisplayRefreshMonitor.cpp */,
</span><span class="cx">                          49AF2D6814435D050016A784 /* DisplayRefreshMonitor.h */,
</span><span class="cx">                          2D29ECC1192ECC8300984B78 /* DisplayRefreshMonitorClient.cpp */,
</span><span class="lines">@@ -27106,6 +27113,7 @@
</span><span class="cx">                          BC635E8B264C2CAE000EF33A /* PixelBufferFormat.h */,
</span><span class="cx">                          BC635E90264C469F000EF33A /* PixelFormat.cpp */,
</span><span class="cx">                          BCA55912263DBD79007F19B3 /* PixelFormat.h */,
</span><ins>+                               BC3E62422659791700548ACD /* PlatformColorSpace.h */,
</ins><span class="cx">                           726D56E1253AE0430002EF90 /* PlatformImage.h */,
</span><span class="cx">                          72BAC3A623E17328008D741C /* PlatformImageBuffer.h */,
</span><span class="cx">                          550640AD240756DA00AAE045 /* PlatformImageBufferBackend.h */,
</span><span class="lines">@@ -32240,6 +32248,7 @@
</span><span class="cx">                          947949251E0308AF00018D85 /* DeprecatedCSSOMValue.h in Headers */,
</span><span class="cx">                          9479493D1E0463B600018D85 /* DeprecatedCSSOMValueList.h in Headers */,
</span><span class="cx">                          7CBD129E1F98B90E00127D29 /* DeprecatedGlobalSettings.h in Headers */,
</span><ins>+                               BC2CCA102655DDB200B8C035 /* DestinationColorSpace.h in Headers */,
</ins><span class="cx">                           411223C52603567D00B0A0B6 /* DetachedRTCDataChannel.h in Headers */,
</span><span class="cx">                          A7C9ABF91357A3BF00F5503F /* DetailsMarkerControl.h in Headers */,
</span><span class="cx">                          A1ED778D1BE3294000DC1791 /* Device.h in Headers */,
</span><span class="lines">@@ -32291,6 +32300,7 @@
</span><span class="cx">                          1CE8D12726185C0E00FC3AEF /* DisplayListItemBufferIdentifier.h in Headers */,
</span><span class="cx">                          0FE5FBD51C3DD51E0007A2CA /* DisplayListItems.h in Headers */,
</span><span class="cx">                          F4377D572551C9C60080ABFE /* DisplayListItemType.h in Headers */,
</span><ins>+                               BC3E62432659791800548ACD /* PlatformColorSpace.h in Headers */,
</ins><span class="cx">                           1CE8D12E261861C400FC3AEF /* DisplayListIterator.h in Headers */,
</span><span class="cx">                          0FE5FBD71C3DD51E0007A2CA /* DisplayListRecorder.h in Headers */,
</span><span class="cx">                          0FE5FBD91C3DD51E0007A2CA /* DisplayListReplayer.h in Headers */,
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsSerializedScriptValuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/SerializedScriptValue.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/SerializedScriptValue.cpp       2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/bindings/js/SerializedScriptValue.cpp  2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -1082,7 +1082,7 @@
</span><span class="cx">             return;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        PixelBufferFormat format { AlphaPremultiplication::Premultiplied, PixelFormat::RGBA8, DestinationColorSpace::SRGB };
</del><ins>+        PixelBufferFormat format { AlphaPremultiplication::Premultiplied, PixelFormat::RGBA8, DestinationColorSpace::SRGB() };
</ins><span class="cx">         const IntSize& logicalSize = buffer->logicalSize();
</span><span class="cx">         auto pixelBuffer = buffer->getPixelBuffer(format, { IntPoint::zero(), logicalSize });
</span><span class="cx">         if (!pixelBuffer) {
</span><span class="lines">@@ -3187,7 +3187,7 @@
</span><span class="cx">             return JSValue();
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        PixelBufferFormat format { AlphaPremultiplication::Premultiplied, PixelFormat::RGBA8, DestinationColorSpace::SRGB };
</del><ins>+        PixelBufferFormat format { AlphaPremultiplication::Premultiplied, PixelFormat::RGBA8, DestinationColorSpace::SRGB() };
</ins><span class="cx">         auto pixelBuffer = PixelBuffer::tryCreate(format, imageDataSize, arrayBuffer.releaseNonNull());
</span><span class="cx">         if (!pixelBuffer) {
</span><span class="cx">             fail();
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSFilterImageValuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSFilterImageValue.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSFilterImageValue.cpp 2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/css/CSSFilterImageValue.cpp    2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -116,7 +116,7 @@
</span><span class="cx"> 
</span><span class="cx">     // Transform Image into ImageBuffer.
</span><span class="cx">     // FIXME (149424): This buffer should not be unconditionally unaccelerated.
</span><del>-    auto texture = ImageBuffer::create(size, RenderingMode::Unaccelerated, 1, DestinationColorSpace::SRGB, PixelFormat::BGRA8);
</del><ins>+    auto texture = ImageBuffer::create(size, RenderingMode::Unaccelerated, 1, DestinationColorSpace::SRGB(), PixelFormat::BGRA8);
</ins><span class="cx">     if (!texture)
</span><span class="cx">         return &Image::nullImage();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlCustomPaintCanvascpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/CustomPaintCanvas.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/CustomPaintCanvas.cpp  2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/html/CustomPaintCanvas.cpp     2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -92,7 +92,7 @@
</span><span class="cx">     if (!width() || !height())
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><del>-    m_copiedBuffer = ImageBuffer::create(size(), RenderingMode::Unaccelerated, 1, DestinationColorSpace::SRGB, PixelFormat::BGRA8, nullptr);
</del><ins>+    m_copiedBuffer = ImageBuffer::create(size(), RenderingMode::Unaccelerated, 1, DestinationColorSpace::SRGB(), PixelFormat::BGRA8, nullptr);
</ins><span class="cx">     if (!m_copiedBuffer)
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlCustomPaintImagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/CustomPaintImage.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/CustomPaintImage.cpp   2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/html/CustomPaintImage.cpp      2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -198,7 +198,7 @@
</span><span class="cx">     adjustedPatternCTM.scale(1.0 / xScale, 1.0 / yScale);
</span><span class="cx">     adjustedSrcRect.scale(xScale, yScale);
</span><span class="cx"> 
</span><del>-    auto buffer = ImageBuffer::createCompatibleBuffer(adjustedSize, DestinationColorSpace::SRGB, destContext);
</del><ins>+    auto buffer = ImageBuffer::createCompatibleBuffer(adjustedSize, DestinationColorSpace::SRGB(), destContext);
</ins><span class="cx">     if (!buffer)
</span><span class="cx">         return;
</span><span class="cx">     doCustomPaint(buffer->context(), adjustedSize);
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLCanvasElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLCanvasElement.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLCanvasElement.cpp  2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/html/HTMLCanvasElement.cpp     2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -825,7 +825,7 @@
</span><span class="cx">     // FIXME: This can likely be optimized quite a bit, especially in the cases where
</span><span class="cx">     // the ImageBuffer is backed by GPU memory already and/or is in the GPU process by
</span><span class="cx">     // specializing toMediaSample() in ImageBufferBackend to not use getPixelBuffer().
</span><del>-    auto pixelBuffer = imageBuffer->getPixelBuffer({ AlphaPremultiplication::Unpremultiplied, PixelFormat::BGRA8, DestinationColorSpace::SRGB }, { { }, imageBuffer->logicalSize() });
</del><ins>+    auto pixelBuffer = imageBuffer->getPixelBuffer({ AlphaPremultiplication::Unpremultiplied, PixelFormat::BGRA8, DestinationColorSpace::SRGB() }, { { }, imageBuffer->logicalSize() });
</ins><span class="cx">     if (!pixelBuffer)
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="lines">@@ -955,7 +955,7 @@
</span><span class="cx">     auto [colorSpace, pixelFormat] = [&] {
</span><span class="cx">         if (m_context)
</span><span class="cx">             return std::pair { m_context->colorSpace(), m_context->pixelFormat() };
</span><del>-        return std::pair { DestinationColorSpace::SRGB, PixelFormat::BGRA8 };
</del><ins>+        return std::pair { DestinationColorSpace::SRGB(), PixelFormat::BGRA8 };
</ins><span class="cx">     }();
</span><span class="cx"> 
</span><span class="cx">     setImageBuffer(ImageBuffer::create(size(), renderingMode, useDisplayList, RenderingPurpose::Canvas, 1, colorSpace, pixelFormat, hostWindow));
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLVideoElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLVideoElement.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLVideoElement.cpp   2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/html/HTMLVideoElement.cpp      2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -281,7 +281,7 @@
</span><span class="cx">         renderer->updateFromElement();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr<ImageBuffer> HTMLVideoElement::createBufferForPainting(const FloatSize& size, RenderingMode renderingMode, DestinationColorSpace colorSpace, PixelFormat pixelFormat) const
</del><ins>+RefPtr<ImageBuffer> HTMLVideoElement::createBufferForPainting(const FloatSize& size, RenderingMode renderingMode, const DestinationColorSpace& colorSpace, PixelFormat pixelFormat) const
</ins><span class="cx"> {
</span><span class="cx">     auto* hostWindow = document().view() && document().view()->root() ? document().view()->root()->hostWindow() : nullptr;
</span><span class="cx">     auto shouldUseDisplayList = document().settings().displayListDrawingEnabled() ? ShouldUseDisplayList::Yes : ShouldUseDisplayList::No;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLVideoElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLVideoElement.h (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLVideoElement.h     2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/html/HTMLVideoElement.h        2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -33,12 +33,12 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+class DestinationColorSpace;
</ins><span class="cx"> class HTMLImageLoader;
</span><span class="cx"> class ImageBuffer;
</span><span class="cx"> class RenderVideo;
</span><span class="cx"> class PictureInPictureObserver;
</span><span class="cx"> 
</span><del>-enum class DestinationColorSpace : uint8_t;
</del><span class="cx"> enum class PixelFormat : uint8_t;
</span><span class="cx"> enum class RenderingMode : bool;
</span><span class="cx"> 
</span><span class="lines">@@ -72,7 +72,7 @@
</span><span class="cx">     void webkitRequestFullscreen() override;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    RefPtr<ImageBuffer> createBufferForPainting(const FloatSize&, RenderingMode, DestinationColorSpace, PixelFormat) const;
</del><ins>+    RefPtr<ImageBuffer> createBufferForPainting(const FloatSize&, RenderingMode, const DestinationColorSpace&, PixelFormat) const;
</ins><span class="cx"> 
</span><span class="cx">     // Used by canvas to gain raw pixel access
</span><span class="cx">     void paintCurrentFrameInContext(GraphicsContext&, const FloatRect&);
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlImageBitmapcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/ImageBitmap.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/ImageBitmap.cpp        2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/html/ImageBitmap.cpp   2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -84,12 +84,12 @@
</span><span class="cx">         auto& document = downcast<Document>(scriptExecutionContext);
</span><span class="cx">         if (document.view() && document.view()->root()) {
</span><span class="cx">             auto hostWindow = document.view()->root()->hostWindow();
</span><del>-            return ImageBuffer::create(size, renderingMode, ShouldUseDisplayList::No, RenderingPurpose::Canvas, resolutionScale, DestinationColorSpace::SRGB, PixelFormat::BGRA8, hostWindow);
</del><ins>+            return ImageBuffer::create(size, renderingMode, ShouldUseDisplayList::No, RenderingPurpose::Canvas, resolutionScale, DestinationColorSpace::SRGB(), PixelFormat::BGRA8, hostWindow);
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // FIXME <https://webkit.org/b/218482> Enable worker based ImageBitmap and OffscreenCanvas drawing to use GPU Process rendering
</span><del>-    return ImageBuffer::create(size, renderingMode, resolutionScale, DestinationColorSpace::SRGB, PixelFormat::BGRA8);
</del><ins>+    return ImageBuffer::create(size, renderingMode, resolutionScale, DestinationColorSpace::SRGB(), PixelFormat::BGRA8);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void ImageBitmap::createPromise(ScriptExecutionContext& scriptExecutionContext, ImageBitmap::Source&& source, ImageBitmapOptions&& options, ImageBitmap::Promise&& promise)
</span><span class="lines">@@ -504,7 +504,7 @@
</span><span class="cx">     auto outputSize = outputSizeForSourceRectangle(sourceRectangle, options);
</span><span class="cx"> 
</span><span class="cx">     // FIXME: Add support for color spaces / pixel formats to ImageBitmap.
</span><del>-    auto bitmapData = video->createBufferForPainting(outputSize, bufferRenderingMode, DestinationColorSpace::SRGB, PixelFormat::BGRA8);
</del><ins>+    auto bitmapData = video->createBufferForPainting(outputSize, bufferRenderingMode, DestinationColorSpace::SRGB(), PixelFormat::BGRA8);
</ins><span class="cx">     if (!bitmapData) {
</span><span class="cx">         resolveWithBlankImageBuffer(scriptExecutionContext, !taintsOrigin(scriptExecutionContext.securityOrigin(), *video), WTFMove(promise));
</span><span class="cx">         return;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlOffscreenCanvascpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/OffscreenCanvas.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/OffscreenCanvas.cpp    2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/html/OffscreenCanvas.cpp       2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -451,7 +451,7 @@
</span><span class="cx">         m_context->paintRenderingResultsToCanvas();
</span><span class="cx"> 
</span><span class="cx">     if (m_placeholderData->bufferPipeSource) {
</span><del>-        auto bufferCopy = imageBuffer->copyRectToBuffer(FloatRect(FloatPoint(), imageBuffer->logicalSize()), DestinationColorSpace::SRGB, imageBuffer->context());
</del><ins>+        auto bufferCopy = imageBuffer->copyRectToBuffer(FloatRect(FloatPoint(), imageBuffer->logicalSize()), DestinationColorSpace::SRGB(), imageBuffer->context());
</ins><span class="cx">         if (bufferCopy)
</span><span class="cx">             m_placeholderData->bufferPipeSource->handle(WTFMove(bufferCopy));
</span><span class="cx">     }
</span><span class="lines">@@ -458,7 +458,7 @@
</span><span class="cx"> 
</span><span class="cx">     Locker locker { m_placeholderData->bufferLock };
</span><span class="cx">     bool shouldPushBuffer = !m_placeholderData->pendingCommitBuffer;
</span><del>-    m_placeholderData->pendingCommitBuffer = imageBuffer->copyRectToBuffer(FloatRect(FloatPoint(), imageBuffer->logicalSize()), DestinationColorSpace::SRGB, imageBuffer->context());
</del><ins>+    m_placeholderData->pendingCommitBuffer = imageBuffer->copyRectToBuffer(FloatRect(FloatPoint(), imageBuffer->logicalSize()), DestinationColorSpace::SRGB(), imageBuffer->context());
</ins><span class="cx">     if (m_placeholderData->pendingCommitBuffer && shouldPushBuffer)
</span><span class="cx">         pushBufferToPlaceholder();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasCanvasRenderingContextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/CanvasRenderingContext.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/CanvasRenderingContext.cpp      2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/html/canvas/CanvasRenderingContext.cpp 2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -28,7 +28,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include "CachedImage.h"
</span><span class="cx"> #include "CanvasPattern.h"
</span><del>-#include "ColorSpace.h"
</del><ins>+#include "DestinationColorSpace.h"
</ins><span class="cx"> #include "HTMLCanvasElement.h"
</span><span class="cx"> #include "HTMLImageElement.h"
</span><span class="cx"> #include "HTMLVideoElement.h"
</span><span class="lines">@@ -90,7 +90,7 @@
</span><span class="cx"> 
</span><span class="cx"> DestinationColorSpace CanvasRenderingContext::colorSpace() const
</span><span class="cx"> {
</span><del>-    return DestinationColorSpace::SRGB;
</del><ins>+    return DestinationColorSpace::SRGB();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool CanvasRenderingContext::wouldTaintOrigin(const CanvasPattern* pattern)
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasCanvasRenderingContexth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/CanvasRenderingContext.h (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/CanvasRenderingContext.h        2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/html/canvas/CanvasRenderingContext.h   2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -37,6 +37,7 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class CanvasPattern;
</span><ins>+class DestinationColorSpace;
</ins><span class="cx"> class HTMLCanvasElement;
</span><span class="cx"> class HTMLImageElement;
</span><span class="cx"> class HTMLVideoElement;
</span><span class="lines">@@ -43,7 +44,6 @@
</span><span class="cx"> class ImageBitmap;
</span><span class="cx"> class TypedOMCSSImageValue;
</span><span class="cx"> class WebGLObject;
</span><del>-enum class DestinationColorSpace : uint8_t;
</del><span class="cx"> enum class PixelFormat : uint8_t;
</span><span class="cx"> 
</span><span class="cx"> class CanvasRenderingContext : public ScriptWrappable {
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasCanvasRenderingContext2Dcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp    2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp       2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -37,7 +37,6 @@
</span><span class="cx"> #include "CSSPropertyNames.h"
</span><span class="cx"> #include "CSSPropertyParserHelpers.h"
</span><span class="cx"> #include "CSSPropertyParserWorkerSafe.h"
</span><del>-#include "ColorSpace.h"
</del><span class="cx"> #include "Gradient.h"
</span><span class="cx"> #include "ImageBuffer.h"
</span><span class="cx"> #include "ImageData.h"
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasImageBitmapRenderingContextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/ImageBitmapRenderingContext.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/ImageBitmapRenderingContext.cpp 2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/html/canvas/ImageBitmapRenderingContext.cpp    2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -95,7 +95,7 @@
</span><span class="cx">         // only reason I can think of is toDataURL(), but that doesn't seem like
</span><span class="cx">         // a good enough argument to waste memory.
</span><span class="cx"> 
</span><del>-        canvas()->setImageBufferAndMarkDirty(ImageBuffer::create(FloatSize(canvas()->width(), canvas()->height()), bufferRenderingMode, 1, DestinationColorSpace::SRGB, PixelFormat::BGRA8));
</del><ins>+        canvas()->setImageBufferAndMarkDirty(ImageBuffer::create(FloatSize(canvas()->width(), canvas()->height()), bufferRenderingMode, 1, DestinationColorSpace::SRGB(), PixelFormat::BGRA8));
</ins><span class="cx"> 
</span><span class="cx">         // 1.4. Set the output bitmap's origin-clean flag to true.
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasPredefinedColorSpacecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/PredefinedColorSpace.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/PredefinedColorSpace.cpp        2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/html/canvas/PredefinedColorSpace.cpp   2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -26,7 +26,7 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "PredefinedColorSpace.h"
</span><span class="cx"> 
</span><del>-#include "ColorSpace.h"
</del><ins>+#include "DestinationColorSpace.h"
</ins><span class="cx"> #include <wtf/Optional.h>
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -35,33 +35,26 @@
</span><span class="cx"> {
</span><span class="cx">     switch (colorSpace) {
</span><span class="cx">     case PredefinedColorSpace::SRGB:
</span><del>-        return DestinationColorSpace::SRGB;
</del><ins>+        return DestinationColorSpace::SRGB();
</ins><span class="cx"> #if ENABLE(DESTINATION_COLOR_SPACE_DISPLAY_P3)
</span><span class="cx">     case PredefinedColorSpace::DisplayP3:
</span><del>-        return DestinationColorSpace::DisplayP3;
</del><ins>+        return DestinationColorSpace::DisplayP3();
</ins><span class="cx"> #endif
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     ASSERT_NOT_REACHED();
</span><del>-    return DestinationColorSpace::SRGB;
</del><ins>+    return DestinationColorSpace::SRGB();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-Optional<PredefinedColorSpace> toPredefinedColorSpace(DestinationColorSpace colorSpace)
</del><ins>+Optional<PredefinedColorSpace> toPredefinedColorSpace(const DestinationColorSpace& colorSpace)
</ins><span class="cx"> {
</span><del>-    switch (colorSpace) {
-    case DestinationColorSpace::SRGB:
</del><ins>+    if (colorSpace == DestinationColorSpace::SRGB())
</ins><span class="cx">         return PredefinedColorSpace::SRGB;
</span><del>-#if ENABLE(DESTINATION_COLOR_SPACE_LINEAR_SRGB)
-    case DestinationColorSpace::LinearSRGB:
-        return WTF::nullopt;
-#endif
</del><span class="cx"> #if ENABLE(DESTINATION_COLOR_SPACE_DISPLAY_P3)
</span><del>-    case DestinationColorSpace::DisplayP3:
</del><ins>+    if (colorSpace == DestinationColorSpace::DisplayP3())
</ins><span class="cx">         return PredefinedColorSpace::DisplayP3;
</span><span class="cx"> #endif
</span><del>-    }
</del><span class="cx"> 
</span><del>-    ASSERT_NOT_REACHED();
</del><span class="cx">     return WTF::nullopt;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasPredefinedColorSpaceh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/PredefinedColorSpace.h (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/PredefinedColorSpace.h  2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/html/canvas/PredefinedColorSpace.h     2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -30,7 +30,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-enum class DestinationColorSpace : uint8_t;
</del><ins>+class DestinationColorSpace;
</ins><span class="cx"> 
</span><span class="cx"> enum class PredefinedColorSpace {
</span><span class="cx">     SRGB
</span><span class="lines">@@ -40,7 +40,7 @@
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> DestinationColorSpace toDestinationColorSpace(PredefinedColorSpace);
</span><del>-Optional<PredefinedColorSpace> toPredefinedColorSpace(DestinationColorSpace);
</del><ins>+Optional<PredefinedColorSpace> toPredefinedColorSpace(const DestinationColorSpace&);
</ins><span class="cx"> 
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGLRenderingContextBasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp   2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp      2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -7623,7 +7623,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // FIXME (149423): Should this ImageBuffer be unconditionally unaccelerated?
</span><del>-    auto temp = ImageBuffer::create(size, RenderingMode::Unaccelerated, 1, DestinationColorSpace::SRGB, PixelFormat::BGRA8);
</del><ins>+    auto temp = ImageBuffer::create(size, RenderingMode::Unaccelerated, 1, DestinationColorSpace::SRGB(), PixelFormat::BGRA8);
</ins><span class="cx">     if (!temp)
</span><span class="cx">         return nullptr;
</span><span class="cx">     ASSERT(m_buffers.size() > 0);
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlshadowMediaControlTextTrackContainerElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/shadow/MediaControlTextTrackContainerElement.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/shadow/MediaControlTextTrackContainerElement.cpp       2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/html/shadow/MediaControlTextTrackContainerElement.cpp  2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -418,7 +418,7 @@
</span><span class="cx">     IntRect paintingRect = IntRect(IntPoint(), layer->size());
</span><span class="cx"> 
</span><span class="cx">     // FIXME (149422): This buffer should not be unconditionally unaccelerated.
</span><del>-    auto buffer = ImageBuffer::create(paintingRect.size(), RenderingMode::Unaccelerated, deviceScaleFactor, DestinationColorSpace::SRGB, PixelFormat::BGRA8);
</del><ins>+    auto buffer = ImageBuffer::create(paintingRect.size(), RenderingMode::Unaccelerated, deviceScaleFactor, DestinationColorSpace::SRGB(), PixelFormat::BGRA8);
</ins><span class="cx">     if (!buffer)
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorCanvascpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorCanvas.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorCanvas.cpp       2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/inspector/InspectorCanvas.cpp  2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -1149,7 +1149,7 @@
</span><span class="cx">             if (CachedImage* cachedImage = imageElement->cachedImage()) {
</span><span class="cx">                 Image* image = cachedImage->image();
</span><span class="cx">                 if (image && image != &Image::nullImage()) {
</span><del>-                    auto imageBuffer = ImageBuffer::create(image->size(), RenderingMode::Unaccelerated, 1, DestinationColorSpace::SRGB, PixelFormat::BGRA8);
</del><ins>+                    auto imageBuffer = ImageBuffer::create(image->size(), RenderingMode::Unaccelerated, 1, DestinationColorSpace::SRGB(), PixelFormat::BGRA8);
</ins><span class="cx">                     imageBuffer->context().drawImage(*image, FloatPoint(0, 0));
</span><span class="cx">                     dataURL = imageBuffer->toDataURL("image/png");
</span><span class="cx">                 }
</span><span class="lines">@@ -1163,7 +1163,7 @@
</span><span class="cx"> 
</span><span class="cx">             unsigned videoWidth = videoElement->videoWidth();
</span><span class="cx">             unsigned videoHeight = videoElement->videoHeight();
</span><del>-            auto imageBuffer = ImageBuffer::create(FloatSize(videoWidth, videoHeight), RenderingMode::Unaccelerated, 1, DestinationColorSpace::SRGB, PixelFormat::BGRA8);
</del><ins>+            auto imageBuffer = ImageBuffer::create(FloatSize(videoWidth, videoHeight), RenderingMode::Unaccelerated, 1, DestinationColorSpace::SRGB(), PixelFormat::BGRA8);
</ins><span class="cx">             if (imageBuffer) {
</span><span class="cx">                 videoElement->paintCurrentFrameInContext(imageBuffer->context(), FloatRect(0, 0, videoWidth, videoHeight));
</span><span class="cx">                 dataURL = imageBuffer->toDataURL("image/png");
</span><span class="lines">@@ -1200,7 +1200,7 @@
</span><span class="cx">             if (auto* cachedImage = cssImageValue->image()) {
</span><span class="cx">                 auto* image = cachedImage->image();
</span><span class="cx">                 if (image && image != &Image::nullImage()) {
</span><del>-                    auto imageBuffer = ImageBuffer::create(image->size(), RenderingMode::Unaccelerated, 1, DestinationColorSpace::SRGB, PixelFormat::BGRA8);
</del><ins>+                    auto imageBuffer = ImageBuffer::create(image->size(), RenderingMode::Unaccelerated, 1, DestinationColorSpace::SRGB(), PixelFormat::BGRA8);
</ins><span class="cx">                     imageBuffer->context().drawImage(*image, FloatPoint(0, 0));
</span><span class="cx">                     dataURL = imageBuffer->toDataURL("image/png");
</span><span class="cx">                 }
</span><span class="lines">@@ -1441,7 +1441,7 @@
</span><span class="cx"> {
</span><span class="cx">     auto& tileImage = canvasPattern.pattern().tileImage();
</span><span class="cx">     FloatRect rect = { { }, tileImage.size() };
</span><del>-    auto imageBuffer = ImageBuffer::create(tileImage.size(), RenderingMode::Unaccelerated, 1, DestinationColorSpace::SRGB, PixelFormat::BGRA8);
</del><ins>+    auto imageBuffer = ImageBuffer::create(tileImage.size(), RenderingMode::Unaccelerated, 1, DestinationColorSpace::SRGB(), PixelFormat::BGRA8);
</ins><span class="cx">     imageBuffer->context().drawNativeImage(tileImage, tileImage.size(), rect, rect);
</span><span class="cx"> 
</span><span class="cx">     String repeat;
</span></span></pre></div>
<a id="trunkSourceWebCorepageChromecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Chrome.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Chrome.cpp     2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/page/Chrome.cpp        2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -529,7 +529,7 @@
</span><span class="cx">     m_client.setCursorHiddenUntilMouseMoves(hiddenUntilMouseMoves);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr<ImageBuffer> Chrome::createImageBuffer(const FloatSize& size, RenderingMode renderingMode, RenderingPurpose purpose, float resolutionScale, DestinationColorSpace colorSpace, PixelFormat pixelFormat) const
</del><ins>+RefPtr<ImageBuffer> Chrome::createImageBuffer(const FloatSize& size, RenderingMode renderingMode, RenderingPurpose purpose, float resolutionScale, const DestinationColorSpace& colorSpace, PixelFormat pixelFormat) const
</ins><span class="cx"> {
</span><span class="cx">     return m_client.createImageBuffer(size, renderingMode, purpose, resolutionScale, colorSpace, pixelFormat);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorepageChromeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Chrome.h (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Chrome.h       2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/page/Chrome.h  2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -85,7 +85,7 @@
</span><span class="cx">     void setCursor(const Cursor&) override;
</span><span class="cx">     void setCursorHiddenUntilMouseMoves(bool) override;
</span><span class="cx"> 
</span><del>-    RefPtr<ImageBuffer> createImageBuffer(const FloatSize&, RenderingMode, RenderingPurpose, float resolutionScale, DestinationColorSpace, PixelFormat) const override;
</del><ins>+    RefPtr<ImageBuffer> createImageBuffer(const FloatSize&, RenderingMode, RenderingPurpose, float resolutionScale, const DestinationColorSpace&, PixelFormat) const override;
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(WEBGL)
</span><span class="cx">     RefPtr<GraphicsContextGL> createGraphicsContextGL(const GraphicsContextGLAttributes&) const override;
</span></span></pre></div>
<a id="trunkSourceWebCorepageChromeClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/ChromeClient.h (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/ChromeClient.h 2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/page/ChromeClient.h    2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -339,7 +339,7 @@
</span><span class="cx">     
</span><span class="cx">     virtual DisplayRefreshMonitorFactory* displayRefreshMonitorFactory() const { return nullptr; }
</span><span class="cx"> 
</span><del>-    virtual RefPtr<ImageBuffer> createImageBuffer(const FloatSize&, RenderingMode, RenderingPurpose, float, DestinationColorSpace, PixelFormat) const { return nullptr; }
</del><ins>+    virtual RefPtr<ImageBuffer> createImageBuffer(const FloatSize&, RenderingMode, RenderingPurpose, float, const DestinationColorSpace&, PixelFormat) const { return nullptr; }
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(WEBGL)
</span><span class="cx">     virtual RefPtr<GraphicsContextGL> createGraphicsContextGL(const GraphicsContextGLAttributes&, WebCore::PlatformDisplayID) const { return nullptr; }
</span></span></pre></div>
<a id="trunkSourceWebCorepageFrameSnapshottingcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/FrameSnapshotting.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/FrameSnapshotting.cpp  2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/page/FrameSnapshotting.cpp     2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -111,7 +111,7 @@
</span><span class="cx">     if (options & SnapshotOptionsPaintWithIntegralScaleFactor)
</span><span class="cx">         scaleFactor = ceilf(scaleFactor);
</span><span class="cx"> 
</span><del>-    auto buffer = ImageBuffer::create(imageRect.size(), RenderingMode::Unaccelerated, scaleFactor, DestinationColorSpace::SRGB, PixelFormat::BGRA8);
</del><ins>+    auto buffer = ImageBuffer::create(imageRect.size(), RenderingMode::Unaccelerated, scaleFactor, DestinationColorSpace::SRGB(), PixelFormat::BGRA8);
</ins><span class="cx">     if (!buffer)
</span><span class="cx">         return nullptr;
</span><span class="cx">     buffer->context().translate(-imageRect.x(), -imageRect.y());
</span></span></pre></div>
<a id="trunkSourceWebCorepagePageColorSamplercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/PageColorSampler.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/PageColorSampler.cpp   2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/page/PageColorSampler.cpp      2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -104,7 +104,7 @@
</span><span class="cx">     if (!snapshot)
</span><span class="cx">         return WTF::nullopt;
</span><span class="cx"> 
</span><del>-    auto pixelBuffer = snapshot->getPixelBuffer({ AlphaPremultiplication::Unpremultiplied, PixelFormat::BGRA8, DestinationColorSpace::SRGB }, { { }, snapshot->logicalSize() });
</del><ins>+    auto pixelBuffer = snapshot->getPixelBuffer({ AlphaPremultiplication::Unpremultiplied, PixelFormat::BGRA8, DestinationColorSpace::SRGB() }, { { }, snapshot->logicalSize() });
</ins><span class="cx">     if (!pixelBuffer)
</span><span class="cx">         return WTF::nullopt;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepagePageConsoleClientcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/PageConsoleClient.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/PageConsoleClient.cpp  2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/page/PageConsoleClient.cpp     2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -326,7 +326,7 @@
</span><span class="cx">                         if (auto* cachedImage = imageElement.cachedImage()) {
</span><span class="cx">                             auto* image = cachedImage->image();
</span><span class="cx">                             if (image && image != &Image::nullImage()) {
</span><del>-                                snapshot = ImageBuffer::create(image->size(), RenderingMode::Unaccelerated, 1, DestinationColorSpace::SRGB, PixelFormat::BGRA8);
</del><ins>+                                snapshot = ImageBuffer::create(image->size(), RenderingMode::Unaccelerated, 1, DestinationColorSpace::SRGB(), PixelFormat::BGRA8);
</ins><span class="cx">                                 snapshot->context().drawImage(*image, FloatPoint(0, 0));
</span><span class="cx">                             }
</span><span class="cx">                         }
</span><span class="lines">@@ -343,7 +343,7 @@
</span><span class="cx">                         auto& videoElement = downcast<HTMLVideoElement>(*node);
</span><span class="cx">                         unsigned videoWidth = videoElement.videoWidth();
</span><span class="cx">                         unsigned videoHeight = videoElement.videoHeight();
</span><del>-                        snapshot = ImageBuffer::create(FloatSize(videoWidth, videoHeight), RenderingMode::Unaccelerated, 1, DestinationColorSpace::SRGB, PixelFormat::BGRA8);
</del><ins>+                        snapshot = ImageBuffer::create(FloatSize(videoWidth, videoHeight), RenderingMode::Unaccelerated, 1, DestinationColorSpace::SRGB(), PixelFormat::BGRA8);
</ins><span class="cx">                         videoElement.paintCurrentFrameInContext(snapshot->context(), FloatRect(0, 0, videoWidth, videoHeight));
</span><span class="cx">                     }
</span><span class="cx"> #endif
</span><span class="lines">@@ -368,7 +368,7 @@
</span><span class="cx">             target = possibleTarget;
</span><span class="cx">             if (UNLIKELY(InspectorInstrumentation::hasFrontends())) {
</span><span class="cx">                 auto sourceSize = imageData->size();
</span><del>-                if (auto imageBuffer = ImageBuffer::create(sourceSize, RenderingMode::Unaccelerated, 1, DestinationColorSpace::SRGB, PixelFormat::BGRA8)) {
</del><ins>+                if (auto imageBuffer = ImageBuffer::create(sourceSize, RenderingMode::Unaccelerated, 1, DestinationColorSpace::SRGB(), PixelFormat::BGRA8)) {
</ins><span class="cx">                     IntRect sourceRect(IntPoint(), sourceSize);
</span><span class="cx">                     imageBuffer->putPixelBuffer(imageData->pixelBuffer(), sourceRect);
</span><span class="cx">                     dataURL = imageBuffer->toDataURL("image/png"_s, WTF::nullopt, PreserveResolution::Yes);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformHostWindowh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/HostWindow.h (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/HostWindow.h       2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/platform/HostWindow.h  2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -31,10 +31,10 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class Cursor;
</span><ins>+class DestinationColorSpace;
</ins><span class="cx"> class ImageBuffer;
</span><span class="cx"> 
</span><span class="cx"> enum class PixelFormat : uint8_t;
</span><del>-enum class DestinationColorSpace : uint8_t;
</del><span class="cx"> enum class RenderingMode : bool;
</span><span class="cx"> enum class RenderingPurpose : uint8_t;
</span><span class="cx"> 
</span><span class="lines">@@ -64,7 +64,7 @@
</span><span class="cx">     virtual IntPoint accessibilityScreenToRootView(const IntPoint&) const = 0;
</span><span class="cx">     virtual IntRect rootViewToAccessibilityScreen(const IntRect&) const = 0;
</span><span class="cx"> 
</span><del>-    virtual RefPtr<ImageBuffer> createImageBuffer(const FloatSize&, RenderingMode, RenderingPurpose, float resolutionScale, DestinationColorSpace, PixelFormat) const = 0;
</del><ins>+    virtual RefPtr<ImageBuffer> createImageBuffer(const FloatSize&, RenderingMode, RenderingPurpose, float resolutionScale, const DestinationColorSpace&, PixelFormat) const = 0;
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(WEBGL)
</span><span class="cx">     virtual RefPtr<GraphicsContextGL> createGraphicsContextGL(const GraphicsContextGLAttributes&) const = 0;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformPlatformScreenh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/PlatformScreen.h (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/PlatformScreen.h   2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/platform/PlatformScreen.h      2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -53,6 +53,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+class DestinationColorSpace;
</ins><span class="cx"> class FloatRect;
</span><span class="cx"> class FloatSize;
</span><span class="cx"> class Widget;
</span><span class="lines">@@ -68,6 +69,7 @@
</span><span class="cx"> int screenDepth(Widget*);
</span><span class="cx"> int screenDepthPerComponent(Widget*);
</span><span class="cx"> bool screenIsMonochrome(Widget*);
</span><ins>+WEBCORE_EXPORT DestinationColorSpace screenColorSpace(Widget* = nullptr);
</ins><span class="cx"> 
</span><span class="cx"> bool screenHasInvertedColors();
</span><span class="cx"> 
</span><span class="lines">@@ -100,10 +102,6 @@
</span><span class="cx"> constexpr bool screenSupportsHighDynamicRange(Widget* = nullptr) { return false; }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if USE(CG)
-WEBCORE_EXPORT CGColorSpaceRef screenColorSpace(Widget* = nullptr);
-#endif
-
</del><span class="cx"> struct ScreenProperties;
</span><span class="cx"> struct ScreenData;
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformScreenPropertiesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ScreenProperties.h (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ScreenProperties.h 2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/platform/ScreenProperties.h    2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -25,6 +25,7 @@
</span><span class="cx"> 
</span><span class="cx"> #pragma once
</span><span class="cx"> 
</span><ins>+#include "DestinationColorSpace.h"
</ins><span class="cx"> #include "FloatRect.h"
</span><span class="cx"> #include "PlatformScreen.h"
</span><span class="cx"> #include <wtf/EnumTraits.h>
</span><span class="lines">@@ -32,14 +33,12 @@
</span><span class="cx"> #include <wtf/RetainPtr.h>
</span><span class="cx"> #include <wtf/text/WTFString.h>
</span><span class="cx"> 
</span><del>-typedef struct CGColorSpace *CGColorSpaceRef;
-
</del><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> struct ScreenData {
</span><span class="cx">     FloatRect screenAvailableRect;
</span><span class="cx">     FloatRect screenRect;
</span><del>-    RetainPtr<CGColorSpaceRef> colorSpace;
</del><ins>+    DestinationColorSpace colorSpace { DestinationColorSpace::SRGB() };
</ins><span class="cx">     int screenDepth { 0 };
</span><span class="cx">     int screenDepthPerComponent { 0 };
</span><span class="cx">     bool screenSupportsExtendedColor { false };
</span><span class="lines">@@ -56,13 +55,12 @@
</span><span class="cx">     float scaleFactor { 1 };
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    enum class ColorSpaceType : uint8_t { None, Name, Data };
</del><span class="cx">     template<class Encoder> void encode(Encoder&) const;
</span><span class="cx">     template<class Decoder> static Optional<ScreenData> decode(Decoder&);
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-typedef HashMap<PlatformDisplayID, ScreenData> ScreenDataMap;
-    
</del><ins>+using ScreenDataMap = HashMap<PlatformDisplayID, ScreenData>;
+
</ins><span class="cx"> struct ScreenProperties {
</span><span class="cx">     PlatformDisplayID primaryDisplayID { 0 };
</span><span class="cx">     ScreenDataMap screenDataMap;
</span><span class="lines">@@ -74,8 +72,7 @@
</span><span class="cx"> template<class Encoder>
</span><span class="cx"> void ScreenProperties::encode(Encoder& encoder) const
</span><span class="cx"> {
</span><del>-    encoder << primaryDisplayID;
-    encoder << screenDataMap;
</del><ins>+    encoder << primaryDisplayID << screenDataMap;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> template<class Decoder>
</span><span class="lines">@@ -97,7 +94,7 @@
</span><span class="cx"> template<class Encoder>
</span><span class="cx"> void ScreenData::encode(Encoder& encoder) const
</span><span class="cx"> {
</span><del>-    encoder << screenAvailableRect << screenRect << screenDepth << screenDepthPerComponent << screenSupportsExtendedColor << screenHasInvertedColors << screenSupportsHighDynamicRange;
</del><ins>+    encoder << screenAvailableRect << screenRect << colorSpace << screenDepth << screenDepthPerComponent << screenSupportsExtendedColor << screenHasInvertedColors << screenSupportsHighDynamicRange;
</ins><span class="cx"> 
</span><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx">     encoder << screenIsMonochrome << displayMask << gpuID << preferredDynamicRangeMode;
</span><span class="lines">@@ -106,28 +103,6 @@
</span><span class="cx"> #if PLATFORM(MAC) || PLATFORM(IOS_FAMILY)
</span><span class="cx">     encoder << scaleFactor;
</span><span class="cx"> #endif
</span><del>-
-    if (colorSpace) {
-        // Try to encode the name.
-        if (auto name = adoptCF(CGColorSpaceCopyName(colorSpace.get()))) {
-            encoder << ColorSpaceType::Name;
-            encoder << String(name.get());
-            return;
-        }
-
-        // Failing that, just encode the ICC data.
-        if (auto profileData = adoptCF(CGColorSpaceCopyICCData(colorSpace.get()))) {
-            Vector<uint8_t> iccData;
-            iccData.append(CFDataGetBytePtr(profileData.get()), CFDataGetLength(profileData.get()));
-
-            encoder << ColorSpaceType::Data;
-            encoder << iccData;
-            return;
-        }
-    }
-
-    // The color space was null or failed to be encoded.
-    encoder << ColorSpaceType::None;
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> template<class Decoder>
</span><span class="lines">@@ -143,6 +118,11 @@
</span><span class="cx">     if (!screenRect)
</span><span class="cx">         return WTF::nullopt;
</span><span class="cx"> 
</span><ins>+    Optional<DestinationColorSpace> screenColorSpace;
+    decoder >> screenColorSpace;
+    if (!screenColorSpace)
+        return WTF::nullopt;
+
</ins><span class="cx">     Optional<int> screenDepth;
</span><span class="cx">     decoder >> screenDepth;
</span><span class="cx">     if (!screenDepth)
</span><span class="lines">@@ -197,41 +177,10 @@
</span><span class="cx">         return WTF::nullopt;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    ColorSpaceType dataType;
-    if (!decoder.decode(dataType))
-        return WTF::nullopt;
-
-    RetainPtr<CGColorSpaceRef> cgColorSpace;
-    switch (dataType) {
-    case ColorSpaceType::None:
-        break;
-    case ColorSpaceType::Name: {
-        Optional<String> colorSpaceName;
-        decoder >> colorSpaceName;
-        ASSERT(colorSpaceName);
-        if (!colorSpaceName)
-            return WTF::nullopt;
-
-        cgColorSpace = adoptCF(CGColorSpaceCreateWithName(colorSpaceName->createCFString().get()));
-        break;
-    }
-    case ColorSpaceType::Data: {
-        Optional<Vector<uint8_t>> iccData;
-        decoder >> iccData;
-        ASSERT(iccData);
-        if (!iccData)
-            return WTF::nullopt;
-
-        auto colorSpaceData = adoptCF(CFDataCreate(kCFAllocatorDefault, iccData->data(), iccData->size()));
-        cgColorSpace = adoptCF(CGColorSpaceCreateWithICCData(colorSpaceData.get()));
-        break;
-    }
-    }
-
</del><span class="cx">     return { {
</span><span class="cx">         WTFMove(*screenAvailableRect),
</span><span class="cx">         WTFMove(*screenRect),
</span><del>-        WTFMove(cgColorSpace),
</del><ins>+        WTFMove(*screenColorSpace),
</ins><span class="cx">         WTFMove(*screenDepth),
</span><span class="cx">         WTFMove(*screenDepthPerComponent),
</span><span class="cx">         WTFMove(*screenSupportsExtendedColor),
</span><span class="lines">@@ -250,16 +199,3 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span><del>-
-namespace WTF {
-
-template<> struct EnumTraits<WebCore::ScreenData::ColorSpaceType> {
-    using values = EnumValues<
-        WebCore::ScreenData::ColorSpaceType,
-        WebCore::ScreenData::ColorSpaceType::None,
-        WebCore::ScreenData::ColorSpaceType::Name,
-        WebCore::ScreenData::ColorSpaceType::Data
-    >;
-};
-
-} // namespace WTF
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsBitmapImagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/BitmapImage.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/BitmapImage.cpp   2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/platform/graphics/BitmapImage.cpp      2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -164,7 +164,7 @@
</span><span class="cx">         return image;
</span><span class="cx"> 
</span><span class="cx">     auto correctedSizeFloat = correctedSize ? FloatSize(correctedSize.value()) : size();
</span><del>-    auto buffer = ImageBuffer::create(correctedSizeFloat, RenderingMode::Unaccelerated, 1, DestinationColorSpace::SRGB, PixelFormat::BGRA8);
</del><ins>+    auto buffer = ImageBuffer::create(correctedSizeFloat, RenderingMode::Unaccelerated, 1, DestinationColorSpace::SRGB(), PixelFormat::BGRA8);
</ins><span class="cx">     if (!buffer)
</span><span class="cx">         return image;
</span><span class="cx"> 
</span><span class="lines">@@ -352,7 +352,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (!m_cachedImage) {
</span><del>-        auto buffer = ImageBuffer::createCompatibleBuffer(expandedIntSize(tileRect.size()), DestinationColorSpace::SRGB, ctxt);
</del><ins>+        auto buffer = ImageBuffer::createCompatibleBuffer(expandedIntSize(tileRect.size()), DestinationColorSpace::SRGB(), ctxt);
</ins><span class="cx">         if (!buffer)
</span><span class="cx">             return;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsColorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/Color.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/Color.cpp 2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/platform/graphics/Color.cpp    2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -168,7 +168,7 @@
</span><span class="cx">     return converColorComponents(inputColorSpace, components, outputColorSpace);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-ColorComponents<float, 4> Color::toColorComponentsInColorSpace(DestinationColorSpace outputColorSpace) const
</del><ins>+ColorComponents<float, 4> Color::toColorComponentsInColorSpace(const DestinationColorSpace& outputColorSpace) const
</ins><span class="cx"> {
</span><span class="cx">     auto [inputColorSpace, components] = colorSpaceAndComponents();
</span><span class="cx">     return converColorComponents(inputColorSpace, components, outputColorSpace);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsColorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/Color.h (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/Color.h   2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/platform/graphics/Color.h      2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx"> #include "ColorConversion.h"
</span><span class="cx"> #include "ColorSpace.h"
</span><span class="cx"> #include "ColorUtilities.h"
</span><ins>+#include "DestinationColorSpace.h"
</ins><span class="cx"> #include <functional>
</span><span class="cx"> #include <wtf/Forward.h>
</span><span class="cx"> #include <wtf/HashFunctions.h>
</span><span class="lines">@@ -121,7 +122,7 @@
</span><span class="cx">     template<typename T> SRGBA<T> toSRGBALossy() const { return toColorTypeLossy<SRGBA<T>>(); }
</span><span class="cx"> 
</span><span class="cx">     ColorComponents<float, 4> toColorComponentsInColorSpace(ColorSpace) const;
</span><del>-    ColorComponents<float, 4> toColorComponentsInColorSpace(DestinationColorSpace) const;
</del><ins>+    ColorComponents<float, 4> toColorComponentsInColorSpace(const DestinationColorSpace&) const;
</ins><span class="cx"> 
</span><span class="cx">     WEBCORE_EXPORT std::pair<ColorSpace, ColorComponents<float, 4>> colorSpaceAndComponents() const;
</span><span class="cx"> 
</span><span class="lines">@@ -267,6 +268,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if USE(CG)
</span><span class="cx"> WEBCORE_EXPORT CGColorRef cachedCGColor(const Color&);
</span><ins>+WEBCORE_EXPORT ColorComponents<float, 4> platformConvertColorComponents(ColorSpace, ColorComponents<float, 4>, const DestinationColorSpace&);
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> WEBCORE_EXPORT WTF::TextStream& operator<<(WTF::TextStream&, const Color&);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsColorConversioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ColorConversion.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ColorConversion.cpp       2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/platform/graphics/ColorConversion.cpp  2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -26,7 +26,9 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "ColorConversion.h"
</span><span class="cx"> 
</span><ins>+#include "Color.h"
</ins><span class="cx"> #include "ColorSpace.h"
</span><ins>+#include "DestinationColorSpace.h"
</ins><span class="cx"> #include <wtf/MathExtras.h>
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -318,18 +320,21 @@
</span><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-ColorComponents<float, 4> converColorComponents(ColorSpace inputColorSpace, ColorComponents<float, 4> inputColorComponents, DestinationColorSpace outputColorSpace)
</del><ins>+ColorComponents<float, 4> converColorComponents(ColorSpace inputColorSpace, ColorComponents<float, 4> inputColorComponents, const DestinationColorSpace& outputColorSpace)
</ins><span class="cx"> {
</span><ins>+#if USE(CG)
+    return platformConvertColorComponents(inputColorSpace, inputColorComponents, outputColorSpace);
+#else
</ins><span class="cx">     return callWithColorType(inputColorComponents, inputColorSpace, [outputColorSpace] (const auto& inputColor) {
</span><del>-        switch (outputColorSpace) {
-        case DestinationColorSpace::SRGB:
</del><ins>+        switch (outputColorSpace.platformColorSpace()) {
+        case PlatformColorSpace::Name::SRGB:
</ins><span class="cx">             return asColorComponents(convertColor<SRGBA<float>>(inputColor));
</span><span class="cx"> #if ENABLE(DESTINATION_COLOR_SPACE_LINEAR_SRGB)
</span><del>-        case DestinationColorSpace::LinearSRGB:
</del><ins>+        case PlatformColorSpace::Name::LinearSRGB:
</ins><span class="cx">             return asColorComponents(convertColor<LinearSRGBA<float>>(inputColor));
</span><span class="cx"> #endif
</span><span class="cx"> #if ENABLE(DESTINATION_COLOR_SPACE_DISPLAY_P3)
</span><del>-        case DestinationColorSpace::DisplayP3:
</del><ins>+        case PlatformColorSpace::Name::DisplayP3:
</ins><span class="cx">             return asColorComponents(convertColor<DisplayP3<float>>(inputColor));
</span><span class="cx"> #endif
</span><span class="cx">         }
</span><span class="lines">@@ -337,6 +342,7 @@
</span><span class="cx">         ASSERT_NOT_REACHED();
</span><span class="cx">         return asColorComponents(convertColor<SRGBA<float>>(inputColor));
</span><span class="cx">     });
</span><ins>+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsColorConversionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ColorConversion.h (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ColorConversion.h 2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/platform/graphics/ColorConversion.h    2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -29,8 +29,9 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+class DestinationColorSpace;
+
</ins><span class="cx"> enum class ColorSpace : uint8_t;
</span><del>-enum class DestinationColorSpace : uint8_t;
</del><span class="cx"> 
</span><span class="cx"> // Conversion function for typed colors.
</span><span class="cx"> template<typename Output, typename Input> Output convertColor(const Input& color);
</span><span class="lines">@@ -37,7 +38,7 @@
</span><span class="cx"> 
</span><span class="cx"> // Conversion functions for raw color components with associated color spaces.
</span><span class="cx"> ColorComponents<float, 4> converColorComponents(ColorSpace inputColorSpace, ColorComponents<float, 4> inputColorComponents, ColorSpace outputColorSpace);
</span><del>-ColorComponents<float, 4> converColorComponents(ColorSpace inputColorSpace, ColorComponents<float, 4> inputColorComponents, DestinationColorSpace outputColorSpace);
</del><ins>+ColorComponents<float, 4> converColorComponents(ColorSpace inputColorSpace, ColorComponents<float, 4> inputColorComponents, const DestinationColorSpace& outputColorSpace);
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> // All color types, other than XYZA or those inheriting from RGBType, must implement
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsColorSpacecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ColorSpace.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ColorSpace.cpp    2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/platform/graphics/ColorSpace.cpp       2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -64,24 +64,4 @@
</span><span class="cx">     return ts;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-TextStream& operator<<(TextStream& ts, DestinationColorSpace colorSpace)
-{
-    switch (colorSpace) {
-    case DestinationColorSpace::SRGB:
-        ts << "sRGB";
-        break;
-#if ENABLE(DESTINATION_COLOR_SPACE_LINEAR_SRGB)
-    case DestinationColorSpace::LinearSRGB:
-        ts << "LinearSRGB";
-        break;
-#endif
-#if ENABLE(DESTINATION_COLOR_SPACE_DISPLAY_P3)
-    case DestinationColorSpace::DisplayP3:
-        ts << "DisplayP3";
-        break;
-#endif
-    }
-    return ts;
</del><span class="cx"> }
</span><del>-
-}
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsColorSpaceh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ColorSpace.h (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ColorSpace.h      2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/platform/graphics/ColorSpace.h 2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -28,11 +28,8 @@
</span><span class="cx"> #include "ColorTypes.h"
</span><span class="cx"> #include <functional>
</span><span class="cx"> #include <wtf/EnumTraits.h>
</span><ins>+#include <wtf/Forward.h>
</ins><span class="cx"> 
</span><del>-namespace WTF {
-class TextStream;
-}
-
</del><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> enum class ColorSpace : uint8_t {
</span><span class="lines">@@ -47,20 +44,9 @@
</span><span class="cx">     XYZ_D50,
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-enum class DestinationColorSpace : uint8_t {
-    SRGB
-#if ENABLE(DESTINATION_COLOR_SPACE_LINEAR_SRGB)
-    , LinearSRGB
-#endif
-#if ENABLE(DESTINATION_COLOR_SPACE_DISPLAY_P3)
-    , DisplayP3
-#endif
-};
</del><ins>+WEBCORE_EXPORT TextStream& operator<<(TextStream&, ColorSpace);
</ins><span class="cx"> 
</span><del>-WEBCORE_EXPORT WTF::TextStream& operator<<(WTF::TextStream&, ColorSpace);
-WEBCORE_EXPORT WTF::TextStream& operator<<(WTF::TextStream&, DestinationColorSpace);
</del><span class="cx"> 
</span><del>-
</del><span class="cx"> template<typename> struct ColorSpaceMapping;
</span><span class="cx"> template<typename T> struct ColorSpaceMapping<A98RGB<T>> { static constexpr auto colorSpace { ColorSpace::A98RGB }; };
</span><span class="cx"> template<typename T> struct ColorSpaceMapping<DisplayP3<T>> { static constexpr auto colorSpace { ColorSpace::DisplayP3 }; };
</span><span class="lines">@@ -102,26 +88,7 @@
</span><span class="cx">     return std::invoke(std::forward<Functor>(functor), makeFromComponents<SRGBA<T>>(components));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-template<typename T, typename Functor> constexpr decltype(auto) callWithColorType(const ColorComponents<T, 4>& components, DestinationColorSpace colorSpace, Functor&& functor)
-{
-    switch (colorSpace) {
-    case DestinationColorSpace::SRGB:
-        return std::invoke(std::forward<Functor>(functor), makeFromComponents<SRGBA<T>>(components));
-#if ENABLE(DESTINATION_COLOR_SPACE_LINEAR_SRGB)
-    case DestinationColorSpace::LinearSRGB:
-        return std::invoke(std::forward<Functor>(functor), makeFromComponents<LinearSRGBA<T>>(components));
-#endif
-#if ENABLE(DESTINATION_COLOR_SPACE_DISPLAY_P3)
-    case DestinationColorSpace::DisplayP3:
-        return std::invoke(std::forward<Functor>(functor), makeFromComponents<DisplayP3<T>>(components));
-#endif
-    }
</del><span class="cx"> 
</span><del>-    ASSERT_NOT_REACHED();
-    return std::invoke(std::forward<Functor>(functor), makeFromComponents<SRGBA<T>>(components));
-}
-
-
</del><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> namespace WTF {
</span><span class="lines">@@ -141,17 +108,4 @@
</span><span class="cx">     >;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-template<> struct EnumTraits<WebCore::DestinationColorSpace> {
-    using values = EnumValues<
-        WebCore::DestinationColorSpace,
-        WebCore::DestinationColorSpace::SRGB
-#if ENABLE(DESTINATION_COLOR_SPACE_LINEAR_SRGB)
-        , WebCore::DestinationColorSpace::LinearSRGB
-#endif
-#if ENABLE(DESTINATION_COLOR_SPACE_DISPLAY_P3)
-        , WebCore::DestinationColorSpace::DisplayP3
-#endif
-    >;
-};
-
</del><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsConcreteImageBufferh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ConcreteImageBuffer.h (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ConcreteImageBuffer.h     2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/platform/graphics/ConcreteImageBuffer.h        2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -34,7 +34,7 @@
</span><span class="cx"> class ConcreteImageBuffer : public ImageBuffer {
</span><span class="cx"> public:
</span><span class="cx">     template<typename ImageBufferType = ConcreteImageBuffer, typename... Arguments>
</span><del>-    static RefPtr<ImageBufferType> create(const FloatSize& size, float resolutionScale, DestinationColorSpace colorSpace, PixelFormat pixelFormat, const HostWindow* hostWindow, Arguments&&... arguments)
</del><ins>+    static RefPtr<ImageBufferType> create(const FloatSize& size, float resolutionScale, const DestinationColorSpace& colorSpace, PixelFormat pixelFormat, const HostWindow* hostWindow, Arguments&&... arguments)
</ins><span class="cx">     {
</span><span class="cx">         auto parameters = ImageBufferBackend::Parameters { size, resolutionScale, colorSpace, pixelFormat };
</span><span class="cx">         auto backend = BackendType::create(parameters, hostWindow);
</span><span class="lines">@@ -46,7 +46,7 @@
</span><span class="cx">     template<typename ImageBufferType = ConcreteImageBuffer, typename... Arguments>
</span><span class="cx">     static RefPtr<ImageBufferType> create(const FloatSize& size, const GraphicsContext& context, Arguments&&... arguments)
</span><span class="cx">     {
</span><del>-        auto parameters = ImageBufferBackend::Parameters { size, 1, DestinationColorSpace::SRGB, PixelFormat::BGRA8 };
</del><ins>+        auto parameters = ImageBufferBackend::Parameters { size, 1, DestinationColorSpace::SRGB(), PixelFormat::BGRA8 };
</ins><span class="cx">         auto backend = BackendType::create(parameters, context);
</span><span class="cx">         if (!backend)
</span><span class="cx">             return nullptr;
</span><span class="lines">@@ -195,7 +195,7 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    void transformColorSpace(DestinationColorSpace srcColorSpace, DestinationColorSpace destColorSpace) override
</del><ins>+    void transformColorSpace(const DestinationColorSpace& srcColorSpace, const DestinationColorSpace& destColorSpace) override
</ins><span class="cx">     {
</span><span class="cx">         if (auto* backend = ensureBackendCreated()) {
</span><span class="cx">             flushDrawingContext();
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsCrossfadeGeneratedImagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/CrossfadeGeneratedImage.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/CrossfadeGeneratedImage.cpp       2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/platform/graphics/CrossfadeGeneratedImage.cpp  2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -103,7 +103,7 @@
</span><span class="cx"> 
</span><span class="cx"> void CrossfadeGeneratedImage::drawPattern(GraphicsContext& context, const FloatRect& dstRect, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, const FloatSize& spacing, const ImagePaintingOptions& options)
</span><span class="cx"> {
</span><del>-    auto imageBuffer = ImageBuffer::create(size(), context.renderingMode(), 1, DestinationColorSpace::SRGB, PixelFormat::BGRA8);
</del><ins>+    auto imageBuffer = ImageBuffer::create(size(), context.renderingMode(), 1, DestinationColorSpace::SRGB(), PixelFormat::BGRA8);
</ins><span class="cx">     if (!imageBuffer)
</span><span class="cx">         return;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsDestinationColorSpacecpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/graphics/DestinationColorSpace.cpp (0 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/DestinationColorSpace.cpp                         (rev 0)
+++ trunk/Source/WebCore/platform/graphics/DestinationColorSpace.cpp    2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -0,0 +1,111 @@
</span><ins>+/*
+ * Copyright (C) 2021 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "DestinationColorSpace.h"
+
+#include <wtf/text/TextStream.h>
+
+#if USE(CG)
+#include "ColorSpaceCG.h"
+#include <pal/spi/cg/CoreGraphicsSPI.h>
+#endif
+
+namespace WebCore {
+
+DestinationColorSpace DestinationColorSpace::SRGB()
+{
+#if USE(CG)
+    return DestinationColorSpace(sRGBColorSpaceRef());
+#else
+    return DestinationColorSpace(PlatformColorSpace::Name::SRGB);
+#endif
+}
+
+#if ENABLE(DESTINATION_COLOR_SPACE_LINEAR_SRGB)
+DestinationColorSpace DestinationColorSpace::LinearSRGB()
+{
+#if USE(CG)
+    return DestinationColorSpace(linearSRGBColorSpaceRef());
+#else
+    return DestinationColorSpace(PlatformColorSpace::Name::LinearSRGB);
+#endif
+}
+#endif
+
+#if ENABLE(DESTINATION_COLOR_SPACE_DISPLAY_P3)
+DestinationColorSpace DestinationColorSpace::DisplayP3()
+{
+#if USE(CG)
+    return DestinationColorSpace(displayP3ColorSpaceRef());
+#else
+    return DestinationColorSpace(PlatformColorSpace::Name::DisplayP3);
+#endif
+}
+#endif
+
+DestinationColorSpace::DestinationColorSpace(PlatformColorSpace platformColorSpace)
+    : m_platformColorSpace { WTFMove(platformColorSpace) }
+{
+#if USE(CG)
+    ASSERT(m_platformColorSpace);
+#endif
+}
+
+bool operator==(const DestinationColorSpace& a, const DestinationColorSpace& b)
+{
+#if USE(CG)
+    return CGColorSpaceEqualToColorSpace(a.platformColorSpace(), b.platformColorSpace());
+#else
+    return a.platformColorSpace() == b.platformColorSpace();
+#endif
+}
+
+bool operator!=(const DestinationColorSpace& a, const DestinationColorSpace& b)
+{
+    return !(a == b);
+}
+
+TextStream& operator<<(TextStream& ts, const DestinationColorSpace& colorSpace)
+{
+    if (colorSpace == DestinationColorSpace::SRGB())
+        ts << "sRGB";
+#if ENABLE(DESTINATION_COLOR_SPACE_LINEAR_SRGB)
+    else if (colorSpace == DestinationColorSpace::LinearSRGB())
+        ts << "LinearSRGB";
+#endif
+#if ENABLE(DESTINATION_COLOR_SPACE_DISPLAY_P3)
+    else if (colorSpace == DestinationColorSpace::DisplayP3())
+        ts << "DisplayP3";
+#endif
+#if USE(CG)
+    else if (auto description = adoptCF(CGColorSpaceCopyICCProfileDescription(colorSpace.platformColorSpace())))
+        ts << String(description.get());
+#endif
+
+    return ts;
+}
+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsDestinationColorSpacehfromrev277985trunkSourceWebCorehtmlcanvasPredefinedColorSpacecpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/graphics/DestinationColorSpace.h (from rev 277985, trunk/Source/WebCore/html/canvas/PredefinedColorSpace.cpp) (0 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/DestinationColorSpace.h                           (rev 0)
+++ trunk/Source/WebCore/platform/graphics/DestinationColorSpace.h      2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -0,0 +1,74 @@
</span><ins>+/*
+ * Copyright (C) 2021 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include "PlatformColorSpace.h"
+#include <wtf/Forward.h>
+#include <wtf/Optional.h>
+
+namespace WebCore {
+
+class DestinationColorSpace {
+public:
+    WEBCORE_EXPORT static DestinationColorSpace SRGB();
+#if ENABLE(DESTINATION_COLOR_SPACE_LINEAR_SRGB)
+    WEBCORE_EXPORT static DestinationColorSpace LinearSRGB();
+#endif
+#if ENABLE(DESTINATION_COLOR_SPACE_DISPLAY_P3)
+    WEBCORE_EXPORT static DestinationColorSpace DisplayP3();
+#endif
+
+    WEBCORE_EXPORT explicit DestinationColorSpace(PlatformColorSpace);
+    PlatformColorSpaceValue platformColorSpace() const { return m_platformColorSpace.get(); }
+
+    template<class Encoder> void encode(Encoder&) const;
+    template<class Decoder> static Optional<DestinationColorSpace> decode(Decoder&);
+
+private:
+    PlatformColorSpace m_platformColorSpace;
+};
+
+WEBCORE_EXPORT bool operator==(const DestinationColorSpace&, const DestinationColorSpace&);
+WEBCORE_EXPORT bool operator!=(const DestinationColorSpace&, const DestinationColorSpace&);
+
+WEBCORE_EXPORT TextStream& operator<<(TextStream&, const DestinationColorSpace&);
+
+template<class Encoder> void DestinationColorSpace::encode(Encoder& encoder) const
+{
+    encoder << m_platformColorSpace;
+}
+
+template<class Decoder> Optional<DestinationColorSpace> DestinationColorSpace::decode(Decoder& decoder)
+{
+    Optional<PlatformColorSpace> platformColorSpace;
+    decoder >> platformColorSpace;
+    if (!platformColorSpace)
+        return WTF::nullopt;
+
+    return DestinationColorSpace { WTFMove(*platformColorSpace) };
+}
+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsGradientImagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/GradientImage.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/GradientImage.cpp 2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/platform/graphics/GradientImage.cpp    2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -72,7 +72,7 @@
</span><span class="cx">     unsigned generatorHash = m_gradient->hash();
</span><span class="cx"> 
</span><span class="cx">     if (!m_cachedImage || m_cachedGeneratorHash != generatorHash || m_cachedAdjustedSize != adjustedSize || !areEssentiallyEqual(destContext.scaleFactor(), m_cachedScaleFactor)) {
</span><del>-        auto imageBuffer = ImageBuffer::createCompatibleBuffer(adjustedSize, DestinationColorSpace::SRGB, destContext);
</del><ins>+        auto imageBuffer = ImageBuffer::createCompatibleBuffer(adjustedSize, DestinationColorSpace::SRGB(), destContext);
</ins><span class="cx">         if (!imageBuffer)
</span><span class="cx">             return;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsGraphicsContextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/GraphicsContext.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/GraphicsContext.cpp       2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/platform/graphics/GraphicsContext.cpp  2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -883,7 +883,7 @@
</span><span class="cx">     clipOut(path);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-GraphicsContext::ClipToDrawingCommandsResult GraphicsContext::clipToDrawingCommands(const FloatRect& destination, DestinationColorSpace colorSpace, Function<void(GraphicsContext&)>&& drawingFunction)
</del><ins>+GraphicsContext::ClipToDrawingCommandsResult GraphicsContext::clipToDrawingCommands(const FloatRect& destination, const DestinationColorSpace& colorSpace, Function<void(GraphicsContext&)>&& drawingFunction)
</ins><span class="cx"> {
</span><span class="cx">     if (paintingDisabled())
</span><span class="cx">         return ClipToDrawingCommandsResult::Success;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsGraphicsContexth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/GraphicsContext.h (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/GraphicsContext.h 2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/platform/graphics/GraphicsContext.h    2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -26,8 +26,8 @@
</span><span class="cx"> 
</span><span class="cx"> #pragma once
</span><span class="cx"> 
</span><del>-#include "ColorSpace.h"
</del><span class="cx"> #include "DashArray.h"
</span><ins>+#include "DestinationColorSpace.h"
</ins><span class="cx"> #include "FloatRect.h"
</span><span class="cx"> #include "FontCascade.h"
</span><span class="cx"> #include "GraphicsTypes.h"
</span><span class="lines">@@ -410,7 +410,7 @@
</span><span class="cx">     void clipToImageBuffer(ImageBuffer&, const FloatRect&);
</span><span class="cx"> 
</span><span class="cx">     enum class ClipToDrawingCommandsResult : bool { Success, FailedToCreateImageBuffer };
</span><del>-    ClipToDrawingCommandsResult clipToDrawingCommands(const FloatRect& destination, DestinationColorSpace, Function<void(GraphicsContext&)>&&);
</del><ins>+    ClipToDrawingCommandsResult clipToDrawingCommands(const FloatRect& destination, const DestinationColorSpace&, Function<void(GraphicsContext&)>&&);
</ins><span class="cx">     
</span><span class="cx">     IntRect clipBounds() const;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsGraphicsContextImplh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/GraphicsContextImpl.h (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/GraphicsContextImpl.h     2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/platform/graphics/GraphicsContextImpl.h        2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -104,7 +104,7 @@
</span><span class="cx">     virtual void clipPath(const Path&, WindRule) = 0;
</span><span class="cx">     virtual IntRect clipBounds() = 0;
</span><span class="cx">     virtual void clipToImageBuffer(ImageBuffer&, const FloatRect&) = 0;
</span><del>-    virtual void clipToDrawingCommands(const FloatRect& destination, DestinationColorSpace, Function<void(GraphicsContext&)>&& drawingFunction) = 0;
</del><ins>+    virtual void clipToDrawingCommands(const FloatRect& destination, const DestinationColorSpace&, Function<void(GraphicsContext&)>&& drawingFunction) = 0;
</ins><span class="cx"> #if ENABLE(VIDEO)
</span><span class="cx">     virtual void paintFrameForMedia(MediaPlayer&, const FloatRect& destination) = 0;
</span><span class="cx">     virtual bool canPaintFrameForMedia(const MediaPlayer&) const = 0;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsImageBuffercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ImageBuffer.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ImageBuffer.cpp   2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/platform/graphics/ImageBuffer.cpp      2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -37,7 +37,7 @@
</span><span class="cx"> static const float MaxClampedLength = 4096;
</span><span class="cx"> static const float MaxClampedArea = MaxClampedLength * MaxClampedLength;
</span><span class="cx"> 
</span><del>-RefPtr<ImageBuffer> ImageBuffer::create(const FloatSize& size, RenderingMode renderingMode, ShouldUseDisplayList shouldUseDisplayList, RenderingPurpose purpose, float resolutionScale, DestinationColorSpace colorSpace, PixelFormat pixelFormat, const HostWindow* hostWindow)
</del><ins>+RefPtr<ImageBuffer> ImageBuffer::create(const FloatSize& size, RenderingMode renderingMode, ShouldUseDisplayList shouldUseDisplayList, RenderingPurpose purpose, float resolutionScale, const DestinationColorSpace& colorSpace, PixelFormat pixelFormat, const HostWindow* hostWindow)
</ins><span class="cx"> {
</span><span class="cx">     RefPtr<ImageBuffer> imageBuffer;
</span><span class="cx">     
</span><span class="lines">@@ -59,7 +59,7 @@
</span><span class="cx">     return imageBuffer;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr<ImageBuffer> ImageBuffer::create(const FloatSize& size, RenderingMode renderingMode, float resolutionScale, DestinationColorSpace colorSpace, PixelFormat pixelFormat, const HostWindow* hostWindow)
</del><ins>+RefPtr<ImageBuffer> ImageBuffer::create(const FloatSize& size, RenderingMode renderingMode, float resolutionScale, const DestinationColorSpace& colorSpace, PixelFormat pixelFormat, const HostWindow* hostWindow)
</ins><span class="cx"> {
</span><span class="cx">     RefPtr<ImageBuffer> imageBuffer;
</span><span class="cx">     
</span><span class="lines">@@ -95,7 +95,7 @@
</span><span class="cx">     return imageBuffer;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr<ImageBuffer> ImageBuffer::createCompatibleBuffer(const FloatSize& size, DestinationColorSpace colorSpace, const GraphicsContext& context)
</del><ins>+RefPtr<ImageBuffer> ImageBuffer::createCompatibleBuffer(const FloatSize& size, const DestinationColorSpace& colorSpace, const GraphicsContext& context)
</ins><span class="cx"> {
</span><span class="cx">     if (size.isEmpty())
</span><span class="cx">         return nullptr;
</span><span class="lines">@@ -111,7 +111,7 @@
</span><span class="cx">     return imageBuffer;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr<ImageBuffer> ImageBuffer::createCompatibleBuffer(const FloatSize& size, float resolutionScale, DestinationColorSpace colorSpace, const GraphicsContext& context)
</del><ins>+RefPtr<ImageBuffer> ImageBuffer::createCompatibleBuffer(const FloatSize& size, float resolutionScale, const DestinationColorSpace& colorSpace, const GraphicsContext& context)
</ins><span class="cx"> {
</span><span class="cx">     return ImageBuffer::create(size, context.renderingMode(), resolutionScale, colorSpace, PixelFormat::BGRA8);
</span><span class="cx"> }
</span><span class="lines">@@ -167,7 +167,7 @@
</span><span class="cx">     return expandedIntSize(size * context.scaleFactor());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr<ImageBuffer> ImageBuffer::copyRectToBuffer(const FloatRect& rect, DestinationColorSpace colorSpace, const GraphicsContext& context)
</del><ins>+RefPtr<ImageBuffer> ImageBuffer::copyRectToBuffer(const FloatRect& rect, const DestinationColorSpace& colorSpace, const GraphicsContext& context)
</ins><span class="cx"> {
</span><span class="cx">     if (rect.isEmpty())
</span><span class="cx">         return nullptr;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsImageBufferh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ImageBuffer.h (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ImageBuffer.h     2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/platform/graphics/ImageBuffer.h        2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -45,13 +45,13 @@
</span><span class="cx"> class ImageBuffer : public ThreadSafeRefCounted<ImageBuffer>, public CanMakeWeakPtr<ImageBuffer> {
</span><span class="cx"> public:
</span><span class="cx">     // Will return a null pointer on allocation failure.
</span><del>-    WEBCORE_EXPORT static RefPtr<ImageBuffer> create(const FloatSize&, RenderingMode, ShouldUseDisplayList, RenderingPurpose, float resolutionScale, DestinationColorSpace, PixelFormat, const HostWindow* = nullptr);
-    WEBCORE_EXPORT static RefPtr<ImageBuffer> create(const FloatSize&, RenderingMode, float resolutionScale, DestinationColorSpace, PixelFormat, const HostWindow* = nullptr);
</del><ins>+    WEBCORE_EXPORT static RefPtr<ImageBuffer> create(const FloatSize&, RenderingMode, ShouldUseDisplayList, RenderingPurpose, float resolutionScale, const DestinationColorSpace&, PixelFormat, const HostWindow* = nullptr);
+    WEBCORE_EXPORT static RefPtr<ImageBuffer> create(const FloatSize&, RenderingMode, float resolutionScale, const DestinationColorSpace&, PixelFormat, const HostWindow* = nullptr);
</ins><span class="cx"> 
</span><span class="cx">     // Create an image buffer compatible with the context, with suitable resolution for drawing into the buffer and then into this context.
</span><span class="cx">     static RefPtr<ImageBuffer> createCompatibleBuffer(const FloatSize&, const GraphicsContext&);
</span><del>-    static RefPtr<ImageBuffer> createCompatibleBuffer(const FloatSize&, DestinationColorSpace, const GraphicsContext&);
-    static RefPtr<ImageBuffer> createCompatibleBuffer(const FloatSize&, float resolutionScale, DestinationColorSpace, const GraphicsContext&);
</del><ins>+    static RefPtr<ImageBuffer> createCompatibleBuffer(const FloatSize&, const DestinationColorSpace&, const GraphicsContext&);
+    static RefPtr<ImageBuffer> createCompatibleBuffer(const FloatSize&, float resolutionScale, const DestinationColorSpace&, const GraphicsContext&);
</ins><span class="cx"> 
</span><span class="cx">     // These functions are used when clamping the ImageBuffer which is created for filter, masker or clipper.
</span><span class="cx">     static bool sizeNeedsClamping(const FloatSize&);
</span><span class="lines">@@ -107,7 +107,7 @@
</span><span class="cx">     virtual RefPtr<Image> copyImage(BackingStoreCopy = CopyBackingStore, PreserveResolution = PreserveResolution::No) const = 0;
</span><span class="cx"> 
</span><span class="cx">     // Create an image buffer compatible with the context and copy rect from this buffer into this new one.
</span><del>-    RefPtr<ImageBuffer> copyRectToBuffer(const FloatRect&, DestinationColorSpace, const GraphicsContext&);
</del><ins>+    RefPtr<ImageBuffer> copyRectToBuffer(const FloatRect&, const DestinationColorSpace&, const GraphicsContext&);
</ins><span class="cx"> 
</span><span class="cx">     virtual void draw(GraphicsContext&, const FloatRect& destRect, const FloatRect& srcRect = FloatRect(0, 0, -1, -1), const ImagePaintingOptions& = { }) = 0;
</span><span class="cx">     virtual void drawPattern(GraphicsContext&, const FloatRect& destRect, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, const FloatSize& spacing, const ImagePaintingOptions& = { }) = 0;
</span><span class="lines">@@ -120,7 +120,7 @@
</span><span class="cx">     virtual void clipToMask(GraphicsContext&, const FloatRect& destRect) = 0;
</span><span class="cx"> 
</span><span class="cx">     virtual void convertToLuminanceMask() = 0;
</span><del>-    virtual void transformColorSpace(DestinationColorSpace srcColorSpace, DestinationColorSpace dstColorSpace) = 0;
</del><ins>+    virtual void transformColorSpace(const DestinationColorSpace& srcColorSpace, const DestinationColorSpace& dstColorSpace) = 0;
</ins><span class="cx"> 
</span><span class="cx">     virtual String toDataURL(const String& mimeType, Optional<double> quality = WTF::nullopt, PreserveResolution = PreserveResolution::No) const = 0;
</span><span class="cx">     virtual Vector<uint8_t> toData(const String& mimeType, Optional<double> quality = WTF::nullopt) const = 0;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsImageBufferBackendcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ImageBufferBackend.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ImageBufferBackend.cpp    2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/platform/graphics/ImageBufferBackend.cpp       2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -53,6 +53,8 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+ImageBufferBackend::~ImageBufferBackend() = default;
+
</ins><span class="cx"> RefPtr<NativeImage> ImageBufferBackend::sinkIntoNativeImage()
</span><span class="cx"> {
</span><span class="cx">     return copyNativeImage(DontCopyBackingStore);
</span><span class="lines">@@ -114,15 +116,17 @@
</span><span class="cx">     if (destinationRect.size() != sourceRectScaled.size())
</span><span class="cx">         pixelBuffer->data().zeroFill();
</span><span class="cx"> 
</span><del>-    ConstPixelBufferConversionView source;
-    source.format = { AlphaPremultiplication::Premultiplied, pixelFormat(), colorSpace() };
-    source.bytesPerRow = bytesPerRow();
-    source.rows = reinterpret_cast<uint8_t*>(data) + sourceRectClipped.y() * source.bytesPerRow + sourceRectClipped.x() * 4;
</del><ins>+    ConstPixelBufferConversionView source {
+        { AlphaPremultiplication::Premultiplied, pixelFormat(), colorSpace() },
+        bytesPerRow(),
+        reinterpret_cast<uint8_t*>(data) + sourceRectClipped.y() * source.bytesPerRow + sourceRectClipped.x() * 4
+    };
</ins><span class="cx">     
</span><del>-    PixelBufferConversionView destination;
-    destination.format = destinationFormat;
-    destination.bytesPerRow = 4 * sourceRectScaled.width();
-    destination.rows = pixelBuffer->data().data() + destinationRect.y() * destination.bytesPerRow + destinationRect.x() * 4;
</del><ins>+    PixelBufferConversionView destination {
+        destinationFormat,
+        static_cast<unsigned>(4 * sourceRectScaled.width()),
+        pixelBuffer->data().data() + destinationRect.y() * destination.bytesPerRow + destinationRect.x() * 4
+    };
</ins><span class="cx"> 
</span><span class="cx">     convertImagePixels(source, destination, destinationRect.size());
</span><span class="cx"> 
</span><span class="lines">@@ -147,15 +151,17 @@
</span><span class="cx">     destinationRect.intersect(backendRect());
</span><span class="cx">     sourceRectClipped.setSize(destinationRect.size());
</span><span class="cx"> 
</span><del>-    ConstPixelBufferConversionView source;
-    source.format = sourcePixelBuffer.format();
-    source.bytesPerRow = 4 * sourcePixelBuffer.size().width();
-    source.rows = sourcePixelBuffer.data().data() + sourceRectClipped.y() * source.bytesPerRow + sourceRectClipped.x() * 4;
</del><ins>+    ConstPixelBufferConversionView source {
+        sourcePixelBuffer.format(),
+        static_cast<unsigned>(4 * sourcePixelBuffer.size().width()),
+        sourcePixelBuffer.data().data() + sourceRectClipped.y() * source.bytesPerRow + sourceRectClipped.x() * 4
+    };
</ins><span class="cx"> 
</span><del>-    PixelBufferConversionView destination;
-    destination.format = { destinationAlphaFormat, pixelFormat(), colorSpace() };
-    destination.bytesPerRow = bytesPerRow();
-    destination.rows = reinterpret_cast<uint8_t*>(data) + destinationRect.y() * destination.bytesPerRow + destinationRect.x() * 4;
</del><ins>+    PixelBufferConversionView destination {
+        { destinationAlphaFormat, pixelFormat(), colorSpace() },
+        bytesPerRow(),
+        reinterpret_cast<uint8_t*>(data) + destinationRect.y() * destination.bytesPerRow + destinationRect.x() * 4
+    };
</ins><span class="cx"> 
</span><span class="cx">     convertImagePixels(source, destination, destinationRect.size());
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsImageBufferBackendh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ImageBufferBackend.h (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ImageBufferBackend.h      2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/platform/graphics/ImageBufferBackend.h 2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -25,7 +25,7 @@
</span><span class="cx"> 
</span><span class="cx"> #pragma once
</span><span class="cx"> 
</span><del>-#include "ColorSpace.h"
</del><ins>+#include "DestinationColorSpace.h"
</ins><span class="cx"> #include "FloatRect.h"
</span><span class="cx"> #include "GraphicsTypesGL.h"
</span><span class="cx"> #include "ImagePaintingOptions.h"
</span><span class="lines">@@ -78,7 +78,7 @@
</span><span class="cx">         PixelFormat pixelFormat;
</span><span class="cx">     };
</span><span class="cx"> 
</span><del>-    WEBCORE_EXPORT virtual ~ImageBufferBackend() = default;
</del><ins>+    WEBCORE_EXPORT virtual ~ImageBufferBackend();
</ins><span class="cx"> 
</span><span class="cx">     WEBCORE_EXPORT static IntSize calculateBackendSize(const Parameters&);
</span><span class="cx">     WEBCORE_EXPORT static size_t calculateMemoryCost(const IntSize& backendSize, unsigned bytesPerRow);
</span><span class="lines">@@ -102,7 +102,7 @@
</span><span class="cx">     virtual void clipToMask(GraphicsContext&, const FloatRect&) { }
</span><span class="cx"> 
</span><span class="cx">     WEBCORE_EXPORT void convertToLuminanceMask();
</span><del>-    virtual void transformColorSpace(DestinationColorSpace, DestinationColorSpace) { }
</del><ins>+    virtual void transformColorSpace(const DestinationColorSpace&, const DestinationColorSpace&) { }
</ins><span class="cx"> 
</span><span class="cx">     virtual String toDataURL(const String& mimeType, Optional<double> quality, PreserveResolution) const = 0;
</span><span class="cx">     virtual Vector<uint8_t> toData(const String& mimeType, Optional<double> quality) const = 0;
</span><span class="lines">@@ -140,7 +140,7 @@
</span><span class="cx"> 
</span><span class="cx">     IntSize logicalSize() const { return IntSize(m_parameters.logicalSize); }
</span><span class="cx">     float resolutionScale() const { return m_parameters.resolutionScale; }
</span><del>-    DestinationColorSpace colorSpace() const { return m_parameters.colorSpace; }
</del><ins>+    const DestinationColorSpace& colorSpace() const { return m_parameters.colorSpace; }
</ins><span class="cx">     PixelFormat pixelFormat() const { return m_parameters.pixelFormat; }
</span><span class="cx"> 
</span><span class="cx">     IntRect logicalRect() const { return IntRect(IntPoint::zero(), logicalSize()); };
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsPixelBuffercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/PixelBuffer.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/PixelBuffer.cpp   2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/platform/graphics/PixelBuffer.cpp      2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -42,6 +42,9 @@
</span><span class="cx">     case PixelFormat::RGB10A8:
</span><span class="cx">         return false;
</span><span class="cx">     }
</span><ins>+    
+    ASSERT_NOT_REACHED();
+    return false;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> Checked<unsigned, RecordOverflow> PixelBuffer::computeBufferSize(const PixelBufferFormat& format, const IntSize& size)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsPixelBufferh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/PixelBuffer.h (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/PixelBuffer.h     2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/platform/graphics/PixelBuffer.h        2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -26,7 +26,7 @@
</span><span class="cx"> #pragma once
</span><span class="cx"> 
</span><span class="cx"> #include "AlphaPremultiplication.h"
</span><del>-#include "ColorSpace.h"
</del><ins>+#include "DestinationColorSpace.h"
</ins><span class="cx"> #include "IntSize.h"
</span><span class="cx"> #include "PixelBufferFormat.h"
</span><span class="cx"> #include "PixelFormat.h"
</span><span class="lines">@@ -87,19 +87,21 @@
</span><span class="cx"> 
</span><span class="cx"> template<class Decoder> Optional<PixelBuffer> PixelBuffer::decode(Decoder& decoder)
</span><span class="cx"> {
</span><del>-    PixelBufferFormat format;
-    if (!decoder.decode(format))
</del><ins>+    Optional<PixelBufferFormat> format;
+    decoder >> format;
+    if (!format)
</ins><span class="cx">         return WTF::nullopt;
</span><span class="cx"> 
</span><span class="cx">     // FIXME: Support non-8 bit formats.
</span><del>-    if (!(format.pixelFormat == PixelFormat::RGBA8 || format.pixelFormat == PixelFormat::BGRA8))
</del><ins>+    if (!(format->pixelFormat == PixelFormat::RGBA8 || format->pixelFormat == PixelFormat::BGRA8))
</ins><span class="cx">         return WTF::nullopt;
</span><span class="cx"> 
</span><del>-    IntSize size;
-    if (!decoder.decode(size))
</del><ins>+    Optional<IntSize> size;
+    decoder >> size;
+    if (!size)
</ins><span class="cx">         return WTF::nullopt;
</span><span class="cx"> 
</span><del>-    auto computedBufferSize = PixelBuffer::computeBufferSize(format, size);
</del><ins>+    auto computedBufferSize = PixelBuffer::computeBufferSize(*format, *size);
</ins><span class="cx">     if (computedBufferSize.hasOverflowed())
</span><span class="cx">         return WTF::nullopt;
</span><span class="cx"> 
</span><span class="lines">@@ -107,7 +109,7 @@
</span><span class="cx">     if (!decoder.template bufferIsLargeEnoughToContain<uint8_t>(bufferSize))
</span><span class="cx">         return WTF::nullopt;
</span><span class="cx"> 
</span><del>-    auto result = PixelBuffer::tryCreateForDecoding(format, size, bufferSize);
</del><ins>+    auto result = PixelBuffer::tryCreateForDecoding(WTFMove(*format), *size, bufferSize);
</ins><span class="cx">     if (!result)
</span><span class="cx">         return WTF::nullopt;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsPixelBufferConversioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/PixelBufferConversion.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/PixelBufferConversion.cpp 2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/platform/graphics/PixelBufferConversion.cpp    2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -27,12 +27,11 @@
</span><span class="cx"> #include "PixelBufferConversion.h"
</span><span class="cx"> 
</span><span class="cx"> #include "AlphaPremultiplication.h"
</span><del>-#include "ColorSpace.h"
</del><ins>+#include "DestinationColorSpace.h"
</ins><span class="cx"> #include "IntSize.h"
</span><span class="cx"> #include "PixelFormat.h"
</span><span class="cx"> 
</span><span class="cx"> #if USE(ACCELERATE) && USE(CG)
</span><del>-#include "ColorSpaceCG.h"
</del><span class="cx"> #include <Accelerate/Accelerate.h>
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="lines">@@ -71,7 +70,7 @@
</span><span class="cx"> 
</span><span class="cx">     result.bitsPerComponent = bitsPerComponent;
</span><span class="cx">     result.bitsPerPixel = bitsPerPixel;
</span><del>-    result.colorSpace = cachedCGColorSpace(format.colorSpace);
</del><ins>+    result.colorSpace = format.colorSpace.platformColorSpace();
</ins><span class="cx">     result.bitmapInfo = bitmapInfo;
</span><span class="cx">     result.version = 0;
</span><span class="cx">     result.decode = nullptr;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsPixelBufferFormath"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/PixelBufferFormat.h (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/PixelBufferFormat.h       2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/platform/graphics/PixelBufferFormat.h  2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -26,7 +26,7 @@
</span><span class="cx"> #pragma once
</span><span class="cx"> 
</span><span class="cx"> #include "AlphaPremultiplication.h"
</span><del>-#include "ColorSpace.h"
</del><ins>+#include "DestinationColorSpace.h"
</ins><span class="cx"> #include "PixelFormat.h"
</span><span class="cx"> #include <wtf/Forward.h>
</span><span class="cx"> #include <wtf/Optional.h>
</span><span class="lines">@@ -51,19 +51,22 @@
</span><span class="cx"> 
</span><span class="cx"> template<class Decoder> Optional<PixelBufferFormat> PixelBufferFormat::decode(Decoder& decoder)
</span><span class="cx"> {
</span><del>-    AlphaPremultiplication alphaFormat;
-    if (!decoder.decode(alphaFormat))
</del><ins>+    Optional<AlphaPremultiplication> alphaFormat;
+    decoder >> alphaFormat;
+    if (!alphaFormat)
</ins><span class="cx">         return WTF::nullopt;
</span><span class="cx"> 
</span><del>-    PixelFormat pixelFormat;
-    if (!decoder.decode(pixelFormat))
</del><ins>+    Optional<PixelFormat> pixelFormat;
+    decoder >> pixelFormat;
+    if (!pixelFormat)
</ins><span class="cx">         return WTF::nullopt;
</span><span class="cx"> 
</span><del>-    DestinationColorSpace colorSpace;
-    if (!decoder.decode(colorSpace))
</del><ins>+    Optional<DestinationColorSpace> colorSpace;
+    decoder >> colorSpace;
+    if (!colorSpace)
</ins><span class="cx">         return WTF::nullopt;
</span><span class="cx"> 
</span><del>-    return { { alphaFormat, pixelFormat, colorSpace } };
</del><ins>+    return { { WTFMove(*alphaFormat), WTFMove(*pixelFormat), WTFMove(*colorSpace) } };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsPlatformColorSpacehfromrev277985trunkSourceWebCorehtmlcanvasPredefinedColorSpacecpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/graphics/PlatformColorSpace.h (from rev 277985, trunk/Source/WebCore/html/canvas/PredefinedColorSpace.cpp) (0 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/PlatformColorSpace.h                              (rev 0)
+++ trunk/Source/WebCore/platform/graphics/PlatformColorSpace.h 2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -0,0 +1,112 @@
</span><ins>+/*
+ * Copyright (C) 2021 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if USE(CG)
+#include <wtf/RetainPtr.h>
+typedef struct CGColorSpace* CGColorSpaceRef;
+#else
+#include <wtf/EnumTraits.h>
+#include <wtf/Optional.h>
+#endif
+
+namespace WebCore {
+
+#if USE(CG)
+
+using PlatformColorSpace = RetainPtr<CGColorSpaceRef>;
+using PlatformColorSpaceValue = CGColorSpaceRef;
+
+#else
+
+class PlatformColorSpace {
+public:
+    enum class Name : uint8_t {
+        SRGB
+#if ENABLE(DESTINATION_COLOR_SPACE_LINEAR_SRGB)
+        , LinearSRGB
+#endif
+#if ENABLE(DESTINATION_COLOR_SPACE_DISPLAY_P3)
+        , DisplayP3
+#endif
+    };
+
+    PlatformColorSpace(Name name)
+        : m_name { name }
+    {
+    }
+
+    Name get() const { return m_name; }
+
+    template<class Encoder> void encode(Encoder&) const;
+    template<class Decoder> static Optional<PlatformColorSpace> decode(Decoder&);
+
+private:
+    Name m_name;
+
+};
+using PlatformColorSpaceValue = PlatformColorSpace::Name;
+
+template<class Encoder> void PlatformColorSpace::encode(Encoder& encoder) const
+{
+    encoder << m_name;
+}
+
+template<class Decoder> Optional<PlatformColorSpace> PlatformColorSpace::decode(Decoder& decoder)
+{
+    Optional<PlatformColorSpace::Name> name;
+    decoder >> name;
+    if (!name)
+        return WTF::nullopt;
+
+    return { { *name } };
+}
+
+#endif
+
+}
+
+namespace WTF {
+
+#if !USE(CG)
+
+template<> struct EnumTraits<WebCore::PlatformColorSpace::Name> {
+    using values = EnumValues<
+        WebCore::PlatformColorSpace::Name,
+        WebCore::PlatformColorSpace::Name::SRGB
+#if ENABLE(DESTINATION_COLOR_SPACE_LINEAR_SRGB)
+        , WebCore::PlatformColorSpace::Name::LinearSRGB
+#endif
+#if ENABLE(DESTINATION_COLOR_SPACE_DISPLAY_P3)
+        , WebCore::PlatformColorSpace::Name::DisplayP3
+#endif
+    >;
+};
+
+#endif
+
+} // namespace WTF
+
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsRemoteVideoSamplecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/RemoteVideoSample.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/RemoteVideoSample.cpp     2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/platform/graphics/RemoteVideoSample.cpp        2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -56,7 +56,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     IntSize size { static_cast<int>(CVPixelBufferGetWidth(pixelBuffer)), static_cast<int>(CVPixelBufferGetHeight(pixelBuffer)) };
</span><del>-    auto ioSurface =  IOSurface::create(size, sRGBColorSpaceRef(), IOSurface::Format::BGRA);
</del><ins>+    auto ioSurface = IOSurface::create(size, DestinationColorSpace::SRGB(), IOSurface::Format::BGRA);
</ins><span class="cx"> 
</span><span class="cx">     IOSurface::Locker lock(*ioSurface);
</span><span class="cx">     vImage_Buffer src;
</span><span class="lines">@@ -113,7 +113,7 @@
</span><span class="cx">         surface = ioSurface->surface();
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    return std::unique_ptr<RemoteVideoSample>(new RemoteVideoSample(surface, sRGBColorSpaceRef(), sample.presentationTime(), sample.videoRotation(), sample.videoMirrored()));
</del><ins>+    return std::unique_ptr<RemoteVideoSample>(new RemoteVideoSample(surface, DestinationColorSpace::SRGB(), sample.presentationTime(), sample.videoRotation(), sample.videoMirrored()));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> std::unique_ptr<RemoteVideoSample> RemoteVideoSample::create(CVPixelBufferRef imageBuffer, MediaTime&& presentationTime, MediaSample::VideoRotation rotation)
</span><span class="lines">@@ -124,10 +124,10 @@
</span><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    return std::unique_ptr<RemoteVideoSample>(new RemoteVideoSample(surface, sRGBColorSpaceRef(), WTFMove(presentationTime), rotation, false));
</del><ins>+    return std::unique_ptr<RemoteVideoSample>(new RemoteVideoSample(surface, DestinationColorSpace::SRGB(), WTFMove(presentationTime), rotation, false));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-RemoteVideoSample::RemoteVideoSample(IOSurfaceRef surface, CGColorSpaceRef colorSpace, MediaTime&& time, MediaSample::VideoRotation rotation, bool mirrored)
</del><ins>+RemoteVideoSample::RemoteVideoSample(IOSurfaceRef surface, const DestinationColorSpace& colorSpace, MediaTime&& time, MediaSample::VideoRotation rotation, bool mirrored)
</ins><span class="cx">     : m_ioSurface(WebCore::IOSurface::createFromSurface(surface, colorSpace))
</span><span class="cx">     , m_rotation(rotation)
</span><span class="cx">     , m_time(WTFMove(time))
</span><span class="lines">@@ -140,7 +140,7 @@
</span><span class="cx"> IOSurfaceRef RemoteVideoSample::surface() const
</span><span class="cx"> {
</span><span class="cx">     if (!m_ioSurface && m_sendRight)
</span><del>-        const_cast<RemoteVideoSample*>(this)->m_ioSurface = WebCore::IOSurface::createFromSendRight(WTFMove(const_cast<RemoteVideoSample*>(this)->m_sendRight), sRGBColorSpaceRef());
</del><ins>+        const_cast<RemoteVideoSample*>(this)->m_ioSurface = WebCore::IOSurface::createFromSendRight(WTFMove(const_cast<RemoteVideoSample*>(this)->m_sendRight), DestinationColorSpace::SRGB());
</ins><span class="cx"> 
</span><span class="cx">     return m_ioSurface ? m_ioSurface->surface() : nullptr;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsRemoteVideoSampleh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/RemoteVideoSample.h (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/RemoteVideoSample.h       2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/platform/graphics/RemoteVideoSample.h  2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -103,7 +103,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    RemoteVideoSample(IOSurfaceRef, CGColorSpaceRef, MediaTime&&, MediaSample::VideoRotation, bool);
</del><ins>+    RemoteVideoSample(IOSurfaceRef, const DestinationColorSpace&, MediaTime&&, MediaSample::VideoRotation, bool);
</ins><span class="cx"> 
</span><span class="cx">     std::unique_ptr<WebCore::IOSurface> m_ioSurface;
</span><span class="cx">     WTF::MachSendRight m_sendRight;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsShadowBlurcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ShadowBlur.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ShadowBlur.cpp    2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/platform/graphics/ShadowBlur.cpp       2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -85,7 +85,7 @@
</span><span class="cx">         clearScratchBuffer();
</span><span class="cx"> 
</span><span class="cx">         // ShadowBlur is not used with accelerated drawing, so it's OK to make an unconditionally unaccelerated buffer.
</span><del>-        m_imageBuffer = ImageBuffer::create(roundedSize, RenderingMode::Unaccelerated, 1, DestinationColorSpace::SRGB, PixelFormat::BGRA8);
</del><ins>+        m_imageBuffer = ImageBuffer::create(roundedSize, RenderingMode::Unaccelerated, 1, DestinationColorSpace::SRGB(), PixelFormat::BGRA8);
</ins><span class="cx">         return m_imageBuffer;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -604,7 +604,7 @@
</span><span class="cx"> 
</span><span class="cx"> void ShadowBlur::drawRectShadowWithoutTiling(const AffineTransform&, const FloatRoundedRect& shadowedRect, const LayerImageProperties& layerImageProperties, const DrawBufferCallback& drawBuffer)
</span><span class="cx"> {
</span><del>-    auto layerImage = ImageBuffer::create(expandedIntSize(layerImageProperties.layerSize), RenderingMode::Unaccelerated, 1, DestinationColorSpace::SRGB, PixelFormat::BGRA8);
</del><ins>+    auto layerImage = ImageBuffer::create(expandedIntSize(layerImageProperties.layerSize), RenderingMode::Unaccelerated, 1, DestinationColorSpace::SRGB(), PixelFormat::BGRA8);
</ins><span class="cx">     if (!layerImage)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="lines">@@ -632,7 +632,7 @@
</span><span class="cx"> 
</span><span class="cx"> void ShadowBlur::drawInsetShadowWithoutTiling(const AffineTransform&, const FloatRect& fullRect, const FloatRoundedRect& holeRect, const LayerImageProperties& layerImageProperties, const DrawBufferCallback& drawBuffer)
</span><span class="cx"> {
</span><del>-    auto layerImage = ImageBuffer::create(expandedIntSize(layerImageProperties.layerSize), RenderingMode::Unaccelerated, 1, DestinationColorSpace::SRGB, PixelFormat::BGRA8);
</del><ins>+    auto layerImage = ImageBuffer::create(expandedIntSize(layerImageProperties.layerSize), RenderingMode::Unaccelerated, 1, DestinationColorSpace::SRGB(), PixelFormat::BGRA8);
</ins><span class="cx">     if (!layerImage)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="lines">@@ -708,7 +708,7 @@
</span><span class="cx">     UNUSED_PARAM(layerImageProperties);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    if (auto layerImageBuffer = ImageBuffer::create(templateSize, RenderingMode::Unaccelerated, 1, DestinationColorSpace::SRGB, PixelFormat::BGRA8))
</del><ins>+    if (auto layerImageBuffer = ImageBuffer::create(templateSize, RenderingMode::Unaccelerated, 1, DestinationColorSpace::SRGB(), PixelFormat::BGRA8))
</ins><span class="cx">         drawRectShadowWithTilingWithLayerImageBuffer(*layerImageBuffer, transform, shadowedRect, templateSize, edgeSize, drawImage, fillRect, templateShadow);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -762,7 +762,7 @@
</span><span class="cx">     }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    if (auto layerImageBuffer = ImageBuffer::create(templateSize, RenderingMode::Unaccelerated, 1, DestinationColorSpace::SRGB, PixelFormat::BGRA8))
</del><ins>+    if (auto layerImageBuffer = ImageBuffer::create(templateSize, RenderingMode::Unaccelerated, 1, DestinationColorSpace::SRGB(), PixelFormat::BGRA8))
</ins><span class="cx">         drawInsetShadowWithTilingWithLayerImageBuffer(*layerImageBuffer, transform, fullRect, holeRect, templateSize, edgeSize, drawImage, fillRectWithHole, templateBounds, templateHole);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -891,7 +891,7 @@
</span><span class="cx">     if (m_type != BlurShadow)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    PixelBufferFormat format { AlphaPremultiplication::Unpremultiplied, PixelFormat::RGBA8, DestinationColorSpace::SRGB };
</del><ins>+    PixelBufferFormat format { AlphaPremultiplication::Unpremultiplied, PixelFormat::RGBA8, DestinationColorSpace::SRGB() };
</ins><span class="cx">     IntRect blurRect(IntPoint(), templateSize);
</span><span class="cx">     auto layerData = layerImage.getPixelBuffer(format, blurRect);
</span><span class="cx">     if (!layerData)
</span><span class="lines">@@ -921,7 +921,7 @@
</span><span class="cx"> 
</span><span class="cx">     adjustBlurRadius(transform);
</span><span class="cx"> 
</span><del>-    auto layerImage = ImageBuffer::create(expandedIntSize(layerImageProperties->layerSize), RenderingMode::Unaccelerated, 1, DestinationColorSpace::SRGB, PixelFormat::BGRA8);
</del><ins>+    auto layerImage = ImageBuffer::create(expandedIntSize(layerImageProperties->layerSize), RenderingMode::Unaccelerated, 1, DestinationColorSpace::SRGB(), PixelFormat::BGRA8);
</ins><span class="cx">     if (!layerImage)
</span><span class="cx">         return;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsangleGraphicsContextGLANGLEcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/angle/GraphicsContextGLANGLE.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/angle/GraphicsContextGLANGLE.cpp  2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/platform/graphics/angle/GraphicsContextGLANGLE.cpp     2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -79,7 +79,7 @@
</span><span class="cx"> 
</span><span class="cx"> Optional<PixelBuffer> GraphicsContextGLOpenGL::readPixelsForPaintResults()
</span><span class="cx"> {
</span><del>-    PixelBufferFormat format { AlphaPremultiplication::Unpremultiplied, PixelFormat::RGBA8, DestinationColorSpace::SRGB };
</del><ins>+    PixelBufferFormat format { AlphaPremultiplication::Unpremultiplied, PixelFormat::RGBA8, DestinationColorSpace::SRGB() };
</ins><span class="cx">     auto pixelBuffer = PixelBuffer::tryCreate(format, getInternalFramebufferSize());
</span><span class="cx">     if (!pixelBuffer)
</span><span class="cx">         return WTF::nullopt;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscairoGraphicsContextImplCairocpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cairo/GraphicsContextImplCairo.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cairo/GraphicsContextImplCairo.cpp        2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/platform/graphics/cairo/GraphicsContextImplCairo.cpp   2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -414,7 +414,7 @@
</span><span class="cx">     return Cairo::State::roundToDevicePixels(m_platformContext, rect);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void GraphicsContextImplCairo::clipToDrawingCommands(const FloatRect&, DestinationColorSpace, Function<void(GraphicsContext&)>&&)
</del><ins>+void GraphicsContextImplCairo::clipToDrawingCommands(const FloatRect&, const DestinationColorSpace&, Function<void(GraphicsContext&)>&&)
</ins><span class="cx"> {
</span><span class="cx">     // FIXME: Not implemented.
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscairoGraphicsContextImplCairoh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cairo/GraphicsContextImplCairo.h (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cairo/GraphicsContextImplCairo.h  2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/platform/graphics/cairo/GraphicsContextImplCairo.h     2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -104,7 +104,7 @@
</span><span class="cx">     void clipPath(const Path&, WindRule) override;
</span><span class="cx">     IntRect clipBounds() override;
</span><span class="cx">     void clipToImageBuffer(ImageBuffer&, const FloatRect&) override;
</span><del>-    void clipToDrawingCommands(const FloatRect& destination, DestinationColorSpace, Function<void(GraphicsContext&)>&&) override;
</del><ins>+    void clipToDrawingCommands(const FloatRect& destination, const DestinationColorSpace&, Function<void(GraphicsContext&)>&&) override;
</ins><span class="cx"> #if ENABLE(VIDEO)
</span><span class="cx">     void paintFrameForMedia(MediaPlayer&, const FloatRect& destination) override;
</span><span class="cx">     bool canPaintFrameForMedia(const MediaPlayer&) const override { return false; }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscairoImageBufferCairoBackendcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cairo/ImageBufferCairoBackend.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cairo/ImageBufferCairoBackend.cpp 2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/platform/graphics/cairo/ImageBufferCairoBackend.cpp    2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -89,19 +89,19 @@
</span><span class="cx">         Cairo::clipToImageBuffer(*destContext.platformContext(), image->platformImage().get(), destRect);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void ImageBufferCairoBackend::transformColorSpace(DestinationColorSpace srcColorSpace, DestinationColorSpace destColorSpace)
</del><ins>+void ImageBufferCairoBackend::transformColorSpace(const DestinationColorSpace& srcColorSpace, const DestinationColorSpace& destColorSpace)
</ins><span class="cx"> {
</span><span class="cx">     if (srcColorSpace == destColorSpace)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     // only sRGB <-> linearRGB are supported at the moment
</span><del>-    if ((srcColorSpace != DestinationColorSpace::LinearSRGB && srcColorSpace != DestinationColorSpace::SRGB)
-        || (destColorSpace != DestinationColorSpace::LinearSRGB && destColorSpace != DestinationColorSpace::SRGB))
</del><ins>+    if ((srcColorSpace != DestinationColorSpace::LinearSRGB() && srcColorSpace != DestinationColorSpace::SRGB())
+        || (destColorSpace != DestinationColorSpace::LinearSRGB() && destColorSpace != DestinationColorSpace::SRGB()))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     m_parameters.colorSpace = destColorSpace;
</span><span class="cx"> 
</span><del>-    if (destColorSpace == DestinationColorSpace::LinearSRGB) {
</del><ins>+    if (destColorSpace == DestinationColorSpace::LinearSRGB()) {
</ins><span class="cx">         static const std::array<uint8_t, 256> linearRgbLUT = [] {
</span><span class="cx">             std::array<uint8_t, 256> array;
</span><span class="cx">             for (unsigned i = 0; i < 256; i++) {
</span><span class="lines">@@ -112,7 +112,7 @@
</span><span class="cx">             return array;
</span><span class="cx">         }();
</span><span class="cx">         platformTransformColorSpace(linearRgbLUT);
</span><del>-    } else if (destColorSpace == DestinationColorSpace::SRGB) {
</del><ins>+    } else if (destColorSpace == DestinationColorSpace::SRGB()) {
</ins><span class="cx">         static const std::array<uint8_t, 256> deviceRgbLUT= [] {
</span><span class="cx">             std::array<uint8_t, 256> array;
</span><span class="cx">             for (unsigned i = 0; i < 256; i++) {
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscairoImageBufferCairoBackendh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cairo/ImageBufferCairoBackend.h (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cairo/ImageBufferCairoBackend.h   2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/platform/graphics/cairo/ImageBufferCairoBackend.h      2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -44,7 +44,7 @@
</span><span class="cx"> 
</span><span class="cx">     void clipToMask(GraphicsContext&, const FloatRect& destRect) override;
</span><span class="cx"> 
</span><del>-    void transformColorSpace(DestinationColorSpace srcColorSpace, DestinationColorSpace destColorSpace) override;
</del><ins>+    void transformColorSpace(const DestinationColorSpace& srcColorSpace, const DestinationColorSpace& destColorSpace) override;
</ins><span class="cx"> 
</span><span class="cx">     String toDataURL(const String& mimeType, Optional<double> quality, PreserveResolution) const override;
</span><span class="cx">     Vector<uint8_t> toData(const String& mimeType, Optional<double> quality) const override;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscgColorCGcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cg/ColorCG.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cg/ColorCG.cpp    2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/platform/graphics/cg/ColorCG.cpp       2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2010 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2003-2021 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -29,13 +29,14 @@
</span><span class="cx"> #if USE(CG)
</span><span class="cx"> 
</span><span class="cx"> #include "ColorSpaceCG.h"
</span><ins>+#include "DestinationColorSpace.h"
</ins><span class="cx"> #include <mutex>
</span><ins>+#include <pal/spi/cg/CoreGraphicsSPI.h>
</ins><span class="cx"> #include <wtf/Assertions.h>
</span><span class="cx"> #include <wtf/Lock.h>
</span><span class="cx"> #include <wtf/RetainPtr.h>
</span><ins>+#include <wtf/StdLibExtras.h>
</ins><span class="cx"> #include <wtf/TinyLRUCache.h>
</span><del>-#include <pal/spi/cg/CoreGraphicsSPI.h>
-#include <wtf/StdLibExtras.h>
</del><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> static RetainPtr<CGColorRef> createCGColor(const Color&);
</span><span class="lines">@@ -91,35 +92,39 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static RetainPtr<CGColorRef> createCGColor(const Color& color)
</del><ins>+static std::pair<CGColorSpaceRef, ColorComponents<float, 4>> convertToCGCompatibleComponents(ColorSpace colorSpace, ColorComponents<float, 4> components)
</ins><span class="cx"> {
</span><del>-    auto [colorSpace, components] = color.colorSpaceAndComponents();
-
-    auto cgColorSpace = cachedNullableCGColorSpace(colorSpace);
-
</del><span class="cx">     // Some CG ports don't support all the color spaces required and return
</span><span class="cx">     // nullptr for unsupported color spaces. In those cases, we eagerly convert
</span><span class="cx">     // the color into either extended sRGB or normal sRGB, if extended sRGB is
</span><del>-    // not supported, before creating the CGColorRef.
</del><ins>+    // not supported.
+
+    auto cgColorSpace = cachedNullableCGColorSpace(colorSpace);
</ins><span class="cx">     if (!cgColorSpace) {
</span><span class="cx"> #if HAVE(CORE_GRAPHICS_EXTENDED_SRGB_COLOR_SPACE)
</span><del>-        auto colorConvertedToExtendedSRGBA = callWithColorType(components, colorSpace, [] (const auto& color) {
-            return convertColor<ExtendedSRGBA<float>>(color);
</del><ins>+        auto componentsConvertedToExtendedSRGBA = callWithColorType(components, colorSpace, [] (const auto& color) {
+            return asColorComponents(convertColor<ExtendedSRGBA<float>>(color));
</ins><span class="cx">         });
</span><del>-        components = asColorComponents(colorConvertedToExtendedSRGBA);
-        cgColorSpace = extendedSRGBColorSpaceRef();
</del><ins>+        return { extendedSRGBColorSpaceRef(), componentsConvertedToExtendedSRGBA };
</ins><span class="cx"> #else
</span><del>-        auto colorConvertedToSRGBA = callWithColorType(components, colorSpace, [] (const auto& color) {
-            return convertColor<SRGBA<float>>(color);
</del><ins>+        auto componentsConvertedToSRGBA = callWithColorType(components, colorSpace, [] (const auto& color) {
+            return asColorComponents(convertColor<SRGBA<float>>(color));
</ins><span class="cx">         });
</span><del>-        components = asColorComponents(colorConvertedToSRGBA);
-        cgColorSpace = sRGBColorSpaceRef();
</del><ins>+        return { sRGBColorSpaceRef(), componentsConvertedToSRGBA };
</ins><span class="cx"> #endif
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    auto [r, g, b, a] = components;
-    CGFloat cgFloatComponents[4] { r, g, b, a };
</del><ins>+    return { cgColorSpace, components };
+}
</ins><span class="cx"> 
</span><ins>+static RetainPtr<CGColorRef> createCGColor(const Color& color)
+{
+    auto [colorSpace, components] = color.colorSpaceAndComponents();
+    auto [cgColorSpace, cgCompatibleComponents] = convertToCGCompatibleComponents(colorSpace, components);
+    
+    auto [c1, c2, c3, c4] = cgCompatibleComponents;
+    CGFloat cgFloatComponents[4] { c1, c2, c3, c4 };
+
</ins><span class="cx">     return adoptCF(CGColorCreate(cgColorSpace, cgFloatComponents));
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -161,6 +166,24 @@
</span><span class="cx">     return cache.get().get(color).get();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+ColorComponents<float, 4> platformConvertColorComponents(ColorSpace inputColorSpace, ColorComponents<float, 4> inputColorComponents, const DestinationColorSpace& outputColorSpace)
+{
+    // FIXME: Investigate optimizing this to use the builtin color conversion code for supported color spaces.
+
+    auto [cgInputColorSpace, cgCompatibleComponents] = convertToCGCompatibleComponents(inputColorSpace, inputColorComponents);
+    if (cgInputColorSpace == outputColorSpace.platformColorSpace())
+        return cgCompatibleComponents;
+
+    auto [c1, c2, c3, c4] = cgCompatibleComponents;
+    CGFloat sourceComponents[4] { c1, c2, c3, c4 };
+    CGFloat destinationComponents[4] { };
+
+    auto transform = adoptCF(CGColorTransformCreate(outputColorSpace.platformColorSpace(), nullptr));
+    auto result = CGColorTransformConvertColorComponents(transform.get(), cgInputColorSpace, kCGRenderingIntentDefault, sourceComponents, destinationComponents);
+    ASSERT_UNUSED(result, result);
+    return { static_cast<float>(destinationComponents[0]), static_cast<float>(destinationComponents[1]), static_cast<float>(destinationComponents[2]), static_cast<float>(destinationComponents[3]) };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+}
+
</ins><span class="cx"> #endif // USE(CG)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscgColorSpaceCGh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cg/ColorSpaceCG.h (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cg/ColorSpaceCG.h 2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/platform/graphics/cg/ColorSpaceCG.h    2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -119,23 +119,4 @@
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-// NOTE: Since this function is for *destination* color spaces whose callers always expect a non-null color space, this function is guaranteed to return non-null, unlike cachedNullableCGColorSpace().
-static inline CGColorSpaceRef cachedCGColorSpace(DestinationColorSpace colorSpace)
-{
-    switch (colorSpace) {
-    case DestinationColorSpace::SRGB:
-        return sRGBColorSpaceRef();
-#if ENABLE(DESTINATION_COLOR_SPACE_LINEAR_SRGB)
-    case DestinationColorSpace::LinearSRGB:
-        return linearSRGBColorSpaceRef();
-#endif
-#if ENABLE(DESTINATION_COLOR_SPACE_DISPLAY_P3)
-    case DestinationColorSpace::DisplayP3:
-        return displayP3ColorSpaceRef();
-#endif
-    }
-    ASSERT_NOT_REACHED();
-    return sRGBColorSpaceRef();
</del><span class="cx"> }
</span><del>-
-}
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscgGraphicsContextGLCGcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cg/GraphicsContextGLCG.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cg/GraphicsContextGLCG.cpp        2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/platform/graphics/cg/GraphicsContextGLCG.cpp   2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -532,7 +532,7 @@
</span><span class="cx">     }));
</span><span class="cx"> 
</span><span class="cx">     auto imageSize = pixelBuffer.size();
</span><del>-    auto image = NativeImage::create(adoptCF(CGImageCreate(imageSize.width(), imageSize.height(), 8, 32, 4 * imageSize.width(), cachedCGColorSpace(pixelBuffer.format().colorSpace), bitmapInfo, dataProvider.get(), 0, false, kCGRenderingIntentDefault)));
</del><ins>+    auto image = NativeImage::create(adoptCF(CGImageCreate(imageSize.width(), imageSize.height(), 8, 32, 4 * imageSize.width(), pixelBuffer.format().colorSpace.platformColorSpace(), bitmapInfo, dataProvider.get(), 0, false, kCGRenderingIntentDefault)));
</ins><span class="cx"> 
</span><span class="cx">     // CSS styling may cause the canvas's content to be resized on
</span><span class="cx">     // the page. Go back to the Canvas to figure out the correct
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscgIOSurfacePoolcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cg/IOSurfacePool.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cg/IOSurfacePool.cpp      2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/platform/graphics/cg/IOSurfacePool.cpp 2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if HAVE(IOSURFACE)
</span><span class="cx"> 
</span><ins>+#include "DestinationColorSpace.h"
</ins><span class="cx"> #include "GraphicsContextCG.h"
</span><span class="cx"> #include <CoreGraphics/CoreGraphics.h>
</span><span class="cx"> #include <wtf/NeverDestroyed.h>
</span><span class="lines">@@ -59,7 +60,7 @@
</span><span class="cx">     return pool;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static bool surfaceMatchesParameters(IOSurface& surface, IntSize requestedSize, CGColorSpaceRef colorSpace, IOSurface::Format format)
</del><ins>+static bool surfaceMatchesParameters(IOSurface& surface, IntSize requestedSize, const DestinationColorSpace& colorSpace, IOSurface::Format format)
</ins><span class="cx"> {
</span><span class="cx">     if (format != surface.format())
</span><span class="cx">         return false;
</span><span class="lines">@@ -102,7 +103,7 @@
</span><span class="cx">     m_sizesInPruneOrder.append(size);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-std::unique_ptr<IOSurface> IOSurfacePool::takeSurface(IntSize size, CGColorSpaceRef colorSpace, IOSurface::Format format)
</del><ins>+std::unique_ptr<IOSurface> IOSurfacePool::takeSurface(IntSize size, const DestinationColorSpace& colorSpace, IOSurface::Format format)
</ins><span class="cx"> {
</span><span class="cx">     Locker locker { m_lock };
</span><span class="cx">     CachedSurfaceMap::iterator mapIter = m_cachedSurfaces.find(size);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscgIOSurfacePoolh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cg/IOSurfacePool.h (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cg/IOSurfacePool.h        2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/platform/graphics/cg/IOSurfacePool.h   2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -39,6 +39,8 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+class DestinatationColorSpace;
+
</ins><span class="cx"> class IOSurfacePool {
</span><span class="cx">     WTF_MAKE_NONCOPYABLE(IOSurfacePool);
</span><span class="cx">     WTF_MAKE_FAST_ALLOCATED;
</span><span class="lines">@@ -47,7 +49,7 @@
</span><span class="cx"> public:
</span><span class="cx">     WEBCORE_EXPORT static IOSurfacePool& sharedPool();
</span><span class="cx"> 
</span><del>-    std::unique_ptr<IOSurface> takeSurface(IntSize, CGColorSpaceRef, IOSurface::Format);
</del><ins>+    std::unique_ptr<IOSurface> takeSurface(IntSize, const DestinationColorSpace&, IOSurface::Format);
</ins><span class="cx">     WEBCORE_EXPORT void addSurface(std::unique_ptr<IOSurface>);
</span><span class="cx"> 
</span><span class="cx">     void discardAllSurfaces();
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscgImageBufferCGBackendcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cg/ImageBufferCGBackend.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cg/ImageBufferCGBackend.cpp       2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/platform/graphics/cg/ImageBufferCGBackend.cpp  2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -174,7 +174,7 @@
</span><span class="cx">         // FIXME: Should this be using the same logic as ImageBufferUtilitiesCG?
</span><span class="cx"> 
</span><span class="cx">         // JPEGs don't have an alpha channel, so we have to manually composite on top of black.
</span><del>-        PixelBufferFormat format { AlphaPremultiplication::Premultiplied, PixelFormat::RGBA8, DestinationColorSpace::SRGB };
</del><ins>+        PixelBufferFormat format { AlphaPremultiplication::Premultiplied, PixelFormat::RGBA8, DestinationColorSpace::SRGB() };
</ins><span class="cx">         auto pixelBuffer = getPixelBuffer(format, logicalRect());
</span><span class="cx">         if (!pixelBuffer)
</span><span class="cx">             return nullptr;
</span><span class="lines">@@ -192,7 +192,7 @@
</span><span class="cx">             return nullptr;
</span><span class="cx"> 
</span><span class="cx">         auto imageSize = pixelBuffer->size();
</span><del>-        return adoptCF(CGImageCreate(imageSize.width(), imageSize.height(), 8, 32, 4 * imageSize.width(), cachedCGColorSpace(pixelBuffer->format().colorSpace), kCGBitmapByteOrderDefault | kCGImageAlphaNoneSkipLast, dataProvider.get(), 0, false, kCGRenderingIntentDefault));
</del><ins>+        return adoptCF(CGImageCreate(imageSize.width(), imageSize.height(), 8, 32, 4 * imageSize.width(), pixelBuffer->format().colorSpace.platformColorSpace(), kCGBitmapByteOrderDefault | kCGImageAlphaNoneSkipLast, dataProvider.get(), 0, false, kCGRenderingIntentDefault));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (resolutionScale() == 1 || preserveResolution == PreserveResolution::Yes) {
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscgImageBufferCGBitmapBackendcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cg/ImageBufferCGBitmapBackend.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cg/ImageBufferCGBitmapBackend.cpp 2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/platform/graphics/cg/ImageBufferCGBitmapBackend.cpp    2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -62,7 +62,7 @@
</span><span class="cx">     return ImageBufferBackend::calculateMemoryCost(backendSize, calculateBytesPerRow(backendSize));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-std::unique_ptr<ImageBufferCGBitmapBackend> ImageBufferCGBitmapBackend::create(const Parameters& parameters, CGColorSpaceRef cgColorSpace, const HostWindow*)
</del><ins>+std::unique_ptr<ImageBufferCGBitmapBackend> ImageBufferCGBitmapBackend::create(const Parameters& parameters, const HostWindow*)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(parameters.pixelFormat == PixelFormat::BGRA8);
</span><span class="cx"> 
</span><span class="lines">@@ -81,7 +81,7 @@
</span><span class="cx">     size_t numBytes = backendSize.height() * bytesPerRow;
</span><span class="cx">     verifyImageBufferIsBigEnough(data, numBytes);
</span><span class="cx"> 
</span><del>-    auto cgContext = adoptCF(CGBitmapContextCreate(data, backendSize.width(), backendSize.height(), 8, bytesPerRow, cgColorSpace, kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Host));
</del><ins>+    auto cgContext = adoptCF(CGBitmapContextCreate(data, backendSize.width(), backendSize.height(), 8, bytesPerRow, parameters.colorSpace.platformColorSpace(), kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Host));
</ins><span class="cx">     if (!cgContext)
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="lines">@@ -96,17 +96,16 @@
</span><span class="cx"> 
</span><span class="cx"> std::unique_ptr<ImageBufferCGBitmapBackend> ImageBufferCGBitmapBackend::create(const Parameters& parameters, const GraphicsContext& context)
</span><span class="cx"> {
</span><del>-    if (auto cgColorSpace = context.hasPlatformContext() ? contextColorSpace(context) : nullptr)
-        return ImageBufferCGBitmapBackend::create(parameters, cgColorSpace.get(), nullptr);
</del><ins>+    if (auto cgColorSpace = context.hasPlatformContext() ? contextColorSpace(context) : nullptr) {
+        auto overrideParameters = parameters;
+        overrideParameters.colorSpace = DestinationColorSpace { cgColorSpace };
</ins><span class="cx"> 
</span><ins>+        return ImageBufferCGBitmapBackend::create(overrideParameters, nullptr);
+    }
+
</ins><span class="cx">     return ImageBufferCGBitmapBackend::create(parameters, nullptr);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-std::unique_ptr<ImageBufferCGBitmapBackend> ImageBufferCGBitmapBackend::create(const Parameters& parameters, const HostWindow* hostWindow)
-{
-    return ImageBufferCGBitmapBackend::create(parameters, cachedCGColorSpace(parameters.colorSpace), hostWindow);
-}
-
</del><span class="cx"> ImageBufferCGBitmapBackend::ImageBufferCGBitmapBackend(const Parameters& parameters, void* data, RetainPtr<CGDataProviderRef>&& dataProvider, std::unique_ptr<GraphicsContext>&& context)
</span><span class="cx">     : ImageBufferCGBackend(parameters)
</span><span class="cx">     , m_data(data)
</span><span class="lines">@@ -146,7 +145,7 @@
</span><span class="cx">         auto backendSize = this->backendSize();
</span><span class="cx">         return NativeImage::create(adoptCF(CGImageCreate(
</span><span class="cx">             backendSize.width(), backendSize.height(), 8, 32, bytesPerRow(),
</span><del>-            cachedCGColorSpace(colorSpace()), kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Host, m_dataProvider.get(),
</del><ins>+            colorSpace().platformColorSpace(), kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Host, m_dataProvider.get(),
</ins><span class="cx">             0, true, kCGRenderingIntentDefault)));
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscgImageBufferCGBitmapBackendh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cg/ImageBufferCGBitmapBackend.h (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cg/ImageBufferCGBitmapBackend.h   2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/platform/graphics/cg/ImageBufferCGBitmapBackend.h      2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -39,8 +39,9 @@
</span><span class="cx">     static IntSize calculateSafeBackendSize(const Parameters&);
</span><span class="cx">     static size_t calculateMemoryCost(const Parameters&);
</span><span class="cx"> 
</span><del>-    static std::unique_ptr<ImageBufferCGBitmapBackend> create(const Parameters&, CGColorSpaceRef, const HostWindow*);
</del><span class="cx">     static std::unique_ptr<ImageBufferCGBitmapBackend> create(const Parameters&, const HostWindow*);
</span><ins>+
+    // FIXME: Rename to createUsingColorSpaceOfGraphicsContext() (or something like that).
</ins><span class="cx">     static std::unique_ptr<ImageBufferCGBitmapBackend> create(const Parameters&, const GraphicsContext&);
</span><span class="cx"> 
</span><span class="cx">     GraphicsContext& context() const override;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscgImageBufferIOSurfaceBackendcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cg/ImageBufferIOSurfaceBackend.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cg/ImageBufferIOSurfaceBackend.cpp        2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/platform/graphics/cg/ImageBufferIOSurfaceBackend.cpp   2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -81,13 +81,13 @@
</span><span class="cx">     return ImageBufferCGBackend::contextColorSpace(context);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-std::unique_ptr<ImageBufferIOSurfaceBackend> ImageBufferIOSurfaceBackend::create(const Parameters& parameters, CGColorSpaceRef cgColorSpace, const HostWindow* hostWindow)
</del><ins>+std::unique_ptr<ImageBufferIOSurfaceBackend> ImageBufferIOSurfaceBackend::create(const Parameters& parameters, const HostWindow* hostWindow)
</ins><span class="cx"> {
</span><span class="cx">     IntSize backendSize = calculateSafeBackendSize(parameters);
</span><span class="cx">     if (backendSize.isEmpty())
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><del>-    auto surface = IOSurface::create(backendSize, backendSize, cgColorSpace, IOSurface::formatForPixelFormat(parameters.pixelFormat));
</del><ins>+    auto surface = IOSurface::create(backendSize, backendSize, parameters.colorSpace, IOSurface::formatForPixelFormat(parameters.pixelFormat));
</ins><span class="cx">     if (!surface)
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="lines">@@ -102,17 +102,16 @@
</span><span class="cx"> 
</span><span class="cx"> std::unique_ptr<ImageBufferIOSurfaceBackend> ImageBufferIOSurfaceBackend::create(const Parameters& parameters, const GraphicsContext& context)
</span><span class="cx"> {
</span><del>-    if (auto cgColorSpace = context.hasPlatformContext() ? contextColorSpace(context) : nullptr)
-        return ImageBufferIOSurfaceBackend::create(parameters, cgColorSpace.get(), nullptr);
</del><ins>+    if (auto cgColorSpace = context.hasPlatformContext() ? contextColorSpace(context) : nullptr) {
+        auto overrideParameters = parameters;
+        overrideParameters.colorSpace = DestinationColorSpace { cgColorSpace };
</ins><span class="cx"> 
</span><ins>+        return ImageBufferIOSurfaceBackend::create(overrideParameters, nullptr);
+    }
+
</ins><span class="cx">     return ImageBufferIOSurfaceBackend::create(parameters, nullptr);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-std::unique_ptr<ImageBufferIOSurfaceBackend> ImageBufferIOSurfaceBackend::create(const Parameters& parameters, const HostWindow* hostWindow)
-{
-    return ImageBufferIOSurfaceBackend::create(parameters, cachedCGColorSpace(parameters.colorSpace), hostWindow);
-}
-
</del><span class="cx"> ImageBufferIOSurfaceBackend::ImageBufferIOSurfaceBackend(const Parameters& parameters, std::unique_ptr<IOSurface>&& surface)
</span><span class="cx">     : ImageBufferCGBackend(parameters)
</span><span class="cx">     , m_surface(WTFMove(surface))
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscgImageBufferIOSurfaceBackendh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cg/ImageBufferIOSurfaceBackend.h (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cg/ImageBufferIOSurfaceBackend.h  2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/platform/graphics/cg/ImageBufferIOSurfaceBackend.h     2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -42,8 +42,8 @@
</span><span class="cx">     static size_t calculateMemoryCost(const Parameters&);
</span><span class="cx">     static size_t calculateExternalMemoryCost(const Parameters&);
</span><span class="cx">     
</span><del>-    static std::unique_ptr<ImageBufferIOSurfaceBackend> create(const Parameters&, CGColorSpaceRef, const HostWindow*);
</del><span class="cx">     static std::unique_ptr<ImageBufferIOSurfaceBackend> create(const Parameters&, const HostWindow*);
</span><ins>+    // FIXME: Rename to createUsingColorSpaceOfGraphicsContext() (or something like that).
</ins><span class="cx">     static std::unique_ptr<ImageBufferIOSurfaceBackend> create(const Parameters&, const GraphicsContext&);
</span><span class="cx"> 
</span><span class="cx">     ImageBufferIOSurfaceBackend(const Parameters&, std::unique_ptr<IOSurface>&&);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscgImageBufferUtilitiesCGcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cg/ImageBufferUtilitiesCG.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cg/ImageBufferUtilitiesCG.cpp     2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/platform/graphics/cg/ImageBufferUtilitiesCG.cpp        2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -177,7 +177,7 @@
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="cx">     auto imageSize = source.size();
</span><del>-    auto image = adoptCF(CGImageCreate(imageSize.width(), imageSize.height(), 8, 32, 4 * imageSize.width(), cachedCGColorSpace(source.format().colorSpace), kCGBitmapByteOrderDefault | dataAlphaInfo, dataProvider.get(), 0, false, kCGRenderingIntentDefault));
</del><ins>+    auto image = adoptCF(CGImageCreate(imageSize.width(), imageSize.height(), 8, 32, 4 * imageSize.width(), source.format().colorSpace.platformColorSpace(), kCGBitmapByteOrderDefault | dataAlphaInfo, dataProvider.get(), 0, false, kCGRenderingIntentDefault));
</ins><span class="cx"> 
</span><span class="cx">     return encode(image.get(), destinationUTI.get(), quality, function);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscocoaGraphicsContextGLOpenGLCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm     2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm        2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -571,7 +571,7 @@
</span><span class="cx"> bool GraphicsContextGLOpenGL::allocateAndBindDisplayBufferBacking()
</span><span class="cx"> {
</span><span class="cx">     ASSERT(!getInternalFramebufferSize().isEmpty());
</span><del>-    auto backing = WebCore::IOSurface::create(getInternalFramebufferSize(), WebCore::sRGBColorSpaceRef());
</del><ins>+    auto backing = IOSurface::create(getInternalFramebufferSize(), DestinationColorSpace::SRGB());
</ins><span class="cx">     if (!backing)
</span><span class="cx">         return false;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscocoaIOSurfaceh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.h (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.h 2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.h    2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -27,9 +27,10 @@
</span><span class="cx"> 
</span><span class="cx"> #if HAVE(IOSURFACE)
</span><span class="cx"> 
</span><ins>+#include "DestinationColorSpace.h"
+#include "IntSize.h"
</ins><span class="cx"> #include <objc/objc.h>
</span><span class="cx"> #include <pal/spi/cocoa/IOSurfaceSPI.h>
</span><del>-#include "IntSize.h"
</del><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS_FAMILY) && !PLATFORM(MACCATALYST) && !PLATFORM(IOS_FAMILY_SIMULATOR)
</span><span class="cx"> #define HAVE_IOSURFACE_RGB10 1
</span><span class="lines">@@ -46,10 +47,7 @@
</span><span class="cx"> 
</span><span class="cx"> class GraphicsContext;
</span><span class="cx"> class HostWindow;
</span><del>-    
-#if USE(IOSURFACE_CANVAS_BACKING_STORE)
</del><span class="cx"> class ImageBuffer;
</span><del>-#endif
</del><span class="cx"> 
</span><span class="cx"> enum class PixelFormat : uint8_t;
</span><span class="cx"> enum class VolatilityState : uint8_t;
</span><span class="lines">@@ -101,10 +99,10 @@
</span><span class="cx">         uint32_t m_flags;
</span><span class="cx">     };
</span><span class="cx"> 
</span><del>-    WEBCORE_EXPORT static std::unique_ptr<IOSurface> create(IntSize, CGColorSpaceRef, Format = Format::BGRA);
-    WEBCORE_EXPORT static std::unique_ptr<IOSurface> create(IntSize, IntSize contextSize, CGColorSpaceRef, Format = Format::BGRA);
-    WEBCORE_EXPORT static std::unique_ptr<IOSurface> createFromSendRight(const WTF::MachSendRight&&, CGColorSpaceRef);
-    WEBCORE_EXPORT static std::unique_ptr<IOSurface> createFromSurface(IOSurfaceRef, CGColorSpaceRef);
</del><ins>+    WEBCORE_EXPORT static std::unique_ptr<IOSurface> create(IntSize, const DestinationColorSpace&, Format = Format::BGRA);
+    WEBCORE_EXPORT static std::unique_ptr<IOSurface> create(IntSize, IntSize contextSize, const DestinationColorSpace&, Format = Format::BGRA);
+    WEBCORE_EXPORT static std::unique_ptr<IOSurface> createFromSendRight(const WTF::MachSendRight&&, const DestinationColorSpace&);
+    WEBCORE_EXPORT static std::unique_ptr<IOSurface> createFromSurface(IOSurfaceRef, const DestinationColorSpace&);
</ins><span class="cx">     WEBCORE_EXPORT static std::unique_ptr<IOSurface> createFromImage(CGImageRef);
</span><span class="cx">     WEBCORE_EXPORT static std::unique_ptr<IOSurface> createFromPixelBuffer(CVPixelBufferRef);
</span><span class="cx">     
</span><span class="lines">@@ -146,7 +144,7 @@
</span><span class="cx">     IntSize size() const { return m_size; }
</span><span class="cx">     size_t totalBytes() const { return m_totalBytes; }
</span><span class="cx"> 
</span><del>-    CGColorSpaceRef colorSpace() const { return m_colorSpace.get(); }
</del><ins>+    const DestinationColorSpace& colorSpace() const { return m_colorSpace; }
</ins><span class="cx">     WEBCORE_EXPORT Format format() const;
</span><span class="cx">     WEBCORE_EXPORT IOSurfaceID surfaceID() const;
</span><span class="cx">     size_t bytesPerRow() const;
</span><span class="lines">@@ -169,14 +167,14 @@
</span><span class="cx">     void migrateColorSpaceToProperties();
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    IOSurface(IntSize, IntSize contextSize, CGColorSpaceRef, Format, bool& success);
-    IOSurface(IOSurfaceRef, CGColorSpaceRef);
</del><ins>+    IOSurface(IntSize, IntSize contextSize, const DestinationColorSpace&, Format, bool& success);
+    IOSurface(IOSurfaceRef, const DestinationColorSpace&);
</ins><span class="cx"> 
</span><del>-    static std::unique_ptr<IOSurface> surfaceFromPool(IntSize, IntSize contextSize, CGColorSpaceRef, Format);
</del><ins>+    static std::unique_ptr<IOSurface> surfaceFromPool(IntSize, IntSize contextSize, const DestinationColorSpace&, Format);
</ins><span class="cx">     IntSize contextSize() const { return m_contextSize; }
</span><span class="cx">     void setContextSize(IntSize);
</span><span class="cx"> 
</span><del>-    RetainPtr<CGColorSpaceRef> m_colorSpace;
</del><ins>+    DestinationColorSpace m_colorSpace;
</ins><span class="cx">     IntSize m_size;
</span><span class="cx">     IntSize m_contextSize;
</span><span class="cx">     size_t m_totalBytes;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscocoaIOSurfacemm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.mm (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.mm        2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.mm   2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -26,7 +26,7 @@
</span><span class="cx"> #import "config.h"
</span><span class="cx"> #import "IOSurface.h"
</span><span class="cx"> 
</span><del>-#import "CoreVideoSoftLink.h"
</del><ins>+#import "DestinationColorSpace.h"
</ins><span class="cx"> #import "GraphicsContextCG.h"
</span><span class="cx"> #import "GraphicsContextGL.h"
</span><span class="cx"> #import "HostWindow.h"
</span><span class="lines">@@ -41,9 +41,11 @@
</span><span class="cx"> #import <wtf/MathExtras.h>
</span><span class="cx"> #import <wtf/text/TextStream.h>
</span><span class="cx"> 
</span><ins>+#import "CoreVideoSoftLink.h"
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-inline std::unique_ptr<IOSurface> IOSurface::surfaceFromPool(IntSize size, IntSize contextSize, CGColorSpaceRef colorSpace, Format pixelFormat)
</del><ins>+inline std::unique_ptr<IOSurface> IOSurface::surfaceFromPool(IntSize size, IntSize contextSize, const DestinationColorSpace& colorSpace, Format pixelFormat)
</ins><span class="cx"> {
</span><span class="cx">     auto cachedSurface = IOSurfacePool::sharedPool().takeSurface(size, colorSpace, pixelFormat);
</span><span class="cx">     if (!cachedSurface)
</span><span class="lines">@@ -53,12 +55,12 @@
</span><span class="cx">     return cachedSurface;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-std::unique_ptr<IOSurface> IOSurface::create(IntSize size, CGColorSpaceRef colorSpace, Format pixelFormat)
</del><ins>+std::unique_ptr<IOSurface> IOSurface::create(IntSize size, const DestinationColorSpace& colorSpace, Format pixelFormat)
</ins><span class="cx"> {
</span><span class="cx">     return IOSurface::create(size, size, colorSpace, pixelFormat);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-std::unique_ptr<IOSurface> IOSurface::create(IntSize size, IntSize contextSize, CGColorSpaceRef colorSpace, Format pixelFormat)
</del><ins>+std::unique_ptr<IOSurface> IOSurface::create(IntSize size, IntSize contextSize, const DestinationColorSpace& colorSpace, Format pixelFormat)
</ins><span class="cx"> {
</span><span class="cx">     if (auto cachedSurface = surfaceFromPool(size, contextSize, colorSpace, pixelFormat)) {
</span><span class="cx">         LOG_WITH_STREAM(IOSurface, stream << "IOSurface::create took from pool: " << *cachedSurface);
</span><span class="lines">@@ -75,13 +77,13 @@
</span><span class="cx">     return surface;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-std::unique_ptr<IOSurface> IOSurface::createFromSendRight(const MachSendRight&& sendRight, CGColorSpaceRef colorSpace)
</del><ins>+std::unique_ptr<IOSurface> IOSurface::createFromSendRight(const MachSendRight&& sendRight, const DestinationColorSpace& colorSpace)
</ins><span class="cx"> {
</span><span class="cx">     auto surface = adoptCF(IOSurfaceLookupFromMachPort(sendRight.sendRight()));
</span><span class="cx">     return IOSurface::createFromSurface(surface.get(), colorSpace);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-std::unique_ptr<IOSurface> IOSurface::createFromSurface(IOSurfaceRef surface, CGColorSpaceRef colorSpace)
</del><ins>+std::unique_ptr<IOSurface> IOSurface::createFromSurface(IOSurfaceRef surface, const DestinationColorSpace& colorSpace)
</ins><span class="cx"> {
</span><span class="cx">     return std::unique_ptr<IOSurface>(new IOSurface(surface, colorSpace));
</span><span class="cx"> }
</span><span class="lines">@@ -94,7 +96,7 @@
</span><span class="cx">     size_t width = CGImageGetWidth(image);
</span><span class="cx">     size_t height = CGImageGetHeight(image);
</span><span class="cx"> 
</span><del>-    auto surface = IOSurface::create(IntSize(width, height), CGImageGetColorSpace(image));
</del><ins>+    auto surface = IOSurface::create(IntSize(width, height), DestinationColorSpace { CGImageGetColorSpace(image) });
</ins><span class="cx">     if (!surface)
</span><span class="cx">         return nullptr;
</span><span class="cx">     auto surfaceContext = surface->ensurePlatformContext();
</span><span class="lines">@@ -116,7 +118,7 @@
</span><span class="cx">     if (!colorSpace)
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><del>-    return createFromSurface(surface, colorSpace);
</del><ins>+    return createFromSurface(surface, DestinationColorSpace { colorSpace });
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void IOSurface::moveToPool(std::unique_ptr<IOSurface>&& surface)
</span><span class="lines">@@ -196,7 +198,7 @@
</span><span class="cx"> 
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-IOSurface::IOSurface(IntSize size, IntSize contextSize, CGColorSpaceRef colorSpace, Format format, bool& success)
</del><ins>+IOSurface::IOSurface(IntSize size, IntSize contextSize, const DestinationColorSpace& colorSpace, Format format, bool& success)
</ins><span class="cx">     : m_colorSpace(colorSpace)
</span><span class="cx">     , m_size(size)
</span><span class="cx">     , m_contextSize(contextSize)
</span><span class="lines">@@ -232,7 +234,7 @@
</span><span class="cx">         RELEASE_LOG_ERROR(Layers, "IOSurface creation failed for size: (%d %d) and format: (%d)", size.width(), size.height(), format);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-IOSurface::IOSurface(IOSurfaceRef surface, CGColorSpaceRef colorSpace)
</del><ins>+IOSurface::IOSurface(IOSurfaceRef surface, const DestinationColorSpace& colorSpace)
</ins><span class="cx">     : m_colorSpace(colorSpace)
</span><span class="cx">     , m_surface(surface)
</span><span class="cx"> {
</span><span class="lines">@@ -347,7 +349,7 @@
</span><span class="cx">         break;
</span><span class="cx">     }
</span><span class="cx">     
</span><del>-    m_cgContext = adoptCF(CGIOSurfaceContextCreate(m_surface.get(), m_contextSize.width(), m_contextSize.height(), bitsPerComponent, bitsPerPixel, m_colorSpace.get(), bitmapInfo));
</del><ins>+    m_cgContext = adoptCF(CGIOSurfaceContextCreate(m_surface.get(), m_contextSize.width(), m_contextSize.height(), bitsPerComponent, bitsPerPixel, m_colorSpace.platformColorSpace(), bitmapInfo));
</ins><span class="cx"> 
</span><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx">     if (auto displayMask = primaryOpenGLDisplayMask()) {
</span><span class="lines">@@ -515,7 +517,7 @@
</span><span class="cx"> 
</span><span class="cx"> void IOSurface::migrateColorSpaceToProperties()
</span><span class="cx"> {
</span><del>-    auto colorSpaceProperties = adoptCF(CGColorSpaceCopyPropertyList(m_colorSpace.get()));
</del><ins>+    auto colorSpaceProperties = adoptCF(CGColorSpaceCopyPropertyList(m_colorSpace.platformColorSpace()));
</ins><span class="cx">     IOSurfaceSetValue(m_surface.get(), kIOSurfaceColorSpace, colorSpaceProperties.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscoreimageFilterEffectRendererCoreImagemm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/coreimage/FilterEffectRendererCoreImage.mm (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/coreimage/FilterEffectRendererCoreImage.mm        2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/platform/graphics/coreimage/FilterEffectRendererCoreImage.mm   2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -289,7 +289,7 @@
</span><span class="cx">         return;
</span><span class="cx">     
</span><span class="cx">     auto& surface = downcast<AcceleratedImageBuffer>(*m_outputImageBuffer).surface();
</span><del>-    [sharedCIContext().get() render: m_outputImage.get() toIOSurface: surface.surface() bounds:destRect(lastEffect) colorSpace:cachedCGColorSpace(lastEffect.resultColorSpace())];
</del><ins>+    [sharedCIContext().get() render: m_outputImage.get() toIOSurface: surface.surface() bounds:destRect(lastEffect) colorSpace:lastEffect.resultColorSpace().platformColorSpace()];
</ins><span class="cx"> }
</span><span class="cx">     
</span><span class="cx"> FloatRect FilterEffectRendererCoreImage::destRect(const FilterEffect& lastEffect) const
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsdisplaylistsDisplayListImageBufferh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/displaylists/DisplayListImageBuffer.h (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/displaylists/DisplayListImageBuffer.h     2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/platform/graphics/displaylists/DisplayListImageBuffer.h        2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -39,7 +39,7 @@
</span><span class="cx">     using BaseConcreteImageBuffer::baseTransform;
</span><span class="cx"> 
</span><span class="cx"> public:
</span><del>-    static auto create(const FloatSize& size, float resolutionScale, DestinationColorSpace colorSpace, PixelFormat pixelFormat, const HostWindow* hostWindow)
</del><ins>+    static auto create(const FloatSize& size, float resolutionScale, const DestinationColorSpace& colorSpace, PixelFormat pixelFormat, const HostWindow* hostWindow)
</ins><span class="cx">     {
</span><span class="cx">         return BaseConcreteImageBuffer::template create<ImageBuffer>(size, resolutionScale, colorSpace, pixelFormat, hostWindow);
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsdisplaylistsDisplayListItemBuffercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/displaylists/DisplayListItemBuffer.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/displaylists/DisplayListItemBuffer.cpp    2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/platform/graphics/displaylists/DisplayListItemBuffer.cpp       2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -281,7 +281,7 @@
</span><span class="cx">         get<FillRoundedRect>().~FillRoundedRect();
</span><span class="cx">         return;
</span><span class="cx">     case ItemType::GetPixelBuffer:
</span><del>-        static_assert(std::is_trivially_destructible<GetPixelBuffer>::value);
</del><ins>+        get<GetPixelBuffer>().~GetPixelBuffer();
</ins><span class="cx">         return;
</span><span class="cx">     case ItemType::PutPixelBuffer:
</span><span class="cx">         get<PutPixelBuffer>().~PutPixelBuffer();
</span><span class="lines">@@ -307,7 +307,7 @@
</span><span class="cx">         return;
</span><span class="cx"> #endif
</span><span class="cx">     case ItemType::BeginClipToDrawingCommands:
</span><del>-        static_assert(std::is_trivially_destructible<BeginClipToDrawingCommands>::value);
</del><ins>+        get<BeginClipToDrawingCommands>().~BeginClipToDrawingCommands();
</ins><span class="cx">         return;
</span><span class="cx">     case ItemType::BeginTransparencyLayer:
</span><span class="cx">         static_assert(std::is_trivially_destructible<BeginTransparencyLayer>::value);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsdisplaylistsDisplayListItemTypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/displaylists/DisplayListItemType.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/displaylists/DisplayListItemType.cpp      2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/platform/graphics/displaylists/DisplayListItemType.cpp 2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -281,6 +281,7 @@
</span><span class="cx">      * and (3) all the "static constexpr bool isInlineItem"s inside the individual item classes. */
</span><span class="cx"> 
</span><span class="cx">     switch (type) {
</span><ins>+    case ItemType::BeginClipToDrawingCommands:
</ins><span class="cx">     case ItemType::ClipOutToPath:
</span><span class="cx">     case ItemType::ClipPath:
</span><span class="cx">     case ItemType::DrawFocusRingPath:
</span><span class="lines">@@ -294,6 +295,7 @@
</span><span class="cx">     case ItemType::FillRectWithGradient:
</span><span class="cx">     case ItemType::FillRectWithRoundedHole:
</span><span class="cx">     case ItemType::FillRoundedRect:
</span><ins>+    case ItemType::GetPixelBuffer:
</ins><span class="cx">     case ItemType::PutPixelBuffer:
</span><span class="cx">     case ItemType::SetLineDash:
</span><span class="cx">     case ItemType::SetState:
</span><span class="lines">@@ -310,7 +312,6 @@
</span><span class="cx">     case ItemType::Clip:
</span><span class="cx">     case ItemType::ClipOut:
</span><span class="cx">     case ItemType::ClipToImageBuffer:
</span><del>-    case ItemType::BeginClipToDrawingCommands:
</del><span class="cx">     case ItemType::EndClipToDrawingCommands:
</span><span class="cx">     case ItemType::ConcatenateCTM:
</span><span class="cx">     case ItemType::DrawDotsForDocumentMarker:
</span><span class="lines">@@ -351,7 +352,6 @@
</span><span class="cx">     case ItemType::StrokeRect:
</span><span class="cx">     case ItemType::StrokeLine:
</span><span class="cx">     case ItemType::Translate:
</span><del>-    case ItemType::GetPixelBuffer:
</del><span class="cx">         return true;
</span><span class="cx">     }
</span><span class="cx">     ASSERT_NOT_REACHED();
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsdisplaylistsDisplayListItemsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/displaylists/DisplayListItems.h (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/displaylists/DisplayListItems.h   2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/platform/graphics/displaylists/DisplayListItems.h      2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -880,23 +880,54 @@
</span><span class="cx"> class BeginClipToDrawingCommands {
</span><span class="cx"> public:
</span><span class="cx">     static constexpr ItemType itemType = ItemType::BeginClipToDrawingCommands;
</span><del>-    static constexpr bool isInlineItem = true;
</del><ins>+    static constexpr bool isInlineItem = false;
</ins><span class="cx">     static constexpr bool isDrawingItem = false;
</span><span class="cx"> 
</span><span class="cx">     BeginClipToDrawingCommands(const FloatRect& destination, DestinationColorSpace colorSpace)
</span><span class="cx">         : m_destination(destination)
</span><del>-        , m_colorSpace(colorSpace)
</del><ins>+        , m_colorSpace(WTFMove(colorSpace))
</ins><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    // Explicit destructor added to force non-trivial destructor on all platforms
+    // as the encoding logic currently hardcodes which display list item types need
+    // out of line treatment rather than using the isInlineItem constant.
+    ~BeginClipToDrawingCommands() { }
+
</ins><span class="cx">     const FloatRect& destination() const { return m_destination; }
</span><del>-    DestinationColorSpace colorSpace() const { return m_colorSpace; }
</del><ins>+    const DestinationColorSpace& colorSpace() const { return m_colorSpace; }
</ins><span class="cx"> 
</span><ins>+    template<class Encoder> void encode(Encoder&) const;
+    template<class Decoder> static Optional<BeginClipToDrawingCommands> decode(Decoder&);
+
</ins><span class="cx"> private:
</span><span class="cx">     FloatRect m_destination;
</span><span class="cx">     DestinationColorSpace m_colorSpace;
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+template<class Encoder>
+void BeginClipToDrawingCommands::encode(Encoder& encoder) const
+{
+    encoder << m_destination;
+    encoder << m_colorSpace;
+}
+
+template<class Decoder>
+Optional<BeginClipToDrawingCommands> BeginClipToDrawingCommands::decode(Decoder& decoder)
+{
+    Optional<FloatRect> destination;
+    decoder >> destination;
+    if (!destination)
+        return WTF::nullopt;
+
+    Optional<DestinationColorSpace> colorSpace;
+    decoder >> colorSpace;
+    if (!colorSpace)
+        return WTF::nullopt;
+
+    return {{ *destination, WTFMove(*colorSpace) }};
+}
+
</ins><span class="cx"> class EndClipToDrawingCommands {
</span><span class="cx"> public:
</span><span class="cx">     static constexpr ItemType itemType = ItemType::EndClipToDrawingCommands;
</span><span class="lines">@@ -1938,23 +1969,54 @@
</span><span class="cx"> class GetPixelBuffer {
</span><span class="cx"> public:
</span><span class="cx">     static constexpr ItemType itemType = ItemType::GetPixelBuffer;
</span><del>-    static constexpr bool isInlineItem = true;
</del><ins>+    static constexpr bool isInlineItem = false;
</ins><span class="cx">     static constexpr bool isDrawingItem = false;
</span><span class="cx"> 
</span><del>-    GetPixelBuffer(WebCore::PixelBufferFormat outputFormat, const WebCore::IntRect& srcRect)
</del><ins>+    GetPixelBuffer(PixelBufferFormat outputFormat, const IntRect& srcRect)
</ins><span class="cx">         : m_srcRect(srcRect)
</span><del>-        , m_outputFormat(outputFormat)
</del><ins>+        , m_outputFormat(WTFMove(outputFormat))
</ins><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    PixelBufferFormat outputFormat() const { return m_outputFormat; }
</del><ins>+    // Explicit destructor added to force non-trivial destructor on all platforms
+    // as the encoding logic currently hardcodes which display list item types need
+    // out of line treatment rather than using the isInlineItem constant.
+    ~GetPixelBuffer() { }
+
+    const PixelBufferFormat& outputFormat() const { return m_outputFormat; }
</ins><span class="cx">     IntRect srcRect() const { return m_srcRect; }
</span><span class="cx"> 
</span><ins>+    template<class Encoder> void encode(Encoder&) const;
+    template<class Decoder> static Optional<GetPixelBuffer> decode(Decoder&);
+
</ins><span class="cx"> private:
</span><span class="cx">     IntRect m_srcRect;
</span><span class="cx">     PixelBufferFormat m_outputFormat;
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+template<class Encoder>
+void GetPixelBuffer::encode(Encoder& encoder) const
+{
+    encoder << m_srcRect;
+    encoder << m_outputFormat;
+}
+
+template<class Decoder>
+Optional<GetPixelBuffer> GetPixelBuffer::decode(Decoder& decoder)
+{
+    Optional<IntRect> srcRect;
+    decoder >> srcRect;
+    if (!srcRect)
+        return WTF::nullopt;
+
+    Optional<PixelBufferFormat> outputFormat;
+    decoder >> outputFormat;
+    if (!outputFormat)
+        return WTF::nullopt;
+
+    return {{ WTFMove(*outputFormat), *srcRect }};
+}
+
</ins><span class="cx"> class PutPixelBuffer {
</span><span class="cx"> public:
</span><span class="cx">     static constexpr ItemType itemType = ItemType::PutPixelBuffer;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsdisplaylistsDisplayListRecordercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.cpp      2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.cpp 2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -452,7 +452,7 @@
</span><span class="cx">     append<ClipToImageBuffer>(imageBuffer.renderingResourceIdentifier(), destRect);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Recorder::clipToDrawingCommands(const FloatRect& destination, DestinationColorSpace colorSpace, Function<void(GraphicsContext&)>&& drawingFunction)
</del><ins>+void Recorder::clipToDrawingCommands(const FloatRect& destination, const DestinationColorSpace& colorSpace, Function<void(GraphicsContext&)>&& drawingFunction)
</ins><span class="cx"> {
</span><span class="cx">     GraphicsContext nestedContext([&](GraphicsContext& context) {
</span><span class="cx">         auto initialClip = FloatRect(FloatPoint(), destination.size());
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsdisplaylistsDisplayListRecorderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.h (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.h        2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.h   2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -147,7 +147,7 @@
</span><span class="cx">     void clipPath(const Path&, WindRule) override;
</span><span class="cx">     IntRect clipBounds() override;
</span><span class="cx">     void clipToImageBuffer(WebCore::ImageBuffer&, const FloatRect&) override;
</span><del>-    void clipToDrawingCommands(const FloatRect& destination, DestinationColorSpace, Function<void(GraphicsContext&)>&&) override;
</del><ins>+    void clipToDrawingCommands(const FloatRect& destination, const DestinationColorSpace&, Function<void(GraphicsContext&)>&&) override;
</ins><span class="cx"> #if ENABLE(VIDEO)
</span><span class="cx">     void paintFrameForMedia(MediaPlayer&, const FloatRect& destination) override;
</span><span class="cx">     bool canPaintFrameForMedia(const MediaPlayer&) const override;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsfiltersFEDisplacementMapcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/filters/FEDisplacementMap.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/filters/FEDisplacementMap.cpp     2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/platform/graphics/filters/FEDisplacementMap.cpp        2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -69,7 +69,7 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void FEDisplacementMap::setResultColorSpace(DestinationColorSpace)
</del><ins>+void FEDisplacementMap::setResultColorSpace(const DestinationColorSpace&)
</ins><span class="cx"> {
</span><span class="cx">     // Spec: The 'color-interpolation-filters' property only applies to the 'in2' source image
</span><span class="cx">     // and does not apply to the 'in' source image. The 'in' source image must remain in its
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsfiltersFEDisplacementMaph"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/filters/FEDisplacementMap.h (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/filters/FEDisplacementMap.h       2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/platform/graphics/filters/FEDisplacementMap.h  2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -48,7 +48,7 @@
</span><span class="cx">     float scale() const { return m_scale; }
</span><span class="cx">     bool setScale(float);
</span><span class="cx"> 
</span><del>-    void setResultColorSpace(DestinationColorSpace) override;
</del><ins>+    void setResultColorSpace(const DestinationColorSpace&) override;
</ins><span class="cx">     void transformResultColorSpace(FilterEffect*, const int) override;
</span><span class="cx"> 
</span><span class="cx"> private:
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsfiltersFEFloodh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/filters/FEFlood.h (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/filters/FEFlood.h 2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/platform/graphics/filters/FEFlood.h    2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -40,8 +40,8 @@
</span><span class="cx"> #if !USE(CG)
</span><span class="cx">     // feFlood does not perform color interpolation of any kind, so the result is always in the current
</span><span class="cx">     // color space regardless of the value of color-interpolation-filters.
</span><del>-    void setOperatingColorSpace(DestinationColorSpace) override { FilterEffect::setResultColorSpace(DestinationColorSpace::SRGB); }
-    void setResultColorSpace(DestinationColorSpace) override { FilterEffect::setResultColorSpace(DestinationColorSpace::SRGB); }
</del><ins>+    void setOperatingColorSpace(const DestinationColorSpace&) override { FilterEffect::setResultColorSpace(DestinationColorSpace::SRGB()); }
+    void setResultColorSpace(const DestinationColorSpace&) override { FilterEffect::setResultColorSpace(DestinationColorSpace::SRGB()); }
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> private:
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsfiltersFETilecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/filters/FETile.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/filters/FETile.cpp        2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/platform/graphics/filters/FETile.cpp   2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -64,7 +64,7 @@
</span><span class="cx">         tileRect.scale(filter.filterResolution().width(), filter.filterResolution().height());
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    auto tileImage = SVGRenderingContext::createImageBuffer(tileRect, tileRect, DestinationColorSpace::SRGB, filter().renderingMode());
</del><ins>+    auto tileImage = SVGRenderingContext::createImageBuffer(tileRect, tileRect, DestinationColorSpace::SRGB(), filter().renderingMode());
</ins><span class="cx">     if (!tileImage)
</span><span class="cx">         return;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsfiltersFilterEffectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/filters/FilterEffect.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/filters/FilterEffect.cpp  2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/platform/graphics/filters/FilterEffect.cpp     2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -439,7 +439,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Optional<PixelBuffer> FilterEffect::convertPixelBufferToColorSpace(DestinationColorSpace targetColorSpace, PixelBuffer& pixelBuffer)
</del><ins>+Optional<PixelBuffer> FilterEffect::convertPixelBufferToColorSpace(const DestinationColorSpace& targetColorSpace, PixelBuffer& pixelBuffer)
</ins><span class="cx"> {
</span><span class="cx">     // FIXME: Using an ImageBuffer to perform the color space conversion is unnecessary. We can do it directly.
</span><span class="cx"> 
</span><span class="lines">@@ -454,7 +454,7 @@
</span><span class="cx">     return convertImageBufferToColorSpace(targetColorSpace, *buffer, destinationRect, pixelBuffer.format().alphaFormat);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Optional<PixelBuffer> FilterEffect::convertImageBufferToColorSpace(DestinationColorSpace targetColorSpace, ImageBuffer& inputBuffer, const IntRect& rect, AlphaPremultiplication outputAlphaFormat)
</del><ins>+Optional<PixelBuffer> FilterEffect::convertImageBufferToColorSpace(const DestinationColorSpace& targetColorSpace, ImageBuffer& inputBuffer, const IntRect& rect, AlphaPremultiplication outputAlphaFormat)
</ins><span class="cx"> {
</span><span class="cx">     // FIXME: This can be done more directly using PixelBufferConversion.
</span><span class="cx"> 
</span><span class="lines">@@ -472,7 +472,7 @@
</span><span class="cx">     return convertedBuffer->getPixelBuffer(format, rect);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void FilterEffect::copyConvertedImageBufferToDestination(Uint8ClampedArray& destination, DestinationColorSpace colorSpace, AlphaPremultiplication outputFormat, const IntRect& destRect)
</del><ins>+void FilterEffect::copyConvertedImageBufferToDestination(Uint8ClampedArray& destination, const DestinationColorSpace& colorSpace, AlphaPremultiplication outputFormat, const IntRect& destRect)
</ins><span class="cx"> {
</span><span class="cx">     // Converts the data stored in m_imageBufferResult, and save to destination
</span><span class="cx">     auto convertedPixelBuffer = convertImageBufferToColorSpace(colorSpace, *m_imageBufferResult, { IntPoint(), m_absolutePaintRect.size() }, outputFormat);
</span><span class="lines">@@ -481,7 +481,7 @@
</span><span class="cx">     copyImageBytes(convertedPixelBuffer->data(), destination, destRect);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void FilterEffect::copyConvertedPixelBufferToDestination(Uint8ClampedArray& destination, PixelBuffer& pixelBuffer, DestinationColorSpace colorSpace, const IntRect& destRect)
</del><ins>+void FilterEffect::copyConvertedPixelBufferToDestination(Uint8ClampedArray& destination, PixelBuffer& pixelBuffer, const DestinationColorSpace& colorSpace, const IntRect& destRect)
</ins><span class="cx"> {
</span><span class="cx">     // Converts the data stored in m_unmultipliedImageResult/m_premultipliedImageResult,
</span><span class="cx">     // whichever isn't null, and save to destination
</span><span class="lines">@@ -636,7 +636,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void FilterEffect::transformResultColorSpace(DestinationColorSpace destinationColorSpace)
</del><ins>+void FilterEffect::transformResultColorSpace(const DestinationColorSpace& destinationColorSpace)
</ins><span class="cx"> {
</span><span class="cx"> #if USE(CG)
</span><span class="cx">     // CG handles color space adjustments internally.
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsfiltersFilterEffecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/filters/FilterEffect.h (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/filters/FilterEffect.h    2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/platform/graphics/filters/FilterEffect.h       2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -23,7 +23,7 @@
</span><span class="cx"> #pragma once
</span><span class="cx"> 
</span><span class="cx"> #include "AlphaPremultiplication.h"
</span><del>-#include "ColorSpace.h"
</del><ins>+#include "DestinationColorSpace.h"
</ins><span class="cx"> #include "FloatRect.h"
</span><span class="cx"> #include "IntRect.h"
</span><span class="cx"> #include "IntRectExtent.h"
</span><span class="lines">@@ -165,13 +165,13 @@
</span><span class="cx">     bool clipsToBounds() const { return m_clipsToBounds; }
</span><span class="cx">     void setClipsToBounds(bool value) { m_clipsToBounds = value; }
</span><span class="cx"> 
</span><del>-    DestinationColorSpace operatingColorSpace() const { return m_operatingColorSpace; }
-    virtual void setOperatingColorSpace(DestinationColorSpace colorSpace) { m_operatingColorSpace = colorSpace; }
-    DestinationColorSpace resultColorSpace() const { return m_resultColorSpace; }
-    virtual void setResultColorSpace(DestinationColorSpace colorSpace) { m_resultColorSpace = colorSpace; }
</del><ins>+    const DestinationColorSpace& operatingColorSpace() const { return m_operatingColorSpace; }
+    virtual void setOperatingColorSpace(const DestinationColorSpace& colorSpace) { m_operatingColorSpace = colorSpace; }
+    const DestinationColorSpace& resultColorSpace() const { return m_resultColorSpace; }
+    virtual void setResultColorSpace(const DestinationColorSpace& colorSpace) { m_resultColorSpace = colorSpace; }
</ins><span class="cx"> 
</span><span class="cx">     virtual void transformResultColorSpace(FilterEffect* in, const int) { in->transformResultColorSpace(m_operatingColorSpace); }
</span><del>-    void transformResultColorSpace(DestinationColorSpace);
</del><ins>+    void transformResultColorSpace(const DestinationColorSpace&);
</ins><span class="cx">     
</span><span class="cx">     static Vector<float> normalizedFloats(const Vector<float>& values)
</span><span class="cx">     {
</span><span class="lines">@@ -203,11 +203,11 @@
</span><span class="cx">     virtual void platformApplySoftware() = 0;
</span><span class="cx"> 
</span><span class="cx">     void copyImageBytes(const Uint8ClampedArray& source, Uint8ClampedArray& destination, const IntRect&) const;
</span><del>-    void copyConvertedImageBufferToDestination(Uint8ClampedArray&, DestinationColorSpace, AlphaPremultiplication, const IntRect&);
-    void copyConvertedPixelBufferToDestination(Uint8ClampedArray&, PixelBuffer&, DestinationColorSpace, const IntRect&);
</del><ins>+    void copyConvertedImageBufferToDestination(Uint8ClampedArray&, const DestinationColorSpace&, AlphaPremultiplication, const IntRect&);
+    void copyConvertedPixelBufferToDestination(Uint8ClampedArray&, PixelBuffer&, const DestinationColorSpace&, const IntRect&);
</ins><span class="cx">     bool requiresPixelBufferColorSpaceConversion(Optional<DestinationColorSpace>);
</span><del>-    Optional<PixelBuffer> convertImageBufferToColorSpace(DestinationColorSpace, ImageBuffer&, const IntRect&, AlphaPremultiplication);
-    Optional<PixelBuffer> convertPixelBufferToColorSpace(DestinationColorSpace, PixelBuffer&);
</del><ins>+    Optional<PixelBuffer> convertImageBufferToColorSpace(const DestinationColorSpace&, ImageBuffer&, const IntRect&, AlphaPremultiplication);
+    Optional<PixelBuffer> convertPixelBufferToColorSpace(const DestinationColorSpace&, PixelBuffer&);
</ins><span class="cx">     
</span><span class="cx"> 
</span><span class="cx">     Filter& m_filter;
</span><span class="lines">@@ -244,13 +244,11 @@
</span><span class="cx">     bool m_clipsToBounds { true };
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(DESTINATION_COLOR_SPACE_LINEAR_SRGB)
</span><del>-    static constexpr auto defaultOperatingColorSpace = DestinationColorSpace::LinearSRGB;
</del><ins>+    DestinationColorSpace m_operatingColorSpace { DestinationColorSpace::LinearSRGB() };
</ins><span class="cx"> #else
</span><del>-    static constexpr auto defaultOperatingColorSpace = DestinationColorSpace::SRGB;
</del><ins>+    DestinationColorSpace m_operatingColorSpace { DestinationColorSpace::SRGB() };
</ins><span class="cx"> #endif
</span><del>-
-    DestinationColorSpace m_operatingColorSpace { defaultOperatingColorSpace };
-    DestinationColorSpace m_resultColorSpace { DestinationColorSpace::SRGB };
</del><ins>+    DestinationColorSpace m_resultColorSpace { DestinationColorSpace::SRGB() };
</ins><span class="cx">     
</span><span class="cx">     const Type m_filterEffectClassType;
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsfiltersSourceGraphich"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/filters/SourceGraphic.h (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/filters/SourceGraphic.h   2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/platform/graphics/filters/SourceGraphic.h      2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -36,7 +36,7 @@
</span><span class="cx">     SourceGraphic(Filter& filter)
</span><span class="cx">         : FilterEffect(filter, Type::SourceGraphic)
</span><span class="cx">     {
</span><del>-        setOperatingColorSpace(DestinationColorSpace::SRGB);
</del><ins>+        setOperatingColorSpace(DestinationColorSpace::SRGB());
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     const char* filterName() const final { return "SourceGraphic"; }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsnicosiacairoNicosiaCairoOperationRecordercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp   2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp      2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -1076,7 +1076,7 @@
</span><span class="cx">     m_commandList.append(WTFMove(command));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CairoOperationRecorder::clipToDrawingCommands(const FloatRect&, DestinationColorSpace, Function<void(GraphicsContext&)>&&)
</del><ins>+void CairoOperationRecorder::clipToDrawingCommands(const FloatRect&, const DestinationColorSpace&, Function<void(GraphicsContext&)>&&)
</ins><span class="cx"> {
</span><span class="cx">     // FIXME: Not implemented.
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsnicosiacairoNicosiaCairoOperationRecorderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.h (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.h     2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.h        2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -97,7 +97,7 @@
</span><span class="cx">     void clipPath(const WebCore::Path&, WebCore::WindRule) override;
</span><span class="cx">     WebCore::IntRect clipBounds() override;
</span><span class="cx">     void clipToImageBuffer(WebCore::ImageBuffer&, const WebCore::FloatRect&) override;
</span><del>-    void clipToDrawingCommands(const WebCore::FloatRect& destination, WebCore::DestinationColorSpace, Function<void(WebCore::GraphicsContext&)>&&) override;
</del><ins>+    void clipToDrawingCommands(const WebCore::FloatRect& destination, const WebCore::DestinationColorSpace&, Function<void(WebCore::GraphicsContext&)>&&) override;
</ins><span class="cx"> #if ENABLE(VIDEO)
</span><span class="cx">     void paintFrameForMedia(WebCore::MediaPlayer&, const WebCore::FloatRect& destination) override;
</span><span class="cx">     bool canPaintFrameForMedia(const WebCore::MediaPlayer&) const override { return false; }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsnicosiatexmapNicosiaGCGLLayercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/nicosia/texmap/NicosiaGCGLLayer.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/nicosia/texmap/NicosiaGCGLLayer.cpp       2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/platform/graphics/nicosia/texmap/NicosiaGCGLLayer.cpp  2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -81,7 +81,7 @@
</span><span class="cx">     IntSize textureSize(m_context.m_currentWidth, m_context.m_currentHeight);
</span><span class="cx">     TextureMapperGL::Flags flags = m_context.contextAttributes().alpha ? TextureMapperGL::ShouldBlend : 0;
</span><span class="cx"> #if USE(ANGLE)
</span><del>-    RefPtr<WebCore::ImageBuffer> imageBuffer = ImageBuffer::create(textureSize, RenderingMode::Unaccelerated, 1, DestinationColorSpace::SRGB, PixelFormat::BGRA8);
</del><ins>+    RefPtr<WebCore::ImageBuffer> imageBuffer = ImageBuffer::create(textureSize, RenderingMode::Unaccelerated, 1, DestinationColorSpace::SRGB(), PixelFormat::BGRA8);
</ins><span class="cx">     if (!imageBuffer)
</span><span class="cx">         return;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsopenglGraphicsContextGLOpenGLBasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGLBase.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGLBase.cpp    2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGLBase.cpp       2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -63,7 +63,7 @@
</span><span class="cx"> 
</span><span class="cx"> Optional<PixelBuffer> GraphicsContextGLOpenGL::readPixelsForPaintResults()
</span><span class="cx"> {
</span><del>-    PixelBufferFormat format { AlphaPremultiplication::Unpremultiplied, PixelFormat::RGBA8, DestinationColorSpace::SRGB };
</del><ins>+    PixelBufferFormat format { AlphaPremultiplication::Unpremultiplied, PixelFormat::RGBA8, DestinationColorSpace::SRGB() };
</ins><span class="cx">     auto pixelBuffer = PixelBuffer::tryCreate(format, getInternalFramebufferSize());
</span><span class="cx">     if (!pixelBuffer)
</span><span class="cx">         return WTF::nullopt;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsopenglGraphicsContextGLOpenGLEScpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGLES.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGLES.cpp      2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGLES.cpp 2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -66,7 +66,7 @@
</span><span class="cx"> 
</span><span class="cx"> Optional<PixelBuffer> GraphicsContextGLOpenGL::readPixelsForPaintResults()
</span><span class="cx"> {
</span><del>-    PixelBufferFormat format { AlphaPremultiplication::Unpremultiplied, PixelFormat::RGBA8, DestinationColorSpace::SRGB };
</del><ins>+    PixelBufferFormat format { AlphaPremultiplication::Unpremultiplied, PixelFormat::RGBA8, DestinationColorSpace::SRGB() };
</ins><span class="cx">     auto pixelBuffer = PixelBuffer::tryCreate(format, getInternalFramebufferSize());
</span><span class="cx">     if (!pixelBuffer)
</span><span class="cx">         return WTF::nullopt;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicstexmapBitmapTexturecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/texmap/BitmapTexture.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/texmap/BitmapTexture.cpp  2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/platform/graphics/texmap/BitmapTexture.cpp     2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -38,7 +38,7 @@
</span><span class="cx"> {
</span><span class="cx">     // Making an unconditionally unaccelerated buffer here is OK because this code
</span><span class="cx">     // isn't used by any platforms that respect the accelerated bit.
</span><del>-    auto imageBuffer = ImageBuffer::create(targetRect.size(), RenderingMode::Unaccelerated, 1, DestinationColorSpace::SRGB, PixelFormat::BGRA8);
</del><ins>+    auto imageBuffer = ImageBuffer::create(targetRect.size(), RenderingMode::Unaccelerated, 1, DestinationColorSpace::SRGB(), PixelFormat::BGRA8);
</ins><span class="cx">     if (!imageBuffer)
</span><span class="cx">         return;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgtkPlatformScreenGtkcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/gtk/PlatformScreenGtk.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/gtk/PlatformScreenGtk.cpp  2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/platform/gtk/PlatformScreenGtk.cpp     2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2006 Apple Inc.  All rights reserved.
</del><ins>+ * Copyright (C) 2006-2021 Apple Inc.  All rights reserved.
</ins><span class="cx">  * Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com
</span><span class="cx">  * Copyright (C) 2008 Christian Dywan <christian@imendio.com>
</span><span class="cx">  * Copyright (C) 2008 Collabora Ltd.
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "PlatformScreen.h"
</span><span class="cx"> 
</span><ins>+#include "DestinationColorSpace.h"
</ins><span class="cx"> #include "FloatRect.h"
</span><span class="cx"> #include "FrameView.h"
</span><span class="cx"> #include "GtkUtilities.h"
</span><span class="lines">@@ -85,6 +86,11 @@
</span><span class="cx">     return screenDepth(widget) < 2;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+DestinationColorSpace screenColorSpace(Widget*)
+{
+    return DestinationColorSpace::SRGB();
+}
+
</ins><span class="cx"> bool screenHasInvertedColors()
</span><span class="cx"> {
</span><span class="cx">     return false;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformiosPlatformScreenIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ios/PlatformScreenIOS.mm (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/PlatformScreenIOS.mm   2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/platform/ios/PlatformScreenIOS.mm      2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2006, 2014 Apple Inc.  All rights reserved.
</del><ins>+ * Copyright (C) 2006-2021 Apple Inc.  All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -88,9 +88,9 @@
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-CGColorSpaceRef screenColorSpace(Widget* widget)
</del><ins>+DestinationColorSpace screenColorSpace(Widget* widget)
</ins><span class="cx"> {
</span><del>-    return screenSupportsExtendedColor(widget) ? extendedSRGBColorSpaceRef() : sRGBColorSpaceRef();
</del><ins>+    return screenSupportsExtendedColor(widget) ? DestinationColorSpace { extendedSRGBColorSpaceRef() } : DestinationColorSpace::SRGB();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // These functions scale between screen and page coordinates because JavaScript/DOM operations
</span><span class="lines">@@ -193,9 +193,7 @@
</span><span class="cx">         FloatRect screenAvailableRect = screen.bounds;
</span><span class="cx">         screenAvailableRect.setY(NSMaxY(screen.bounds) - (screenAvailableRect.y() + screenAvailableRect.height())); // flip
</span><span class="cx">         FloatRect screenRect = screen._referenceBounds;
</span><del>-        
-        RetainPtr<CGColorSpaceRef> colorSpace = screenColorSpace(nullptr);
-        
</del><ins>+        DestinationColorSpace colorSpace { screenColorSpace(nullptr) };
</ins><span class="cx">         int screenDepth = WebCore::screenDepth(nullptr);
</span><span class="cx">         int screenDepthPerComponent = WebCore::screenDepthPerComponent(nullptr);
</span><span class="cx">         bool screenSupportsExtendedColor = WebCore::screenSupportsExtendedColor(nullptr);
</span><span class="lines">@@ -202,7 +200,7 @@
</span><span class="cx">         bool screenHasInvertedColors = WebCore::screenHasInvertedColors();
</span><span class="cx">         float scaleFactor = WebCore::screenPPIFactor();
</span><span class="cx"> 
</span><del>-        screenProperties.screenDataMap.set(++displayID, ScreenData { screenAvailableRect, screenRect, colorSpace, screenDepth, screenDepthPerComponent, screenSupportsExtendedColor, screenHasInvertedColors, false, scaleFactor });
</del><ins>+        screenProperties.screenDataMap.set(++displayID, ScreenData { screenAvailableRect, screenRect, WTFMove(colorSpace), screenDepth, screenDepthPerComponent, screenSupportsExtendedColor, screenHasInvertedColors, false, scaleFactor });
</ins><span class="cx">         
</span><span class="cx">         if (screen == [PAL::getUIScreenClass() mainScreen])
</span><span class="cx">             screenProperties.primaryDisplayID = displayID;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmacPlatformScreenMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mac/PlatformScreenMac.mm (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/PlatformScreenMac.mm   2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/platform/mac/PlatformScreenMac.mm      2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -130,9 +130,7 @@
</span><span class="cx">         FloatRect screenAvailableRect = screen.visibleFrame;
</span><span class="cx">         screenAvailableRect.setY(NSMaxY(screen.frame) - (screenAvailableRect.y() + screenAvailableRect.height())); // flip
</span><span class="cx">         FloatRect screenRect = screen.frame;
</span><del>-
-        RetainPtr<CGColorSpaceRef> colorSpace = screen.colorSpace.CGColorSpace;
-
</del><ins>+        DestinationColorSpace colorSpace { screen.colorSpace.CGColorSpace };
</ins><span class="cx">         int screenDepth = NSBitsPerPixelFromDepth(screen.depth);
</span><span class="cx">         int screenDepthPerComponent = NSBitsPerSampleFromDepth(screen.depth);
</span><span class="cx">         bool screenSupportsExtendedColor = [screen canRepresentDisplayGamut:NSDisplayGamutP3];
</span><span class="lines">@@ -163,7 +161,7 @@
</span><span class="cx">         if (displayMask)
</span><span class="cx">             gpuID = gpuIDForDisplayMask(displayMask);
</span><span class="cx"> 
</span><del>-        screenProperties.screenDataMap.set(displayID, ScreenData { screenAvailableRect, screenRect, colorSpace, screenDepth, screenDepthPerComponent, screenSupportsExtendedColor, screenHasInvertedColors, screenSupportsHighDynamicRange, screenIsMonochrome, displayMask, gpuID, dynamicRangeMode, scaleFactor });
</del><ins>+        screenProperties.screenDataMap.set(displayID, ScreenData { screenAvailableRect, screenRect, WTFMove(colorSpace), screenDepth, screenDepthPerComponent, screenSupportsExtendedColor, screenHasInvertedColors, screenSupportsHighDynamicRange, screenIsMonochrome, displayMask, gpuID, dynamicRangeMode, scaleFactor });
</ins><span class="cx"> 
</span><span class="cx">         if (!screenProperties.primaryDisplayID)
</span><span class="cx">             screenProperties.primaryDisplayID = displayID;
</span><span class="lines">@@ -340,13 +338,13 @@
</span><span class="cx">     return firstScreen();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-CGColorSpaceRef screenColorSpace(Widget* widget)
</del><ins>+DestinationColorSpace screenColorSpace(Widget* widget)
</ins><span class="cx"> {
</span><span class="cx">     if (auto data = screenProperties(widget))
</span><del>-        return data->colorSpace.get();
</del><ins>+        return data->colorSpace;
</ins><span class="cx"> 
</span><span class="cx">     ASSERT(hasProcessPrivilege(ProcessPrivilege::CanCommunicateWithWindowServer));
</span><del>-    return screen(widget).colorSpace.CGColorSpace;
</del><ins>+    return DestinationColorSpace { screen(widget).colorSpace.CGColorSpace };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool screenSupportsExtendedColor(Widget* widget)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmacThemeMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mac/ThemeMac.mm (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/ThemeMac.mm    2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/platform/mac/ThemeMac.mm       2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -726,7 +726,7 @@
</span><span class="cx"> 
</span><span class="cx">     if (useImageBuffer) {
</span><span class="cx">         NSRect imageBufferDrawRect = NSRect(FloatRect(buttonFocusRectOutlineWidth, buttonFocusRectOutlineWidth, rect.width(), rect.height()));
</span><del>-        auto imageBuffer = ImageBuffer::createCompatibleBuffer(rect.size() + 2 * FloatSize(buttonFocusRectOutlineWidth, buttonFocusRectOutlineWidth), deviceScaleFactor, DestinationColorSpace::SRGB, context);
</del><ins>+        auto imageBuffer = ImageBuffer::createCompatibleBuffer(rect.size() + 2 * FloatSize(buttonFocusRectOutlineWidth, buttonFocusRectOutlineWidth), deviceScaleFactor, DestinationColorSpace::SRGB(), context);
</ins><span class="cx">         if (!imageBuffer)
</span><span class="cx">             return needsRepaint;
</span><span class="cx">         {
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreamgstreamerMockRealtimeVideoSourceGStreamercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mediastream/gstreamer/MockRealtimeVideoSourceGStreamer.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/gstreamer/MockRealtimeVideoSourceGStreamer.cpp 2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/platform/mediastream/gstreamer/MockRealtimeVideoSourceGStreamer.cpp    2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -67,7 +67,7 @@
</span><span class="cx">     if (!imageBuffer)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    auto pixelBuffer = imageBuffer->getPixelBuffer({ AlphaPremultiplication::Unpremultiplied, PixelFormat::BGRA8, DestinationColorSpace::SRGB }, { { }, imageBuffer->logicalSize() });
</del><ins>+    auto pixelBuffer = imageBuffer->getPixelBuffer({ AlphaPremultiplication::Unpremultiplied, PixelFormat::BGRA8, DestinationColorSpace::SRGB() }, { { }, imageBuffer->logicalSize() });
</ins><span class="cx">     if (!pixelBuffer)
</span><span class="cx">         return;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmockMockRealtimeVideoSourcecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mock/MockRealtimeVideoSource.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mock/MockRealtimeVideoSource.cpp   2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/platform/mock/MockRealtimeVideoSource.cpp      2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -454,7 +454,7 @@
</span><span class="cx">     if (m_imageBuffer)
</span><span class="cx">         return m_imageBuffer.get();
</span><span class="cx"> 
</span><del>-    m_imageBuffer = ImageBuffer::create(captureSize(), RenderingMode::Unaccelerated, 1, DestinationColorSpace::SRGB, PixelFormat::BGRA8);
</del><ins>+    m_imageBuffer = ImageBuffer::create(captureSize(), RenderingMode::Unaccelerated, 1, DestinationColorSpace::SRGB(), PixelFormat::BGRA8);
</ins><span class="cx">     if (!m_imageBuffer)
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformplaystationPlatformScreenPlayStationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/playstation/PlatformScreenPlayStation.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/playstation/PlatformScreenPlayStation.cpp  2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/platform/playstation/PlatformScreenPlayStation.cpp     2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -26,6 +26,7 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "PlatformScreen.h"
</span><span class="cx"> 
</span><ins>+#include "DestinationColorSpace.h"
</ins><span class="cx"> #include "FloatRect.h"
</span><span class="cx"> #include "NotImplemented.h"
</span><span class="cx"> 
</span><span class="lines">@@ -71,4 +72,9 @@
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+DestinationColorSpace screenColorSpace(Widget*)
+{
+    return DestinationColorSpace::SRGB();
+}
+
</ins><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformwinPlatformScreenWincpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/win/PlatformScreenWin.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/win/PlatformScreenWin.cpp  2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/platform/win/PlatformScreenWin.cpp     2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "PlatformScreen.h"
</span><span class="cx"> 
</span><ins>+#include "DestinationColorSpace.h"
</ins><span class="cx"> #include "FloatRect.h"
</span><span class="cx"> #include "Frame.h"
</span><span class="cx"> #include "FrameView.h"
</span><span class="lines">@@ -104,12 +105,10 @@
</span><span class="cx">     return monitorInfo.rcWork;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#if USE(CG)
-CGColorSpaceRef screenColorSpace(Widget*)
</del><ins>+DestinationColorSpace screenColorSpace(Widget*)
</ins><span class="cx"> {
</span><del>-    return sRGBColorSpaceRef();
</del><ins>+    return DestinationColorSpace::SRGB();
</ins><span class="cx"> }
</span><del>-#endif
</del><span class="cx"> 
</span><span class="cx"> bool screenSupportsExtendedColor(Widget*)
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformwpePlatformScreenWPEcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/wpe/PlatformScreenWPE.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/wpe/PlatformScreenWPE.cpp  2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/platform/wpe/PlatformScreenWPE.cpp     2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -26,6 +26,7 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "PlatformScreen.h"
</span><span class="cx"> 
</span><ins>+#include "DestinationColorSpace.h"
</ins><span class="cx"> #include "FloatRect.h"
</span><span class="cx"> #include "NotImplemented.h"
</span><span class="cx"> #include "Widget.h"
</span><span class="lines">@@ -81,6 +82,11 @@
</span><span class="cx">     return screenRect(widget);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+DestinationColorSpace screenColorSpace(Widget*)
+{
+    return DestinationColorSpace::SRGB();
+}
+
</ins><span class="cx"> bool screenSupportsExtendedColor(Widget*)
</span><span class="cx"> {
</span><span class="cx">     return false;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformxrPlatformXRh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/xr/PlatformXR.h (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/xr/PlatformXR.h    2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/platform/xr/PlatformXR.h       2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -18,6 +18,7 @@
</span><span class="cx">  */
</span><span class="cx"> #pragma once
</span><span class="cx"> 
</span><ins>+#include "DestinationColorSpace.h"
</ins><span class="cx"> #include "FloatPoint3D.h"
</span><span class="cx"> #include "GraphicsTypesGL.h"
</span><span class="cx"> #include "IntRect.h"
</span><span class="lines">@@ -32,8 +33,7 @@
</span><span class="cx"> #include <wtf/WeakPtr.h>
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(COCOA)
</span><del>-#include <WebCore/ColorSpaceCG.h>
-#include <WebCore/IOSurface.h>
</del><ins>+#include "IOSurface.h"
</ins><span class="cx"> #include <wtf/MachSendRight.h>
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="lines">@@ -446,7 +446,7 @@
</span><span class="cx">     WTF::MachSendRight surfaceSendRight;
</span><span class="cx">     if (!decoder.decode(surfaceSendRight))
</span><span class="cx">         return WTF::nullopt;
</span><del>-    layerData.surface = WebCore::IOSurface::createFromSendRight(WTFMove(surfaceSendRight), WebCore::sRGBColorSpaceRef());
</del><ins>+    layerData.surface = WebCore::IOSurface::createFromSendRight(WTFMove(surfaceSendRight), WebCore::DestinationColorSpace::SRGB());
</ins><span class="cx"> #endif
</span><span class="cx">     return layerData;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingCSSFiltercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/CSSFilter.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/CSSFilter.cpp     2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/rendering/CSSFilter.cpp        2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -111,9 +111,9 @@
</span><span class="cx">         effectElement.setStandardAttributes(effect.get());
</span><span class="cx">         if (effectElement.renderer()) {
</span><span class="cx"> #if ENABLE(DESTINATION_COLOR_SPACE_LINEAR_SRGB)
</span><del>-            effect->setOperatingColorSpace(effectElement.renderer()->style().svgStyle().colorInterpolationFilters() == ColorInterpolation::LinearRGB ? DestinationColorSpace::LinearSRGB : DestinationColorSpace::SRGB);
</del><ins>+            effect->setOperatingColorSpace(effectElement.renderer()->style().svgStyle().colorInterpolationFilters() == ColorInterpolation::LinearRGB ? DestinationColorSpace::LinearSRGB() : DestinationColorSpace::SRGB());
</ins><span class="cx"> #else
</span><del>-            effect->setOperatingColorSpace(DestinationColorSpace::SRGB);
</del><ins>+            effect->setOperatingColorSpace(DestinationColorSpace::SRGB());
</ins><span class="cx"> #endif
</span><span class="cx">         }
</span><span class="cx">         builder->add(effectElement.result(), effect);
</span><span class="lines">@@ -296,7 +296,7 @@
</span><span class="cx">             // Unlike SVG Filters and CSSFilterImages, filter functions on the filter
</span><span class="cx">             // property applied here should not clip to their primitive subregions.
</span><span class="cx">             effect->setClipsToBounds(consumer == FilterConsumer::FilterFunction);
</span><del>-            effect->setOperatingColorSpace(DestinationColorSpace::SRGB);
</del><ins>+            effect->setOperatingColorSpace(DestinationColorSpace::SRGB());
</ins><span class="cx">             
</span><span class="cx">             if (filterOperation.type() != FilterOperation::REFERENCE) {
</span><span class="cx">                 effect->inputEffects() = { WTFMove(previousEffect) };
</span><span class="lines">@@ -344,11 +344,11 @@
</span><span class="cx">     IntSize logicalSize { m_sourceDrawingRegion.size() };
</span><span class="cx">     if (!sourceImage() || sourceImage()->logicalSize() != logicalSize) {
</span><span class="cx"> #if USE(DIRECT2D)
</span><del>-        setSourceImage(ImageBuffer::create(logicalSize, renderingMode(), &targetContext, filterScale(), DestinationColorSpace::SRGB, PixelFormat::BGRA8));
</del><ins>+        setSourceImage(ImageBuffer::create(logicalSize, renderingMode(), &targetContext, filterScale(), DestinationColorSpace::SRGB(), PixelFormat::BGRA8));
</ins><span class="cx"> #else
</span><span class="cx">         UNUSED_PARAM(targetContext);
</span><span class="cx">         RenderingMode mode = m_filterRenderer ? RenderingMode::Accelerated : renderingMode();
</span><del>-        setSourceImage(ImageBuffer::create(logicalSize, mode, filterScale(), DestinationColorSpace::SRGB, PixelFormat::BGRA8));
</del><ins>+        setSourceImage(ImageBuffer::create(logicalSize, mode, filterScale(), DestinationColorSpace::SRGB(), PixelFormat::BGRA8));
</ins><span class="cx"> #endif
</span><span class="cx">     }
</span><span class="cx">     m_graphicsBufferAttached = true;
</span><span class="lines">@@ -382,12 +382,12 @@
</span><span class="cx">     if (m_filterRenderer) {
</span><span class="cx">         m_filterRenderer->applyEffects(effect);
</span><span class="cx">         if (m_filterRenderer->hasResult()) {
</span><del>-            effect.transformResultColorSpace(DestinationColorSpace::SRGB);
</del><ins>+            effect.transformResultColorSpace(DestinationColorSpace::SRGB());
</ins><span class="cx">             return;
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx">     effect.apply();
</span><del>-    effect.transformResultColorSpace(DestinationColorSpace::SRGB);
</del><ins>+    effect.transformResultColorSpace(DestinationColorSpace::SRGB());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> LayoutRect CSSFilter::computeSourceImageRectForDirtyRect(const LayoutRect& filterBoxRect, const LayoutRect& dirtyRect)
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBoxModelObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp  2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp     2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -876,7 +876,7 @@
</span><span class="cx">         maskRect.intersect(snappedIntRect(paintInfo.rect));
</span><span class="cx"> 
</span><span class="cx">         // Now create the mask.
</span><del>-        maskImage = ImageBuffer::createCompatibleBuffer(maskRect.size(), DestinationColorSpace::SRGB, context);
</del><ins>+        maskImage = ImageBuffer::createCompatibleBuffer(maskRect.size(), DestinationColorSpace::SRGB(), context);
</ins><span class="cx">         if (!maskImage)
</span><span class="cx">             return;
</span><span class="cx">         paintMaskForTextFillBox(maskImage.get(), maskRect, box, scrolledPaintRect);
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayerBackingcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayerBacking.cpp    2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.cpp       2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -3267,7 +3267,7 @@
</span><span class="cx"> {
</span><span class="cx">     const FloatSize tileSize { 32, 18 };
</span><span class="cx"> 
</span><del>-    auto imageBuffer = ImageBuffer::createCompatibleBuffer(tileSize, DestinationColorSpace::SRGB, destContext);
</del><ins>+    auto imageBuffer = ImageBuffer::createCompatibleBuffer(tileSize, DestinationColorSpace::SRGB(), destContext);
</ins><span class="cx">     if (!imageBuffer)
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderThemeIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderThemeIOS.mm (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderThemeIOS.mm 2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/rendering/RenderThemeIOS.mm    2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -1983,11 +1983,11 @@
</span><span class="cx">     IOSurfaceRef surface;
</span><span class="cx">     if (useSmallBadge) {
</span><span class="cx">         if (!m_smallBadgeSurface)
</span><del>-            m_smallBadgeSurface = IOSurface::create({ smallBadgeDimension, smallBadgeDimension }, sRGBColorSpaceRef());
</del><ins>+            m_smallBadgeSurface = IOSurface::create({ smallBadgeDimension, smallBadgeDimension }, DestinationColorSpace::SRGB());
</ins><span class="cx">         surface = m_smallBadgeSurface->surface();
</span><span class="cx">     } else {
</span><span class="cx">         if (!m_largeBadgeSurface)
</span><del>-            m_largeBadgeSurface = IOSurface::create({ largeBadgeDimension, largeBadgeDimension }, sRGBColorSpaceRef());
</del><ins>+            m_largeBadgeSurface = IOSurface::create({ largeBadgeDimension, largeBadgeDimension }, DestinationColorSpace::SRGB());
</ins><span class="cx">         surface = m_largeBadgeSurface->surface();
</span><span class="cx">     }
</span><span class="cx">     [m_ciContext.get() render:translatedImage toIOSurface:surface bounds:badgeRect colorSpace:sRGBColorSpaceRef()];
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderThemeMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderThemeMac.mm (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderThemeMac.mm 2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/rendering/RenderThemeMac.mm    2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -1309,7 +1309,7 @@
</span><span class="cx">     const auto& renderProgress = downcast<RenderProgress>(renderObject);
</span><span class="cx">     float deviceScaleFactor = renderObject.document().deviceScaleFactor();
</span><span class="cx">     bool isIndeterminate = renderProgress.position() < 0;
</span><del>-    auto imageBuffer = ImageBuffer::createCompatibleBuffer(inflatedRect.size(), deviceScaleFactor, DestinationColorSpace::SRGB, paintInfo.context());
</del><ins>+    auto imageBuffer = ImageBuffer::createCompatibleBuffer(inflatedRect.size(), deviceScaleFactor, DestinationColorSpace::SRGB(), paintInfo.context());
</ins><span class="cx">     if (!imageBuffer)
</span><span class="cx">         return true;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingshapesShapecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/shapes/Shape.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/shapes/Shape.cpp  2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/rendering/shapes/Shape.cpp     2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -181,7 +181,7 @@
</span><span class="cx">     IntRect marginRect = snappedIntRect(marginR);
</span><span class="cx">     auto intervals = makeUnique<RasterShapeIntervals>(marginRect.height(), -marginRect.y());
</span><span class="cx">     // FIXME (149420): This buffer should not be unconditionally unaccelerated.
</span><del>-    auto imageBuffer = ImageBuffer::create(imageRect.size(), RenderingMode::Unaccelerated, 1, DestinationColorSpace::SRGB, PixelFormat::BGRA8);
</del><ins>+    auto imageBuffer = ImageBuffer::create(imageRect.size(), RenderingMode::Unaccelerated, 1, DestinationColorSpace::SRGB(), PixelFormat::BGRA8);
</ins><span class="cx"> 
</span><span class="cx">     auto createShape = [&]() {
</span><span class="cx">         auto rasterShape = makeUnique<RasterShape>(WTFMove(intervals), marginRect.size());
</span><span class="lines">@@ -197,7 +197,7 @@
</span><span class="cx">     if (image)
</span><span class="cx">         graphicsContext.drawImage(*image, IntRect(IntPoint(), imageRect.size()));
</span><span class="cx"> 
</span><del>-    PixelBufferFormat format { AlphaPremultiplication::Unpremultiplied, PixelFormat::RGBA8, DestinationColorSpace::SRGB };
</del><ins>+    PixelBufferFormat format { AlphaPremultiplication::Unpremultiplied, PixelFormat::RGBA8, DestinationColorSpace::SRGB() };
</ins><span class="cx">     auto pixelBuffer = imageBuffer->getPixelBuffer(format, { IntPoint(), imageRect.size() });
</span><span class="cx">     
</span><span class="cx">     // We could get to a value where PixelBuffer could be nullopt. A case where ImageRect.size() is huge, PixelBuffer::tryCreate
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgRenderSVGResourceClippercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/RenderSVGResourceClipper.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/RenderSVGResourceClipper.cpp  2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGResourceClipper.cpp     2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -146,7 +146,7 @@
</span><span class="cx">     AffineTransform absoluteTransform = SVGRenderingContext::calculateTransformationToOutermostCoordinateSystem(renderer);
</span><span class="cx">     if (!clipperData.isValidForGeometry(objectBoundingBox, absoluteTransform)) {
</span><span class="cx">         // FIXME (149469): This image buffer should not be unconditionally unaccelerated. Making it match the context breaks nested clipping, though.
</span><del>-        auto maskImage = SVGRenderingContext::createImageBuffer(objectBoundingBox, absoluteTransform, DestinationColorSpace::SRGB, RenderingMode::Unaccelerated, &context);
</del><ins>+        auto maskImage = SVGRenderingContext::createImageBuffer(objectBoundingBox, absoluteTransform, DestinationColorSpace::SRGB(), RenderingMode::Unaccelerated, &context);
</ins><span class="cx">         if (!maskImage)
</span><span class="cx">             return false;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgRenderSVGResourceFiltercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/RenderSVGResourceFilter.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/RenderSVGResourceFilter.cpp   2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGResourceFilter.cpp      2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -104,9 +104,9 @@
</span><span class="cx">         effect->setEffectBoundaries(SVGLengthContext::resolveRectangle<SVGFilterPrimitiveStandardAttributes>(&element, filterElement().primitiveUnits(), targetBoundingBox));
</span><span class="cx">         if (element.renderer()) {
</span><span class="cx"> #if ENABLE(DESTINATION_COLOR_SPACE_LINEAR_SRGB)
</span><del>-            effect->setOperatingColorSpace(element.renderer()->style().svgStyle().colorInterpolationFilters() == ColorInterpolation::LinearRGB ? DestinationColorSpace::LinearSRGB : DestinationColorSpace::SRGB);
</del><ins>+            effect->setOperatingColorSpace(element.renderer()->style().svgStyle().colorInterpolationFilters() == ColorInterpolation::LinearRGB ? DestinationColorSpace::LinearSRGB() : DestinationColorSpace::SRGB());
</ins><span class="cx"> #else
</span><del>-            effect->setOperatingColorSpace(DestinationColorSpace::SRGB);
</del><ins>+            effect->setOperatingColorSpace(DestinationColorSpace::SRGB());
</ins><span class="cx"> #endif
</span><span class="cx">         }
</span><span class="cx">         builder->add(element.result(), WTFMove(effect));
</span><span class="lines">@@ -198,9 +198,9 @@
</span><span class="cx"> 
</span><span class="cx">     auto renderingMode = renderer.settings().acceleratedFiltersEnabled() ? RenderingMode::Accelerated : RenderingMode::Unaccelerated;
</span><span class="cx"> #if ENABLE(DESTINATION_COLOR_SPACE_LINEAR_SRGB)
</span><del>-    auto colorSpace = DestinationColorSpace::LinearSRGB;
</del><ins>+    auto colorSpace = DestinationColorSpace::LinearSRGB();
</ins><span class="cx"> #else
</span><del>-    auto colorSpace = DestinationColorSpace::SRGB;
</del><ins>+    auto colorSpace = DestinationColorSpace::SRGB();
</ins><span class="cx"> #endif
</span><span class="cx">     auto sourceGraphic = SVGRenderingContext::createImageBuffer(filterData->drawingRegion, effectiveTransform, colorSpace, renderingMode, context);
</span><span class="cx">     if (!sourceGraphic) {
</span><span class="lines">@@ -281,7 +281,7 @@
</span><span class="cx">             filterData.state = FilterData::Applying;
</span><span class="cx">             lastEffect->apply();
</span><span class="cx">             lastEffect->correctFilterResultIfNeeded();
</span><del>-            lastEffect->transformResultColorSpace(DestinationColorSpace::SRGB);
</del><ins>+            lastEffect->transformResultColorSpace(DestinationColorSpace::SRGB());
</ins><span class="cx">         }
</span><span class="cx">         filterData.state = FilterData::Built;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgRenderSVGResourceGradientcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/RenderSVGResourceGradient.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/RenderSVGResourceGradient.cpp 2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGResourceGradient.cpp    2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -60,7 +60,7 @@
</span><span class="cx">     AffineTransform absoluteTransform = SVGRenderingContext::calculateTransformationToOutermostCoordinateSystem(*textRootBlock);
</span><span class="cx">     FloatRect repaintRect = textRootBlock->repaintRectInLocalCoordinates();
</span><span class="cx"> 
</span><del>-    auto maskImage = SVGRenderingContext::createImageBuffer(repaintRect, absoluteTransform, DestinationColorSpace::SRGB, context->renderingMode());
</del><ins>+    auto maskImage = SVGRenderingContext::createImageBuffer(repaintRect, absoluteTransform, DestinationColorSpace::SRGB(), context->renderingMode());
</ins><span class="cx">     if (!maskImage)
</span><span class="cx">         return false;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgRenderSVGResourceMaskercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/RenderSVGResourceMasker.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/RenderSVGResourceMasker.cpp   2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGResourceMasker.cpp      2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -71,9 +71,9 @@
</span><span class="cx">         const SVGRenderStyle& svgStyle = style().svgStyle();
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(DESTINATION_COLOR_SPACE_LINEAR_SRGB)
</span><del>-        auto colorSpace = svgStyle.colorInterpolation() == ColorInterpolation::LinearRGB ? DestinationColorSpace::LinearSRGB : DestinationColorSpace::SRGB;
</del><ins>+        auto colorSpace = svgStyle.colorInterpolation() == ColorInterpolation::LinearRGB ? DestinationColorSpace::LinearSRGB() : DestinationColorSpace::SRGB();
</ins><span class="cx"> #else
</span><del>-        auto colorSpace = DestinationColorSpace::SRGB;
</del><ins>+        auto colorSpace = DestinationColorSpace::SRGB();
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">         // FIXME (149470): This image buffer should not be unconditionally unaccelerated. Making it match the context breaks alpha masking, though.
</span><span class="lines">@@ -92,7 +92,7 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool RenderSVGResourceMasker::drawContentIntoMaskImage(MaskerData* maskerData, DestinationColorSpace colorSpace, RenderObject* object)
</del><ins>+bool RenderSVGResourceMasker::drawContentIntoMaskImage(MaskerData* maskerData, const DestinationColorSpace& colorSpace, RenderObject* object)
</ins><span class="cx"> {
</span><span class="cx">     GraphicsContext& maskImageContext = maskerData->maskImage->context();
</span><span class="cx"> 
</span><span class="lines">@@ -119,7 +119,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx"> #if !USE(CG)
</span><del>-    maskerData->maskImage->transformColorSpace(DestinationColorSpace::SRGB, colorSpace);
</del><ins>+    maskerData->maskImage->transformColorSpace(DestinationColorSpace::SRGB(), colorSpace);
</ins><span class="cx"> #else
</span><span class="cx">     UNUSED_PARAM(colorSpace);
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgRenderSVGResourceMaskerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/RenderSVGResourceMasker.h (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/RenderSVGResourceMasker.h     2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGResourceMasker.h        2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -58,7 +58,7 @@
</span><span class="cx"> 
</span><span class="cx">     const char* renderName() const override { return "RenderSVGResourceMasker"; }
</span><span class="cx"> 
</span><del>-    bool drawContentIntoMaskImage(MaskerData*, DestinationColorSpace, RenderObject*);
</del><ins>+    bool drawContentIntoMaskImage(MaskerData*, const DestinationColorSpace&, RenderObject*);
</ins><span class="cx">     void calculateMaskContentRepaintRect();
</span><span class="cx"> 
</span><span class="cx">     FloatRect m_maskContentBoundaries;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgRenderSVGResourcePatterncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/RenderSVGResourcePattern.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/RenderSVGResourcePattern.cpp  2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGResourcePattern.cpp     2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -253,7 +253,7 @@
</span><span class="cx"> RefPtr<ImageBuffer> RenderSVGResourcePattern::createTileImage(const PatternAttributes& attributes, const FloatRect& tileBoundaries, const FloatRect& absoluteTileBoundaries, const AffineTransform& tileImageTransform, FloatRect& clampedAbsoluteTileBoundaries, RenderingMode renderingMode) const
</span><span class="cx"> {
</span><span class="cx">     clampedAbsoluteTileBoundaries = ImageBuffer::clampedRect(absoluteTileBoundaries);
</span><del>-    auto tileImage = SVGRenderingContext::createImageBuffer(absoluteTileBoundaries, clampedAbsoluteTileBoundaries, DestinationColorSpace::SRGB, renderingMode);
</del><ins>+    auto tileImage = SVGRenderingContext::createImageBuffer(absoluteTileBoundaries, clampedAbsoluteTileBoundaries, DestinationColorSpace::SRGB(), renderingMode);
</ins><span class="cx">     if (!tileImage)
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgSVGRenderingContextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/SVGRenderingContext.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/SVGRenderingContext.cpp       2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/rendering/svg/SVGRenderingContext.cpp  2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -236,7 +236,7 @@
</span><span class="cx">     return absoluteTransform;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr<ImageBuffer> SVGRenderingContext::createImageBuffer(const FloatRect& targetRect, const AffineTransform& absoluteTransform, DestinationColorSpace colorSpace, RenderingMode renderingMode, const GraphicsContext* context)
</del><ins>+RefPtr<ImageBuffer> SVGRenderingContext::createImageBuffer(const FloatRect& targetRect, const AffineTransform& absoluteTransform, const DestinationColorSpace& colorSpace, RenderingMode renderingMode, const GraphicsContext* context)
</ins><span class="cx"> {
</span><span class="cx">     IntRect paintRect = calculateImageBufferRect(targetRect, absoluteTransform);
</span><span class="cx">     // Don't create empty ImageBuffers.
</span><span class="lines">@@ -264,7 +264,7 @@
</span><span class="cx">     return imageBuffer;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr<ImageBuffer> SVGRenderingContext::createImageBuffer(const FloatRect& targetRect, const FloatRect& clampedRect, DestinationColorSpace colorSpace, RenderingMode renderingMode, const GraphicsContext* context)
</del><ins>+RefPtr<ImageBuffer> SVGRenderingContext::createImageBuffer(const FloatRect& targetRect, const FloatRect& clampedRect, const DestinationColorSpace& colorSpace, RenderingMode renderingMode, const GraphicsContext* context)
</ins><span class="cx"> {
</span><span class="cx">     IntSize clampedSize = roundedIntSize(clampedRect.size());
</span><span class="cx">     FloatSize unclampedSize = roundedIntSize(targetRect.size());
</span><span class="lines">@@ -350,7 +350,7 @@
</span><span class="cx"> 
</span><span class="cx">     // Create a new buffer and paint the foreground into it.
</span><span class="cx">     if (!imageBuffer) {
</span><del>-        imageBuffer = ImageBuffer::createCompatibleBuffer(expandedIntSize(boundingBox.size()), DestinationColorSpace::SRGB, m_paintInfo->context());
</del><ins>+        imageBuffer = ImageBuffer::createCompatibleBuffer(expandedIntSize(boundingBox.size()), DestinationColorSpace::SRGB(), m_paintInfo->context());
</ins><span class="cx">         if (!imageBuffer)
</span><span class="cx">             return false;
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgSVGRenderingContexth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/SVGRenderingContext.h (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/SVGRenderingContext.h 2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/rendering/svg/SVGRenderingContext.h    2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -60,8 +60,8 @@
</span><span class="cx">     void prepareToRenderSVGContent(RenderElement&, PaintInfo&, NeedsGraphicsContextSave = DontSaveGraphicsContext);
</span><span class="cx">     bool isRenderingPrepared() const { return m_renderingFlags & RenderingPrepared; }
</span><span class="cx"> 
</span><del>-    static RefPtr<ImageBuffer> createImageBuffer(const FloatRect& targetRect, const AffineTransform& absoluteTransform, DestinationColorSpace, RenderingMode, const GraphicsContext* = nullptr);
-    static RefPtr<ImageBuffer> createImageBuffer(const FloatRect& targetRect, const FloatRect& clampedRect, DestinationColorSpace, RenderingMode, const GraphicsContext* = nullptr);
</del><ins>+    static RefPtr<ImageBuffer> createImageBuffer(const FloatRect& targetRect, const AffineTransform& absoluteTransform, const DestinationColorSpace&, RenderingMode, const GraphicsContext* = nullptr);
+    static RefPtr<ImageBuffer> createImageBuffer(const FloatRect& targetRect, const FloatRect& clampedRect, const DestinationColorSpace&, RenderingMode, const GraphicsContext* = nullptr);
</ins><span class="cx"> 
</span><span class="cx">     static void renderSubtreeToContext(GraphicsContext&, RenderElement&, const AffineTransform&);
</span><span class="cx">     static void clipToImageBuffer(GraphicsContext&, const AffineTransform& absoluteTransform, const FloatRect& targetRect, RefPtr<ImageBuffer>&, bool safeToClear);
</span></span></pre></div>
<a id="trunkSourceWebCoresvggraphicsSVGImagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/graphics/SVGImage.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/graphics/SVGImage.cpp   2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/svg/graphics/SVGImage.cpp      2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -217,7 +217,7 @@
</span><span class="cx">     if (!m_page)
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><del>-    auto imageBuffer = ImageBuffer::create(size(), RenderingMode::Unaccelerated, 1, DestinationColorSpace::SRGB, PixelFormat::BGRA8);
</del><ins>+    auto imageBuffer = ImageBuffer::create(size(), RenderingMode::Unaccelerated, 1, DestinationColorSpace::SRGB(), PixelFormat::BGRA8);
</ins><span class="cx">     if (!imageBuffer)
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="lines">@@ -247,7 +247,7 @@
</span><span class="cx">     FloatRect imageBufferSize = zoomedContainerRect;
</span><span class="cx">     imageBufferSize.scale(imageBufferScale.width(), imageBufferScale.height());
</span><span class="cx"> 
</span><del>-    auto buffer = ImageBuffer::createCompatibleBuffer(expandedIntSize(imageBufferSize.size()), 1, DestinationColorSpace::SRGB, context);
</del><ins>+    auto buffer = ImageBuffer::createCompatibleBuffer(expandedIntSize(imageBufferSize.size()), 1, DestinationColorSpace::SRGB(), context);
</ins><span class="cx">     if (!buffer) // Failed to allocate buffer.
</span><span class="cx">         return;
</span><span class="cx">     drawForContainer(buffer->context(), containerSize, containerZoom, initialFragmentURL, imageBufferSize, zoomedContainerRect);
</span></span></pre></div>
<a id="trunkSourceWebCoresvggraphicsfiltersSVGFEImagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/graphics/filters/SVGFEImage.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/graphics/filters/SVGFEImage.cpp 2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebCore/svg/graphics/filters/SVGFEImage.cpp    2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -93,8 +93,8 @@
</span><span class="cx">     if (!m_image && !renderer)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    // FEImage results are always in DestinationColorSpace::SRGB
-    setResultColorSpace(DestinationColorSpace::SRGB);
</del><ins>+    // FEImage results are always in DestinationColorSpace::SRGB()
+    setResultColorSpace(DestinationColorSpace::SRGB());
</ins><span class="cx"> 
</span><span class="cx">     ImageBuffer* resultImage = createImageBufferResult();
</span><span class="cx">     if (!resultImage)
</span></span></pre></div>
<a id="trunkSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ChangeLog (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ChangeLog    2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebKit/ChangeLog       2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -1,3 +1,97 @@
</span><ins>+2021-05-24  Sam Weinig  <weinig@apple.com>
+
+        Convert DestinationColorSpace from an enum to class wrapping a platform color space (CGColorSpaceRef for CG ports, etc.)
+        https://bugs.webkit.org/show_bug.cgi?id=226143
+
+        Reviewed by Darin Adler.
+
+        - Update ImageBuffer subclass signatures to use "const DestinationColorSpace&" to
+          conform to the base class.
+        - Replace ColorSpaceData with Optional<DestinationColorSpace>. No reason to have two
+          types that are the same.
+        - Give all ports a color space configuration for ShareableBitmap now that there is
+          a common class for representing color space.
+        - Update DisplayList decoding to account for BeginClipToDrawingCommands and GetPixelBuffer
+          no longer being inlineable due to now having non-trivial destructors due to 
+          DestinationColorSpace member.
+
+        * GPUProcess/graphics/RemoteImageBuffer.h:
+        (WebKit::RemoteImageBuffer::create):
+        * GPUProcess/graphics/RemoteRenderingBackend.cpp:
+        (WebKit::RemoteRenderingBackend::createImageBuffer):
+        * GPUProcess/graphics/RemoteRenderingBackend.h:
+        * GPUProcess/media/RemoteImageDecoderAVFProxy.cpp:
+        (WebKit::RemoteImageDecoderAVFProxy::createFrameImageAtIndex):
+        * GPUProcess/media/RemoteImageDecoderAVFProxy.h:
+        * GPUProcess/media/RemoteImageDecoderAVFProxy.messages.in:
+        * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
+        (WebKit::RemoteLayerBackingStore::swapToValidFrontBuffer):
+        (WebKit::RemoteLayerBackingStore::applyBackingStoreToLayer):
+        * Shared/ShareableBitmap.cpp:
+        (WebKit::ShareableBitmap::Configuration::encode const):
+        (WebKit::ShareableBitmap::Configuration::decode):
+        * Shared/ShareableBitmap.h:
+        * Shared/WebCoreArgumentCoders.h:
+        * Shared/WebPageCreationParameters.cpp:
+        (WebKit::WebPageCreationParameters::decode):
+        * Shared/WebPageCreationParameters.h:
+        * Shared/cg/ShareableBitmapCG.cpp:
+        (WebKit::colorSpace):
+        * Shared/mac/ColorSpaceData.h: Removed.
+        * Shared/mac/ColorSpaceData.mm: Removed.
+        * SourcesCocoa.txt:
+        * UIProcess/API/ios/WKWebViewIOS.mm:
+        (-[WKWebView _takeViewSnapshot]):
+        (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
+        * UIProcess/Cocoa/WebViewImpl.h:
+        * UIProcess/Cocoa/WebViewImpl.mm:
+        (WebKit::WebViewImpl::colorSpace):
+        * UIProcess/PageClient.h:
+        * UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
+        (WebKit::recursivelyMapIOSurfaceBackingStore):
+        * UIProcess/WebPageProxy.h:
+        * UIProcess/mac/PageClientImplMac.h:
+        * UIProcess/mac/PageClientImplMac.mm:
+        (WebKit::PageClientImpl::colorSpace):
+        * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
+        * UIProcess/mac/WebPageProxyMac.mm:
+        (WebKit::WebPageProxy::colorSpace):
+        * WebKit.xcodeproj/project.pbxproj:
+        * WebProcess/GPU/graphics/ImageBufferShareableBitmapBackend.cpp:
+        (WebKit::ImageBufferShareableBitmapBackend::configuration):
+        * WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.cpp:
+        (WebKit::RemoteGraphicsContextGLProxy::prepareForDisplay):
+        * WebProcess/GPU/graphics/RemoteImageBufferProxy.h:
+        (WebKit::RemoteImageBufferProxy::create):
+        * WebProcess/GPU/graphics/RemoteRenderingBackendProxy.cpp:
+        (WebKit::RemoteRenderingBackendProxy::createImageBuffer):
+        * WebProcess/GPU/graphics/RemoteRenderingBackendProxy.h:
+        * WebProcess/GPU/graphics/cocoa/ImageBufferShareableMappedIOSurfaceBackend.cpp:
+        (WebKit::ImageBufferShareableMappedIOSurfaceBackend::create):
+        * WebProcess/GPU/media/RemoteImageDecoderAVF.cpp:
+        (WebKit::RemoteImageDecoderAVF::createFrameImageAtIndex):
+        * WebProcess/GPU/media/cocoa/MediaPlayerPrivateRemoteCocoa.mm:
+        (WebKit::MediaPlayerPrivateRemote::nativeImageForCurrentTime):
+        (WebKit::MediaPlayerPrivateRemote::pixelBufferForCurrentTime):
+        * WebProcess/Plugins/PDF/PDFPlugin.mm:
+        (WebKit::PDFPlugin::PDFPlugin):
+        * WebProcess/WebCoreSupport/ShareableBitmapUtilities.cpp:
+        (WebKit::createShareableBitmap):
+        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+        (WebKit::WebChromeClient::createImageBuffer const):
+        * WebProcess/WebCoreSupport/WebChromeClient.h:
+        * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
+        (WebKit::convertDragImageToBitmap):
+        * WebProcess/WebPage/DrawingArea.h:
+        (WebKit::DrawingArea::setColorSpace):
+        * WebProcess/WebPage/DrawingArea.messages.in:
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::snapshotOptionsToBitmapConfiguration):
+        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
+        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
+        (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
+        (WebKit::TiledCoreAnimationDrawingArea::setColorSpace):
+
</ins><span class="cx"> 2021-05-24  Dana Estra  <destra@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Remove deprecated API usage in PageClientImplMac
</span></span></pre></div>
<a id="trunkSourceWebKitGPUProcessgraphicsRemoteImageBufferh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/GPUProcess/graphics/RemoteImageBuffer.h (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/GPUProcess/graphics/RemoteImageBuffer.h      2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebKit/GPUProcess/graphics/RemoteImageBuffer.h 2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -44,7 +44,7 @@
</span><span class="cx">     using BaseConcreteImageBuffer::putPixelBuffer;
</span><span class="cx"> 
</span><span class="cx"> public:
</span><del>-    static auto create(const WebCore::FloatSize& size, float resolutionScale, WebCore::DestinationColorSpace colorSpace, WebCore::PixelFormat pixelFormat, RemoteRenderingBackend& remoteRenderingBackend, WebCore::RenderingResourceIdentifier renderingResourceIdentifier)
</del><ins>+    static auto create(const WebCore::FloatSize& size, float resolutionScale, const WebCore::DestinationColorSpace& colorSpace, WebCore::PixelFormat pixelFormat, RemoteRenderingBackend& remoteRenderingBackend, WebCore::RenderingResourceIdentifier renderingResourceIdentifier)
</ins><span class="cx">     {
</span><span class="cx">         return BaseConcreteImageBuffer::template create<RemoteImageBuffer>(size, resolutionScale, colorSpace, pixelFormat, nullptr, remoteRenderingBackend, renderingResourceIdentifier);
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebKitGPUProcessgraphicsRemoteRenderingBackendcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.cpp       2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.cpp  2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -152,7 +152,7 @@
</span><span class="cx">     send(Messages::RemoteRenderingBackendProxy::DidFlush(flushIdentifier, renderingResourceIdentifier), m_renderingBackendIdentifier);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RemoteRenderingBackend::createImageBuffer(const FloatSize& logicalSize, RenderingMode renderingMode, float resolutionScale, DestinationColorSpace colorSpace, PixelFormat pixelFormat, RenderingResourceIdentifier renderingResourceIdentifier)
</del><ins>+void RemoteRenderingBackend::createImageBuffer(const FloatSize& logicalSize, RenderingMode renderingMode, float resolutionScale, const DestinationColorSpace& colorSpace, PixelFormat pixelFormat, RenderingResourceIdentifier renderingResourceIdentifier)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(!RunLoop::isMain());
</span><span class="cx">     ASSERT(renderingMode == RenderingMode::Accelerated || renderingMode == RenderingMode::Unaccelerated);
</span><span class="lines">@@ -495,6 +495,8 @@
</span><span class="cx">      * See the comment at the top of DisplayListItems.h for why. */
</span><span class="cx"> 
</span><span class="cx">     switch (type) {
</span><ins>+    case DisplayList::ItemType::BeginClipToDrawingCommands:
+        return decodeAndCreate<DisplayList::BeginClipToDrawingCommands>(data, length, handleLocation);
</ins><span class="cx">     case DisplayList::ItemType::ClipOutToPath:
</span><span class="cx">         return decodeAndCreate<DisplayList::ClipOutToPath>(data, length, handleLocation);
</span><span class="cx">     case DisplayList::ItemType::ClipPath:
</span><span class="lines">@@ -521,6 +523,8 @@
</span><span class="cx">         return decodeAndCreate<DisplayList::FillRectWithRoundedHole>(data, length, handleLocation);
</span><span class="cx">     case DisplayList::ItemType::FillRoundedRect:
</span><span class="cx">         return decodeAndCreate<DisplayList::FillRoundedRect>(data, length, handleLocation);
</span><ins>+    case DisplayList::ItemType::GetPixelBuffer:
+        return decodeAndCreate<DisplayList::GetPixelBuffer>(data, length, handleLocation);
</ins><span class="cx">     case DisplayList::ItemType::PutPixelBuffer:
</span><span class="cx">         return decodeAndCreate<DisplayList::PutPixelBuffer>(data, length, handleLocation);
</span><span class="cx">     case DisplayList::ItemType::SetLineDash:
</span><span class="lines">@@ -540,7 +544,6 @@
</span><span class="cx">     case DisplayList::ItemType::Clip:
</span><span class="cx">     case DisplayList::ItemType::ClipOut:
</span><span class="cx">     case DisplayList::ItemType::ClipToImageBuffer:
</span><del>-    case DisplayList::ItemType::BeginClipToDrawingCommands:
</del><span class="cx">     case DisplayList::ItemType::EndClipToDrawingCommands:
</span><span class="cx">     case DisplayList::ItemType::ConcatenateCTM:
</span><span class="cx">     case DisplayList::ItemType::DrawDotsForDocumentMarker:
</span><span class="lines">@@ -581,7 +584,6 @@
</span><span class="cx">     case DisplayList::ItemType::StrokeRect:
</span><span class="cx">     case DisplayList::ItemType::StrokeLine:
</span><span class="cx">     case DisplayList::ItemType::Translate:
</span><del>-    case DisplayList::ItemType::GetPixelBuffer:
</del><span class="cx">         ASSERT_NOT_REACHED();
</span><span class="cx">         return WTF::nullopt;
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebKitGPUProcessgraphicsRemoteRenderingBackendh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.h (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.h 2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.h    2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -44,14 +44,18 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><ins>+
</ins><span class="cx"> namespace DisplayList {
</span><span class="cx"> class DisplayList;
</span><span class="cx"> class Item;
</span><span class="cx"> }
</span><ins>+
+class DestinationColorSpace;
</ins><span class="cx"> class FloatSize;
</span><span class="cx"> class NativeImage;
</span><del>-enum class DestinationColorSpace : uint8_t;
</del><ins>+
</ins><span class="cx"> enum class RenderingMode : bool;
</span><ins>+
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="lines">@@ -121,7 +125,7 @@
</span><span class="cx">     bool didReceiveSyncMessage(IPC::Connection&, IPC::Decoder&, UniqueRef<IPC::Encoder>&) override;
</span><span class="cx"> 
</span><span class="cx">     // Messages to be received.
</span><del>-    void createImageBuffer(const WebCore::FloatSize& logicalSize, WebCore::RenderingMode, float resolutionScale, WebCore::DestinationColorSpace, WebCore::PixelFormat, WebCore::RenderingResourceIdentifier);
</del><ins>+    void createImageBuffer(const WebCore::FloatSize& logicalSize, WebCore::RenderingMode, float resolutionScale, const WebCore::DestinationColorSpace&, WebCore::PixelFormat, WebCore::RenderingResourceIdentifier);
</ins><span class="cx">     void wakeUpAndApplyDisplayList(const GPUProcessWakeupMessageArguments&);
</span><span class="cx">     void updateSharedMemoryForGetPixelBuffer(uint32_t byteCount, CompletionHandler<void(const SharedMemory::IPCHandle&)>&&);
</span><span class="cx">     void semaphoreForGetPixelBuffer(CompletionHandler<void(const IPC::Semaphore&)>&&);
</span></span></pre></div>
<a id="trunkSourceWebKitGPUProcessmediaRemoteImageDecoderAVFProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/GPUProcess/media/RemoteImageDecoderAVFProxy.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/GPUProcess/media/RemoteImageDecoderAVFProxy.cpp      2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebKit/GPUProcess/media/RemoteImageDecoderAVFProxy.cpp 2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -113,28 +113,28 @@
</span><span class="cx">     completionHandler(frameCount, imageDecoder->size(), imageDecoder->hasTrack(), WTFMove(frameInfos));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RemoteImageDecoderAVFProxy::createFrameImageAtIndex(ImageDecoderIdentifier identifier, size_t index, CompletionHandler<void(Optional<WTF::MachSendRight>&&, ColorSpaceData&&)>&& completionHandler)
</del><ins>+void RemoteImageDecoderAVFProxy::createFrameImageAtIndex(ImageDecoderIdentifier identifier, size_t index, CompletionHandler<void(Optional<WTF::MachSendRight>&&, Optional<WebCore::DestinationColorSpace>&&)>&& completionHandler)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(m_imageDecoders.contains(identifier));
</span><span class="cx">     Optional<WTF::MachSendRight> sendRight;
</span><del>-    ColorSpaceData colorSpaceData;
</del><ins>+    Optional<WebCore::DestinationColorSpace> colorSpace;
</ins><span class="cx">     if (!m_imageDecoders.contains(identifier)) {
</span><del>-        completionHandler(WTFMove(sendRight), WTFMove(colorSpaceData));
</del><ins>+        completionHandler(WTFMove(sendRight), WTFMove(colorSpace));
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     auto frameImage = m_imageDecoders.get(identifier)->createFrameImageAtIndex(index);
</span><span class="cx">     if (!frameImage) {
</span><del>-        completionHandler(WTFMove(sendRight), WTFMove(colorSpaceData));
</del><ins>+        completionHandler(WTFMove(sendRight), WTFMove(colorSpace));
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (auto surface = IOSurface::createFromImage(frameImage.get())) {
</span><span class="cx">         sendRight = surface->createSendRight();
</span><del>-        colorSpaceData.cgColorSpace = surface->colorSpace();
</del><ins>+        colorSpace = surface->colorSpace();
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    completionHandler(WTFMove(sendRight), WTFMove(colorSpaceData));
</del><ins>+    completionHandler(WTFMove(sendRight), WTFMove(colorSpace));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void RemoteImageDecoderAVFProxy::clearFrameBufferCache(ImageDecoderIdentifier identifier, size_t index)
</span></span></pre></div>
<a id="trunkSourceWebKitGPUProcessmediaRemoteImageDecoderAVFProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/GPUProcess/media/RemoteImageDecoderAVFProxy.h (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/GPUProcess/media/RemoteImageDecoderAVFProxy.h        2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebKit/GPUProcess/media/RemoteImageDecoderAVFProxy.h   2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -27,7 +27,6 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(GPU_PROCESS) && HAVE(AVASSETREADER)
</span><span class="cx"> 
</span><del>-#include "ColorSpaceData.h"
</del><span class="cx"> #include "DataReference.h"
</span><span class="cx"> #include "MessageReceiver.h"
</span><span class="cx"> #include <WebCore/ImageDecoderAVFObjC.h>
</span><span class="lines">@@ -57,7 +56,7 @@
</span><span class="cx">     void deleteDecoder(WebCore::ImageDecoderIdentifier);
</span><span class="cx">     void setExpectedContentSize(WebCore::ImageDecoderIdentifier, long long expectedContentSize);
</span><span class="cx">     void setData(WebCore::ImageDecoderIdentifier, const IPC::DataReference&, bool allDataReceived, CompletionHandler<void(size_t frameCount, const WebCore::IntSize& size, bool hasTrack, Optional<Vector<WebCore::ImageDecoder::FrameInfo>>&&)>&&);
</span><del>-    void createFrameImageAtIndex(WebCore::ImageDecoderIdentifier, size_t index, CompletionHandler<void(Optional<WTF::MachSendRight>&&, ColorSpaceData&&)>&&);
</del><ins>+    void createFrameImageAtIndex(WebCore::ImageDecoderIdentifier, size_t index, CompletionHandler<void(Optional<WTF::MachSendRight>&&, Optional<WebCore::DestinationColorSpace>&&)>&&);
</ins><span class="cx">     void clearFrameBufferCache(WebCore::ImageDecoderIdentifier, size_t index);
</span><span class="cx"> 
</span><span class="cx">     void encodedDataStatusChanged(WebCore::ImageDecoderIdentifier);
</span></span></pre></div>
<a id="trunkSourceWebKitGPUProcessmediaRemoteImageDecoderAVFProxymessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/GPUProcess/media/RemoteImageDecoderAVFProxy.messages.in (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/GPUProcess/media/RemoteImageDecoderAVFProxy.messages.in      2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebKit/GPUProcess/media/RemoteImageDecoderAVFProxy.messages.in 2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -32,7 +32,7 @@
</span><span class="cx">     DeleteDecoder(WebCore::ImageDecoderIdentifier identifier)
</span><span class="cx">     SetExpectedContentSize(WebCore::ImageDecoderIdentifier identifier, long long expectedContentSize)
</span><span class="cx">     SetData(WebCore::ImageDecoderIdentifier identifier, IPC::SharedBufferDataReference data, bool allDataReceived) -> (size_t frameCount, WebCore::IntSize size, bool hasTrack, Optional<Vector<WebCore::ImageDecoder::FrameInfo>> frameInfos) Synchronous
</span><del>-    CreateFrameImageAtIndex(WebCore::ImageDecoderIdentifier identifier, size_t index) -> (Optional<MachSendRight> sendRight, struct WebKit::ColorSpaceData colorSpace) Synchronous
</del><ins>+    CreateFrameImageAtIndex(WebCore::ImageDecoderIdentifier identifier, size_t index) -> (Optional<MachSendRight> sendRight, Optional<WebCore::DestinationColorSpace> colorSpace) Synchronous
</ins><span class="cx">     ClearFrameBufferCache(WebCore::ImageDecoderIdentifier identifier, size_t index)
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitSharedRemoteLayerTreeRemoteLayerBackingStoremm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.mm (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.mm    2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.mm       2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -212,19 +212,19 @@
</span><span class="cx">     switch (m_type) {
</span><span class="cx">     case Type::IOSurface:
</span><span class="cx">         if (shouldUseRemoteRendering)
</span><del>-            m_frontBuffer.imageBuffer = m_layer->context()->ensureRemoteRenderingBackendProxy().createImageBuffer(m_size, WebCore::RenderingMode::Accelerated, m_scale, WebCore::DestinationColorSpace::SRGB, pixelFormat());
</del><ins>+            m_frontBuffer.imageBuffer = m_layer->context()->ensureRemoteRenderingBackendProxy().createImageBuffer(m_size, WebCore::RenderingMode::Accelerated, m_scale, WebCore::DestinationColorSpace::SRGB(), pixelFormat());
</ins><span class="cx">         else
</span><del>-            m_frontBuffer.imageBuffer = WebCore::ConcreteImageBuffer<AcceleratedImageBufferShareableMappedBackend>::create(m_size, m_scale, WebCore::DestinationColorSpace::SRGB, pixelFormat(), nullptr);
</del><ins>+            m_frontBuffer.imageBuffer = WebCore::ConcreteImageBuffer<AcceleratedImageBufferShareableMappedBackend>::create(m_size, m_scale, WebCore::DestinationColorSpace::SRGB(), pixelFormat(), nullptr);
</ins><span class="cx">         break;
</span><span class="cx">     case Type::Bitmap:
</span><span class="cx">         if (shouldUseRemoteRendering)
</span><del>-            m_frontBuffer.imageBuffer = m_layer->context()->ensureRemoteRenderingBackendProxy().createImageBuffer(m_size, WebCore::RenderingMode::Unaccelerated, m_scale, WebCore::DestinationColorSpace::SRGB, pixelFormat());
</del><ins>+            m_frontBuffer.imageBuffer = m_layer->context()->ensureRemoteRenderingBackendProxy().createImageBuffer(m_size, WebCore::RenderingMode::Unaccelerated, m_scale, WebCore::DestinationColorSpace::SRGB(), pixelFormat());
</ins><span class="cx">         else
</span><del>-            m_frontBuffer.imageBuffer = WebCore::ConcreteImageBuffer<UnacceleratedImageBufferShareableBackend>::create(m_size, m_scale, WebCore::DestinationColorSpace::SRGB, pixelFormat(), nullptr);
</del><ins>+            m_frontBuffer.imageBuffer = WebCore::ConcreteImageBuffer<UnacceleratedImageBufferShareableBackend>::create(m_size, m_scale, WebCore::DestinationColorSpace::SRGB(), pixelFormat(), nullptr);
</ins><span class="cx">         break;
</span><span class="cx"> #if ENABLE(CG_DISPLAY_LIST_BACKED_IMAGE_BUFFER)
</span><span class="cx">     case Type::CGDisplayList:
</span><del>-        m_frontBuffer.imageBuffer = WebCore::ConcreteImageBuffer<CGDisplayListImageBufferBackend>::create(m_size, m_scale, WebCore::DestinationColorSpace::SRGB, pixelFormat(), nullptr);
</del><ins>+        m_frontBuffer.imageBuffer = WebCore::ConcreteImageBuffer<CGDisplayListImageBufferBackend>::create(m_size, m_scale, WebCore::DestinationColorSpace::SRGB(), pixelFormat(), nullptr);
</ins><span class="cx">         break;
</span><span class="cx"> #endif
</span><span class="cx">     }
</span><span class="lines">@@ -397,7 +397,7 @@
</span><span class="cx">             ASSERT(m_type == Type::IOSurface);
</span><span class="cx">             switch (contentsType) {
</span><span class="cx">             case LayerContentsType::IOSurface: {
</span><del>-                auto surface = WebCore::IOSurface::createFromSendRight(WTFMove(machSendRight), WebCore::sRGBColorSpaceRef());
</del><ins>+                auto surface = WebCore::IOSurface::createFromSendRight(WTFMove(machSendRight), WebCore::DestinationColorSpace::SRGB());
</ins><span class="cx">                 layer.contents = surface ? surface->asLayerContents() : nil;
</span><span class="cx">                 break;
</span><span class="cx">             }
</span></span></pre></div>
<a id="trunkSourceWebKitSharedShareableBitmapcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Shared/ShareableBitmap.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Shared/ShareableBitmap.cpp   2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebKit/Shared/ShareableBitmap.cpp      2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -74,10 +74,7 @@
</span><span class="cx"> 
</span><span class="cx"> void ShareableBitmap::Configuration::encode(IPC::Encoder& encoder) const
</span><span class="cx"> {
</span><del>-    encoder << isOpaque;
-#if PLATFORM(COCOA)
-    encoder << colorSpace;
-#endif
</del><ins>+    encoder << colorSpace << isOpaque;
</ins><span class="cx"> #if USE(DIRECT2D)
</span><span class="cx">     SharedMemory::Handle::encodeHandle(encoder, sharedResourceHandle);
</span><span class="cx"> 
</span><span class="lines">@@ -88,21 +85,28 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool ShareableBitmap::Configuration::decode(IPC::Decoder& decoder, Configuration& configuration)
</del><ins>+bool ShareableBitmap::Configuration::decode(IPC::Decoder& decoder, Configuration& result)
</ins><span class="cx"> {
</span><del>-    if (!decoder.decode(configuration.isOpaque))
</del><ins>+    Optional<Optional<WebCore::DestinationColorSpace>> colorSpace;
+    decoder >> colorSpace;
+    if (!colorSpace)
</ins><span class="cx">         return false;
</span><del>-#if PLATFORM(COCOA)
-    if (!decoder.decode(configuration.colorSpace))
</del><ins>+
+    Optional<bool> isOpaque;
+    decoder >> isOpaque;
+    if (!isOpaque)
</ins><span class="cx">         return false;
</span><del>-#endif
</del><ins>+
+    result = Configuration { WTFMove(*colorSpace), *isOpaque };
+
</ins><span class="cx"> #if USE(DIRECT2D)
</span><span class="cx">     auto processSpecificHandle = SharedMemory::Handle::decodeHandle(decoder);
</span><span class="cx">     if (!processSpecificHandle)
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    configuration.sharedResourceHandle = processSpecificHandle.value();
</del><ins>+    result.sharedResourceHandle = processSpecificHandle.value();
</ins><span class="cx"> #endif
</span><ins>+
</ins><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitSharedShareableBitmaph"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Shared/ShareableBitmap.h (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Shared/ShareableBitmap.h     2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebKit/Shared/ShareableBitmap.h        2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -26,15 +26,12 @@
</span><span class="cx"> #pragma once
</span><span class="cx"> 
</span><span class="cx"> #include "SharedMemory.h"
</span><ins>+#include <WebCore/DestinationColorSpace.h>
</ins><span class="cx"> #include <WebCore/IntRect.h>
</span><span class="cx"> #include <WebCore/PlatformImage.h>
</span><span class="cx"> #include <wtf/RefPtr.h>
</span><span class="cx"> #include <wtf/ThreadSafeRefCounted.h>
</span><span class="cx"> 
</span><del>-#if USE(CG)
-#include "ColorSpaceData.h"
-#endif
-
</del><span class="cx"> #if USE(DIRECT2D)
</span><span class="cx"> interface ID2D1Bitmap;
</span><span class="cx"> interface ID2D1RenderTarget;
</span><span class="lines">@@ -55,10 +52,8 @@
</span><span class="cx"> class ShareableBitmap : public ThreadSafeRefCounted<ShareableBitmap> {
</span><span class="cx"> public:
</span><span class="cx">     struct Configuration {
</span><ins>+        Optional<WebCore::DestinationColorSpace> colorSpace;
</ins><span class="cx">         bool isOpaque { false };
</span><del>-#if PLATFORM(COCOA)
-        ColorSpaceData colorSpace;
-#endif
</del><span class="cx"> #if USE(DIRECT2D)
</span><span class="cx">         mutable HANDLE sharedResourceHandle { nullptr };
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKitSharedWebCoreArgumentCodersh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Shared/WebCoreArgumentCoders.h (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Shared/WebCoreArgumentCoders.h       2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebKit/Shared/WebCoreArgumentCoders.h  2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -82,6 +82,8 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(COCOA)
</span><ins>+#include "ArgumentCodersCF.h"
+
</ins><span class="cx"> namespace WTF {
</span><span class="cx"> class MachSendRight;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKitSharedWebPageCreationParameterscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Shared/WebPageCreationParameters.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Shared/WebPageCreationParameters.cpp 2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebKit/Shared/WebPageCreationParameters.cpp    2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -325,8 +325,11 @@
</span><span class="cx">     parameters.hasResourceLoadClient = WTFMove(*hasResourceLoadClient);
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(MAC)
</span><del>-    if (!decoder.decode(parameters.colorSpace))
</del><ins>+    Optional<Optional<DestinationColorSpace>> colorSpace;
+    decoder >> colorSpace;
+    if (!colorSpace)
</ins><span class="cx">         return WTF::nullopt;
</span><ins>+    parameters.colorSpace = WTFMove(*colorSpace);
</ins><span class="cx">     if (!decoder.decode(parameters.useSystemAppearance))
</span><span class="cx">         return WTF::nullopt;
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKitSharedWebPageCreationParametersh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Shared/WebPageCreationParameters.h (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Shared/WebPageCreationParameters.h   2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebKit/Shared/WebPageCreationParameters.h      2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -36,6 +36,7 @@
</span><span class="cx"> #include "WebPreferencesStore.h"
</span><span class="cx"> #include <WebCore/ActivityState.h>
</span><span class="cx"> #include <WebCore/Color.h>
</span><ins>+#include <WebCore/DestinationColorSpace.h>
</ins><span class="cx"> #include <WebCore/FloatSize.h>
</span><span class="cx"> #include <WebCore/IntSize.h>
</span><span class="cx"> #include <WebCore/LayoutMilestone.h>
</span><span class="lines">@@ -49,10 +50,6 @@
</span><span class="cx"> #include <wtf/HashMap.h>
</span><span class="cx"> #include <wtf/text/WTFString.h>
</span><span class="cx"> 
</span><del>-#if PLATFORM(MAC)
-#include "ColorSpaceData.h"
-#endif
-
</del><span class="cx"> #if ENABLE(APPLICATION_MANIFEST)
</span><span class="cx"> #include <WebCore/ApplicationManifest.h>
</span><span class="cx"> #endif
</span><span class="lines">@@ -146,7 +143,7 @@
</span><span class="cx">     bool useElevatedUserInterfaceLevel { false };
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(MAC)
</span><del>-    ColorSpaceData colorSpace;
</del><ins>+    Optional<WebCore::DestinationColorSpace> colorSpace;
</ins><span class="cx">     bool useSystemAppearance;
</span><span class="cx"> #endif
</span><span class="cx"> #if ENABLE(META_VIEWPORT)
</span></span></pre></div>
<a id="trunkSourceWebKitSharedcgShareableBitmapCGcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Shared/cg/ShareableBitmapCG.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Shared/cg/ShareableBitmapCG.cpp      2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebKit/Shared/cg/ShareableBitmapCG.cpp 2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -40,7 +40,7 @@
</span><span class="cx">     
</span><span class="cx"> static CGColorSpaceRef colorSpace(const ShareableBitmap::Configuration& configuration)
</span><span class="cx"> {
</span><del>-    return configuration.colorSpace.cgColorSpace.get() ?: sRGBColorSpaceRef();
</del><ins>+    return configuration.colorSpace ? configuration.colorSpace->platformColorSpace() : WebCore::sRGBColorSpaceRef();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static bool wantsExtendedRange(const ShareableBitmap::Configuration& configuration)
</span></span></pre></div>
<a id="trunkSourceWebKitSharedmacColorSpaceDatah"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebKit/Shared/mac/ColorSpaceData.h (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Shared/mac/ColorSpaceData.h  2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebKit/Shared/mac/ColorSpaceData.h     2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -1,47 +0,0 @@
</span><del>-/*
- * Copyright (C) 2012 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef ColorSpaceData_h
-#define ColorSpaceData_h
-
-#include <wtf/RetainPtr.h>
-
-namespace IPC {
-class Decoder;
-class Encoder;
-}
-
-namespace WebKit {
-
-struct ColorSpaceData {
-    void encode(IPC::Encoder&) const;
-    static WARN_UNUSED_RETURN bool decode(IPC::Decoder&, ColorSpaceData&);
-
-    RetainPtr<CGColorSpaceRef> cgColorSpace;
-};
-
-} // namespace WebKit
-
-#endif // ColorSpaceData_h
</del></span></pre></div>
<a id="trunkSourceWebKitSharedmacColorSpaceDatamm"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebKit/Shared/mac/ColorSpaceData.mm (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Shared/mac/ColorSpaceData.mm 2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebKit/Shared/mac/ColorSpaceData.mm    2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -1,60 +0,0 @@
</span><del>-/*
- * Copyright (C) 2012 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#import "config.h"
-#import "ColorSpaceData.h"
-
-#import "ArgumentCodersCF.h"
-#import "Decoder.h"
-#import "Encoder.h"
-#import <wtf/EnumTraits.h>
-
-namespace WebKit {
-
-void ColorSpaceData::encode(IPC::Encoder& encoder) const
-{
-    encoder << static_cast<bool>(cgColorSpace);
-    if (cgColorSpace)
-        encoder << cgColorSpace;
-}
-
-bool ColorSpaceData::decode(IPC::Decoder& decoder, ColorSpaceData& colorSpaceData)
-{
-    bool hasCGColorSpace;
-    if (!decoder.decode(hasCGColorSpace))
-        return false;
-
-    if (!hasCGColorSpace)
-        return true;
-
-    RetainPtr<CGColorSpaceRef> colorSpace;
-    if (!decoder.decode(colorSpace))
-        return false;
-    
-    colorSpaceData.cgColorSpace = WTFMove(colorSpace);
-    return true;
-}
-
-} // namespace WebKit
</del></span></pre></div>
<a id="trunkSourceWebKitSourcesCocoatxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/SourcesCocoa.txt (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/SourcesCocoa.txt     2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebKit/SourcesCocoa.txt        2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -203,7 +203,6 @@
</span><span class="cx"> 
</span><span class="cx"> Shared/mac/AuxiliaryProcessMac.mm
</span><span class="cx"> Shared/mac/CodeSigning.mm
</span><del>-Shared/mac/ColorSpaceData.mm
</del><span class="cx"> Shared/mac/HangDetectionDisablerMac.mm
</span><span class="cx"> Shared/mac/NativeWebGestureEventMac.mm
</span><span class="cx"> Shared/mac/NativeWebKeyboardEventMac.mm
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessAPIiosWKWebViewIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/API/ios/WKWebViewIOS.mm (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/API/ios/WKWebViewIOS.mm    2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebKit/UIProcess/API/ios/WKWebViewIOS.mm       2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -1014,7 +1014,7 @@
</span><span class="cx"> #else
</span><span class="cx">     WebCore::IOSurface::Format snapshotFormat = WebCore::IOSurface::Format::BGRA;
</span><span class="cx"> #endif
</span><del>-    auto surface = WebCore::IOSurface::create(WebCore::expandedIntSize(snapshotSize), WebCore::sRGBColorSpaceRef(), snapshotFormat);
</del><ins>+    auto surface = WebCore::IOSurface::create(WebCore::expandedIntSize(snapshotSize), WebCore::DestinationColorSpace::SRGB(), snapshotFormat);
</ins><span class="cx">     if (!surface)
</span><span class="cx">         return nullptr;
</span><span class="cx">     CARenderServerRenderLayerWithTransform(MACH_PORT_NULL, self.layer.context.contextId, reinterpret_cast<uint64_t>(self.layer), surface->surface(), 0, 0, &transform);
</span><span class="lines">@@ -3079,7 +3079,7 @@
</span><span class="cx">     NSString *displayName = self.window.screen.displayConfiguration.name;
</span><span class="cx">     if (displayName && !self.window.hidden) {
</span><span class="cx">         TraceScope snapshotScope(RenderServerSnapshotStart, RenderServerSnapshotEnd);
</span><del>-        auto surface = WebCore::IOSurface::create(WebCore::expandedIntSize(WebCore::FloatSize(imageSize)), WebCore::sRGBColorSpaceRef());
</del><ins>+        auto surface = WebCore::IOSurface::create(WebCore::expandedIntSize(WebCore::FloatSize(imageSize)), WebCore::DestinationColorSpace::SRGB());
</ins><span class="cx">         if (!surface) {
</span><span class="cx">             completionHandler(nullptr);
</span><span class="cx">             return;
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessCocoaWebViewImplh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.h (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.h        2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.h   2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -94,6 +94,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><ins>+class DestinationColorSpace;
</ins><span class="cx"> class IntPoint;
</span><span class="cx"> struct ShareDataWithParsedURL;
</span><span class="cx"> 
</span><span class="lines">@@ -168,7 +169,6 @@
</span><span class="cx"> class WebPageProxy;
</span><span class="cx"> class WebProcessPool;
</span><span class="cx"> class WebProcessProxy;
</span><del>-struct ColorSpaceData;
</del><span class="cx"> struct WebHitTestResultData;
</span><span class="cx"> 
</span><span class="cx"> enum class ContinueUnsafeLoad : bool;
</span><span class="lines">@@ -313,7 +313,7 @@
</span><span class="cx"> 
</span><span class="cx">     NSView *hitTest(CGPoint);
</span><span class="cx"> 
</span><del>-    ColorSpaceData colorSpace();
</del><ins>+    WebCore::DestinationColorSpace colorSpace();
</ins><span class="cx"> 
</span><span class="cx">     void setUnderlayColor(NSColor *);
</span><span class="cx">     NSColor *underlayColor() const;
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessCocoaWebViewImplmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm       2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm  2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -32,7 +32,6 @@
</span><span class="cx"> #import "APILegacyContextHistoryClient.h"
</span><span class="cx"> #import "APINavigation.h"
</span><span class="cx"> #import "AppKitSPI.h"
</span><del>-#import "ColorSpaceData.h"
</del><span class="cx"> #import "CoreTextHelpers.h"
</span><span class="cx"> #import "FontInfo.h"
</span><span class="cx"> #import "FullscreenClient.h"
</span><span class="lines">@@ -90,6 +89,7 @@
</span><span class="cx"> #import <WebCore/ColorMac.h>
</span><span class="cx"> #import <WebCore/ColorSerialization.h>
</span><span class="cx"> #import <WebCore/CompositionHighlight.h>
</span><ins>+#import <WebCore/DestinationColorSpace.h>
</ins><span class="cx"> #import <WebCore/DictionaryLookup.h>
</span><span class="cx"> #import <WebCore/DragData.h>
</span><span class="cx"> #import <WebCore/DragItem.h>
</span><span class="lines">@@ -2500,21 +2500,28 @@
</span><span class="cx">     m_page->handleMouseEvent(webEvent);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-ColorSpaceData WebViewImpl::colorSpace()
</del><ins>+WebCore::DestinationColorSpace WebViewImpl::colorSpace()
</ins><span class="cx"> {
</span><span class="cx">     if (!m_colorSpace) {
</span><del>-        if (m_targetWindowForMovePreparation)
-            m_colorSpace = [m_targetWindowForMovePreparation colorSpace];
-        else if (NSWindow *window = [m_view window])
-            m_colorSpace = window.colorSpace;
-        else
</del><ins>+        m_colorSpace = [&] () -> NSColorSpace * {
+            if (m_targetWindowForMovePreparation)
+                return [m_targetWindowForMovePreparation colorSpace];
+            
+            if (NSWindow *window = [m_view window])
+                return [window colorSpace];
+
+            return nil;
+        }();
+
+        if (!m_colorSpace)
</ins><span class="cx">             m_colorSpace = [NSScreen mainScreen].colorSpace;
</span><ins>+    
+        if (!m_colorSpace)
+            m_colorSpace = [NSColorSpace sRGBColorSpace];
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    ColorSpaceData colorSpaceData;
-    colorSpaceData.cgColorSpace = [m_colorSpace CGColorSpace];
-
-    return colorSpaceData;
</del><ins>+    ASSERT(m_colorSpace);
+    return WebCore::DestinationColorSpace { [m_colorSpace CGColorSpace] };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebViewImpl::setUnderlayColor(NSColor *underlayColor)
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessPageClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/PageClient.h (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/PageClient.h       2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebKit/UIProcess/PageClient.h  2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -93,6 +93,7 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> class Color;
</span><span class="cx"> class Cursor;
</span><ins>+class DestinationColorSpace;
</ins><span class="cx"> class FloatQuad;
</span><span class="cx"> class FloatRect;
</span><span class="cx"> class Region;
</span><span class="lines">@@ -188,10 +189,6 @@
</span><span class="cx"> class InstallMissingMediaPluginsPermissionRequest;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if PLATFORM(COCOA)
-struct ColorSpaceData;
-#endif
-
</del><span class="cx"> #if HAVE(VISIBILITY_PROPAGATION_VIEW)
</span><span class="cx"> using LayerHostingContextID = uint32_t;
</span><span class="cx"> #endif
</span><span class="lines">@@ -426,7 +423,7 @@
</span><span class="cx"> 
</span><span class="cx">     virtual CGRect boundsOfLayerInLayerBackedWindowCoordinates(CALayer *) const = 0;
</span><span class="cx"> 
</span><del>-    virtual ColorSpaceData colorSpace() = 0;
</del><ins>+    virtual WebCore::DestinationColorSpace colorSpace() = 0;
</ins><span class="cx"> 
</span><span class="cx">     virtual void showPlatformContextMenu(NSMenu *, WebCore::IntPoint) = 0;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessRemoteLayerTreeRemoteLayerTreeHostmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm     2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm        2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -35,6 +35,7 @@
</span><span class="cx"> #import "WebPageProxy.h"
</span><span class="cx"> #import "WebProcessProxy.h"
</span><span class="cx"> #import <QuartzCore/QuartzCore.h>
</span><ins>+#import <WebCore/DestinationColorSpace.h>
</ins><span class="cx"> #import <WebCore/GraphicsContextCG.h>
</span><span class="cx"> #import <WebCore/IOSurface.h>
</span><span class="cx"> #import <WebCore/PlatformLayer.h>
</span><span class="lines">@@ -317,7 +318,7 @@
</span><span class="cx"> {
</span><span class="cx">     if (layer.contents && CFGetTypeID((__bridge CFTypeRef)layer.contents) == CAMachPortGetTypeID()) {
</span><span class="cx">         MachSendRight port = MachSendRight::create(CAMachPortGetPort((__bridge CAMachPortRef)layer.contents));
</span><del>-        auto surface = WebCore::IOSurface::createFromSendRight(WTFMove(port), sRGBColorSpaceRef());
</del><ins>+        auto surface = WebCore::IOSurface::createFromSendRight(WTFMove(port), WebCore::DestinationColorSpace::SRGB());
</ins><span class="cx">         layer.contents = surface ? surface->asLayerContents() : nil;
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessWebPageProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.h (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/WebPageProxy.h     2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.h        2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -198,6 +198,7 @@
</span><span class="cx"> class Attachment;
</span><span class="cx"> class ContentWorld;
</span><span class="cx"> class ContextMenuClient;
</span><ins>+class DestinationColorSpace;
</ins><span class="cx"> class Error;
</span><span class="cx"> class FindClient;
</span><span class="cx"> class FindMatchesClient;
</span><span class="lines">@@ -377,7 +378,6 @@
</span><span class="cx"> class WebsiteDataStore;
</span><span class="cx"> 
</span><span class="cx"> struct AppBoundNavigationTestingData;
</span><del>-struct ColorSpaceData;
</del><span class="cx"> struct DataDetectionResult;
</span><span class="cx"> struct DocumentEditingContext;
</span><span class="cx"> struct DocumentEditingContextRequest;
</span><span class="lines">@@ -1132,7 +1132,7 @@
</span><span class="cx">     void makeFirstResponder();
</span><span class="cx">     void assistiveTechnologyMakeFirstResponder();
</span><span class="cx"> 
</span><del>-    ColorSpaceData colorSpace();
</del><ins>+    WebCore::DestinationColorSpace colorSpace();
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(SERVICE_CONTROLS)
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessmacPageClientImplMach"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/mac/PageClientImplMac.h (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/mac/PageClientImplMac.h    2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebKit/UIProcess/mac/PageClientImplMac.h       2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -76,7 +76,7 @@
</span><span class="cx">     bool isViewInWindow() override;
</span><span class="cx">     bool isVisuallyIdle() override;
</span><span class="cx">     LayerHostingMode viewLayerHostingMode() override;
</span><del>-    ColorSpaceData colorSpace() override;
</del><ins>+    WebCore::DestinationColorSpace colorSpace() override;
</ins><span class="cx">     void setRemoteLayerTreeRootNode(RemoteLayerTreeNode*) override;
</span><span class="cx">     CALayer *acceleratedCompositingRootLayer() const override;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessmacPageClientImplMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/mac/PageClientImplMac.mm (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/mac/PageClientImplMac.mm   2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebKit/UIProcess/mac/PageClientImplMac.mm      2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -30,7 +30,6 @@
</span><span class="cx"> 
</span><span class="cx"> #import "APIHitTestResult.h"
</span><span class="cx"> #import "AppKitSPI.h"
</span><del>-#import "ColorSpaceData.h"
</del><span class="cx"> #import "DataReference.h"
</span><span class="cx"> #import "DownloadProxy.h"
</span><span class="cx"> #import "DrawingAreaProxy.h"
</span><span class="lines">@@ -66,6 +65,7 @@
</span><span class="cx"> #import <WebCore/BitmapImage.h>
</span><span class="cx"> #import <WebCore/ColorMac.h>
</span><span class="cx"> #import <WebCore/Cursor.h>
</span><ins>+#import <WebCore/DestinationColorSpace.h>
</ins><span class="cx"> #import <WebCore/DictionaryLookup.h>
</span><span class="cx"> #import <WebCore/DragItem.h>
</span><span class="cx"> #import <WebCore/FloatRect.h>
</span><span class="lines">@@ -244,7 +244,7 @@
</span><span class="cx">     clearAllEditCommands();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-ColorSpaceData PageClientImpl::colorSpace()
</del><ins>+WebCore::DestinationColorSpace PageClientImpl::colorSpace()
</ins><span class="cx"> {
</span><span class="cx">     return m_impl->colorSpace();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessmacTiledCoreAnimationDrawingAreaProxymm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm  2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebKit/UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm     2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -28,7 +28,6 @@
</span><span class="cx"> 
</span><span class="cx"> #if !PLATFORM(IOS_FAMILY)
</span><span class="cx"> 
</span><del>-#import "ColorSpaceData.h"
</del><span class="cx"> #import "DrawingAreaMessages.h"
</span><span class="cx"> #import "DrawingAreaProxyMessages.h"
</span><span class="cx"> #import "LayerTreeContext.h"
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessmacWebPageProxyMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/mac/WebPageProxyMac.mm (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/mac/WebPageProxyMac.mm     2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebKit/UIProcess/mac/WebPageProxyMac.mm        2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -29,7 +29,6 @@
</span><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx"> 
</span><span class="cx"> #import "APIUIClient.h"
</span><del>-#import "ColorSpaceData.h"
</del><span class="cx"> #import "Connection.h"
</span><span class="cx"> #import "DataReference.h"
</span><span class="cx"> #import "EditorState.h"
</span><span class="lines">@@ -52,6 +51,7 @@
</span><span class="cx"> #import "WebPreferencesKeys.h"
</span><span class="cx"> #import "WebProcessProxy.h"
</span><span class="cx"> #import <WebCore/AttributedString.h>
</span><ins>+#import <WebCore/DestinationColorSpace.h>
</ins><span class="cx"> #import <WebCore/DictionaryLookup.h>
</span><span class="cx"> #import <WebCore/DragItem.h>
</span><span class="cx"> #import <WebCore/GraphicsLayer.h>
</span><span class="lines">@@ -344,7 +344,7 @@
</span><span class="cx">     pageClient().assistiveTechnologyMakeFirstResponder();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-ColorSpaceData WebPageProxy::colorSpace()
</del><ins>+WebCore::DestinationColorSpace WebPageProxy::colorSpace()
</ins><span class="cx"> {
</span><span class="cx">     return pageClient().colorSpace();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKitWebKitxcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj     2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj        2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -2634,8 +2634,6 @@
</span><span class="cx">          1A256E3618A1A788006FB922 /* WKNavigationAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKNavigationAction.h; sourceTree = "<group>"; };
</span><span class="cx">          1A256E3918A1A7DF006FB922 /* WKNavigationActionInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKNavigationActionInternal.h; sourceTree = "<group>"; };
</span><span class="cx">          1A28B8CB1C80ED59006FD743 /* WebsiteDataFetchOption.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebsiteDataFetchOption.h; sourceTree = "<group>"; };
</span><del>-               1A2A4AFD158693920090C9E9 /* ColorSpaceData.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ColorSpaceData.mm; sourceTree = "<group>"; };
-               1A2A4AFE158693920090C9E9 /* ColorSpaceData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ColorSpaceData.h; sourceTree = "<group>"; };
</del><span class="cx">           1A2BB6CC14117A5F000F35D4 /* PluginProcessConnection.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = PluginProcessConnection.messages.in; sourceTree = "<group>"; };
</span><span class="cx">          1A2BB6CE14117B4D000F35D4 /* PluginProcessConnectionMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PluginProcessConnectionMessageReceiver.cpp; path = DerivedSources/WebKit2/PluginProcessConnectionMessageReceiver.cpp; sourceTree = BUILT_PRODUCTS_DIR; };
</span><span class="cx">          1A2BB6CF14117B4D000F35D4 /* PluginProcessConnectionMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PluginProcessConnectionMessages.h; path = DerivedSources/WebKit2/PluginProcessConnectionMessages.h; sourceTree = BUILT_PRODUCTS_DIR; };
</span><span class="lines">@@ -10430,8 +10428,6 @@
</span><span class="cx">                          9F54F88E16488E87007DF81A /* AuxiliaryProcessMac.mm */,
</span><span class="cx">                          CE11AD511CBC482F00681EE5 /* CodeSigning.h */,
</span><span class="cx">                          CE11AD4F1CBC47F800681EE5 /* CodeSigning.mm */,
</span><del>-                               1A2A4AFE158693920090C9E9 /* ColorSpaceData.h */,
-                               1A2A4AFD158693920090C9E9 /* ColorSpaceData.mm */,
</del><span class="cx">                           1AC75A1C1B33695E0056745B /* HangDetectionDisablerMac.mm */,
</span><span class="cx">                          2D50365D1BCC793F00E20BB3 /* NativeWebGestureEventMac.mm */,
</span><span class="cx">                          C02BFF1D1251502E009CCBEA /* NativeWebKeyboardEventMac.mm */,
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessGPUgraphicsImageBufferShareableBitmapBackendcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/GPU/graphics/ImageBufferShareableBitmapBackend.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/GPU/graphics/ImageBufferShareableBitmapBackend.cpp        2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebKit/WebProcess/GPU/graphics/ImageBufferShareableBitmapBackend.cpp   2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -45,11 +45,7 @@
</span><span class="cx"> 
</span><span class="cx"> ShareableBitmap::Configuration ImageBufferShareableBitmapBackend::configuration(const Parameters& parameters)
</span><span class="cx"> {
</span><del>-    ShareableBitmap::Configuration configuration;
-#if PLATFORM(COCOA)
-    configuration.colorSpace = { cachedCGColorSpace(parameters.colorSpace) };
-#endif
-    return configuration;
</del><ins>+    return { parameters.colorSpace };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> IntSize ImageBufferShareableBitmapBackend::calculateSafeBackendSize(const Parameters& parameters)
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessGPUgraphicsRemoteGraphicsContextGLProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.cpp     2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.cpp        2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -94,7 +94,7 @@
</span><span class="cx">         markContextLost();
</span><span class="cx">         return;
</span><span class="cx">     }
</span><del>-    auto displayBuffer = IOSurface::createFromSendRight(WTFMove(displayBufferSendRight), sRGBColorSpaceRef());
</del><ins>+    auto displayBuffer = IOSurface::createFromSendRight(WTFMove(displayBufferSendRight), WebCore::DestinationColorSpace::SRGB());
</ins><span class="cx">     if (displayBuffer) {
</span><span class="cx">         auto& sc = platformSwapChain();
</span><span class="cx">         sc.recycleBuffer();
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessGPUgraphicsRemoteImageBufferProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteImageBufferProxy.h (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteImageBufferProxy.h     2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteImageBufferProxy.h        2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -54,7 +54,7 @@
</span><span class="cx">     using BaseDisplayListImageBuffer::resolutionScale;
</span><span class="cx"> 
</span><span class="cx"> public:
</span><del>-    static RefPtr<RemoteImageBufferProxy> create(const WebCore::FloatSize& size, float resolutionScale, WebCore::DestinationColorSpace colorSpace, WebCore::PixelFormat pixelFormat, RemoteRenderingBackendProxy& remoteRenderingBackendProxy)
</del><ins>+    static RefPtr<RemoteImageBufferProxy> create(const WebCore::FloatSize& size, float resolutionScale, const WebCore::DestinationColorSpace& colorSpace, WebCore::PixelFormat pixelFormat, RemoteRenderingBackendProxy& remoteRenderingBackendProxy)
</ins><span class="cx">     {
</span><span class="cx">         auto parameters = WebCore::ImageBufferBackend::Parameters { size, resolutionScale, colorSpace, pixelFormat };
</span><span class="cx">         if (BackendType::calculateSafeBackendSize(parameters).isEmpty())
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessGPUgraphicsRemoteRenderingBackendProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteRenderingBackendProxy.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteRenderingBackendProxy.cpp      2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteRenderingBackendProxy.cpp 2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -130,7 +130,7 @@
</span><span class="cx">     send(Messages::RemoteRenderingBackend::CreateImageBuffer(imageBuffer.logicalSize(), imageBuffer.renderingMode(), imageBuffer.resolutionScale(), imageBuffer.colorSpace(), imageBuffer.pixelFormat(), imageBuffer.renderingResourceIdentifier()), renderingBackendIdentifier(), IPC::SendOption::DispatchMessageEvenWhenWaitingForSyncReply);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr<ImageBuffer> RemoteRenderingBackendProxy::createImageBuffer(const FloatSize& size, RenderingMode renderingMode, float resolutionScale, DestinationColorSpace colorSpace, PixelFormat pixelFormat)
</del><ins>+RefPtr<ImageBuffer> RemoteRenderingBackendProxy::createImageBuffer(const FloatSize& size, RenderingMode renderingMode, float resolutionScale, const DestinationColorSpace& colorSpace, PixelFormat pixelFormat)
</ins><span class="cx"> {
</span><span class="cx">     RefPtr<ImageBuffer> imageBuffer;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessGPUgraphicsRemoteRenderingBackendProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteRenderingBackendProxy.h (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteRenderingBackendProxy.h        2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteRenderingBackendProxy.h   2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -43,15 +43,19 @@
</span><span class="cx"> #include <wtf/WeakPtr.h>
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><ins>+
</ins><span class="cx"> namespace DisplayList {
</span><span class="cx"> class DisplayList;
</span><span class="cx"> class Item;
</span><span class="cx"> }
</span><ins>+
+class DestinationColorSpace;
</ins><span class="cx"> class FloatSize;
</span><span class="cx"> class PixelBuffer;
</span><ins>+
</ins><span class="cx"> enum class AlphaPremultiplication : uint8_t;
</span><del>-enum class DestinationColorSpace : uint8_t;
</del><span class="cx"> enum class RenderingMode : bool;
</span><ins>+
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="lines">@@ -92,7 +96,7 @@
</span><span class="cx">     void didReceiveMessage(IPC::Connection&, IPC::Decoder&) override;
</span><span class="cx"> 
</span><span class="cx">     // Messages to be sent.
</span><del>-    RefPtr<WebCore::ImageBuffer> createImageBuffer(const WebCore::FloatSize&, WebCore::RenderingMode, float resolutionScale, WebCore::DestinationColorSpace, WebCore::PixelFormat);
</del><ins>+    RefPtr<WebCore::ImageBuffer> createImageBuffer(const WebCore::FloatSize&, WebCore::RenderingMode, float resolutionScale, const WebCore::DestinationColorSpace&, WebCore::PixelFormat);
</ins><span class="cx">     String getDataURLForImageBuffer(const String& mimeType, Optional<double> quality, WebCore::PreserveResolution, WebCore::RenderingResourceIdentifier);
</span><span class="cx">     Vector<uint8_t> getDataForImageBuffer(const String& mimeType, Optional<double> quality, WebCore::RenderingResourceIdentifier);
</span><span class="cx">     WebCore::DisplayList::FlushIdentifier flushDisplayListAndCommit(const WebCore::DisplayList::DisplayList&, WebCore::RenderingResourceIdentifier);
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessGPUgraphicscocoaImageBufferShareableMappedIOSurfaceBackendcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/GPU/graphics/cocoa/ImageBufferShareableMappedIOSurfaceBackend.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/GPU/graphics/cocoa/ImageBufferShareableMappedIOSurfaceBackend.cpp 2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebKit/WebProcess/GPU/graphics/cocoa/ImageBufferShareableMappedIOSurfaceBackend.cpp    2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -45,7 +45,7 @@
</span><span class="cx">     if (backendSize.isEmpty())
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><del>-    auto surface = IOSurface::create(backendSize, backendSize, cachedCGColorSpace(parameters.colorSpace), IOSurface::formatForPixelFormat(parameters.pixelFormat));
</del><ins>+    auto surface = IOSurface::create(backendSize, backendSize, parameters.colorSpace, IOSurface::formatForPixelFormat(parameters.pixelFormat));
</ins><span class="cx">     if (!surface)
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="lines">@@ -65,7 +65,7 @@
</span><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    auto surface = IOSurface::createFromSendRight(WTFMove(WTF::get<MachSendRight>(handle)), cachedCGColorSpace(parameters.colorSpace));
</del><ins>+    auto surface = IOSurface::createFromSendRight(WTFMove(WTF::get<MachSendRight>(handle)), parameters.colorSpace);
</ins><span class="cx">     if (!surface)
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessGPUmediaRemoteImageDecoderAVFcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/GPU/media/RemoteImageDecoderAVF.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/GPU/media/RemoteImageDecoderAVF.cpp       2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebKit/WebProcess/GPU/media/RemoteImageDecoderAVF.cpp  2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -28,13 +28,12 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(GPU_PROCESS) && HAVE(AVASSETREADER)
</span><span class="cx"> 
</span><del>-#include "ColorSpaceData.h"
</del><span class="cx"> #include "GPUProcessConnection.h"
</span><span class="cx"> #include "RemoteImageDecoderAVFProxyMessages.h"
</span><span class="cx"> #include "SharedBufferDataReference.h"
</span><span class="cx"> #include "WebProcess.h"
</span><span class="cx"> #include <WebCore/AVAssetMIMETypeCache.h>
</span><del>-#include <WebCore/ColorSpaceCG.h>
</del><ins>+#include <WebCore/DestinationColorSpace.h>
</ins><span class="cx"> #include <WebCore/IOSurface.h>
</span><span class="cx"> #include <WebCore/ImageTypes.h>
</span><span class="cx"> #include <WebCore/MIMETypeRegistry.h>
</span><span class="lines">@@ -168,14 +167,14 @@
</span><span class="cx">             return;
</span><span class="cx"> 
</span><span class="cx">         Optional<MachSendRight> sendRight;
</span><del>-        ColorSpaceData colorSpace;
</del><ins>+        Optional<DestinationColorSpace> colorSpace;
</ins><span class="cx">         if (!m_gpuProcessConnection->connection().sendSync(Messages::RemoteImageDecoderAVFProxy::CreateFrameImageAtIndex(m_identifier, index), Messages::RemoteImageDecoderAVFProxy::CreateFrameImageAtIndex::Reply(sendRight, colorSpace), 0))
</span><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        if (!sendRight)
</del><ins>+        if (!sendRight || !colorSpace)
</ins><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        auto surface = WebCore::IOSurface::createFromSendRight(WTFMove(*sendRight), colorSpace.cgColorSpace.get());
</del><ins>+        auto surface = WebCore::IOSurface::createFromSendRight(WTFMove(*sendRight), WTFMove(*colorSpace));
</ins><span class="cx">         if (!surface)
</span><span class="cx">             return;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessGPUmediacocoaMediaPlayerPrivateRemoteCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/GPU/media/cocoa/MediaPlayerPrivateRemoteCocoa.mm (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/GPU/media/cocoa/MediaPlayerPrivateRemoteCocoa.mm  2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebKit/WebProcess/GPU/media/cocoa/MediaPlayerPrivateRemoteCocoa.mm     2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -71,7 +71,7 @@
</span><span class="cx">     if (!sendRight)
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><del>-    auto surface = WebCore::IOSurface::createFromSendRight(WTFMove(*sendRight), sRGBColorSpaceRef());
</del><ins>+    auto surface = WebCore::IOSurface::createFromSendRight(WTFMove(*sendRight), WebCore::DestinationColorSpace::SRGB());
</ins><span class="cx">     if (!surface)
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="lines">@@ -91,7 +91,7 @@
</span><span class="cx">     if (!sendRight)
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><del>-    auto surface = WebCore::IOSurface::createFromSendRight(WTFMove(*sendRight), nullptr);
</del><ins>+    auto surface = WebCore::IOSurface::createFromSendRight(WTFMove(*sendRight), WebCore::DestinationColorSpace::SRGB());
</ins><span class="cx">     if (!surface)
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessPluginsPDFPDFPluginmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm  2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm     2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -646,7 +646,7 @@
</span><span class="cx">     [m_containerLayer addSublayer:m_scrollCornerLayer.get()];
</span><span class="cx">     if ([m_pdfLayerController respondsToSelector:@selector(setDeviceColorSpace:)]) {
</span><span class="cx">         auto view = frame.coreFrame()->view();
</span><del>-        [m_pdfLayerController setDeviceColorSpace:screenColorSpace(view)];
</del><ins>+        [m_pdfLayerController setDeviceColorSpace:screenColorSpace(view).platformColorSpace()];
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx"> #if HAVE(INCREMENTAL_PDF_APIS)
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebCoreSupportShareableBitmapUtilitiescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/WebCoreSupport/ShareableBitmapUtilities.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/WebCoreSupport/ShareableBitmapUtilities.cpp       2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebKit/WebProcess/WebCoreSupport/ShareableBitmapUtilities.cpp  2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -57,12 +57,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // FIXME: Only select ExtendedColor on images known to need wide gamut.
</span><del>-    ShareableBitmap::Configuration bitmapConfiguration;
-#if USE(CG)
-    bitmapConfiguration.colorSpace.cgColorSpace = screenColorSpace(renderImage.frame().mainFrame().view());
-#endif
-
-    auto sharedBitmap = ShareableBitmap::createShareable(IntSize(bitmapSize), bitmapConfiguration);
</del><ins>+    auto sharedBitmap = ShareableBitmap::createShareable(IntSize(bitmapSize), { screenColorSpace(renderImage.frame().mainFrame().view()) });
</ins><span class="cx">     if (!sharedBitmap)
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebCoreSupportWebChromeClientcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp        2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp   2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -927,7 +927,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(GPU_PROCESS)
</span><span class="cx"> 
</span><del>-RefPtr<ImageBuffer> WebChromeClient::createImageBuffer(const FloatSize& size, RenderingMode renderingMode, RenderingPurpose purpose, float resolutionScale, DestinationColorSpace colorSpace, PixelFormat pixelFormat) const
</del><ins>+RefPtr<ImageBuffer> WebChromeClient::createImageBuffer(const FloatSize& size, RenderingMode renderingMode, RenderingPurpose purpose, float resolutionScale, const DestinationColorSpace& colorSpace, PixelFormat pixelFormat) const
</ins><span class="cx"> {
</span><span class="cx">     if (!WebProcess::singleton().shouldUseRemoteRenderingFor(purpose))
</span><span class="cx">         return nullptr;
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebCoreSupportWebChromeClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h  2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h     2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -244,7 +244,7 @@
</span><span class="cx">     WebCore::DisplayRefreshMonitorFactory* displayRefreshMonitorFactory() const final;
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(GPU_PROCESS)
</span><del>-    RefPtr<WebCore::ImageBuffer> createImageBuffer(const WebCore::FloatSize&, WebCore::RenderingMode, WebCore::RenderingPurpose, float resolutionScale, WebCore::DestinationColorSpace, WebCore::PixelFormat) const final;
</del><ins>+    RefPtr<WebCore::ImageBuffer> createImageBuffer(const WebCore::FloatSize&, WebCore::RenderingMode, WebCore::RenderingPurpose, float resolutionScale, const WebCore::DestinationColorSpace&, WebCore::PixelFormat) const final;
</ins><span class="cx"> #if ENABLE(WEBGL)
</span><span class="cx">     RefPtr<WebCore::GraphicsContextGL> createGraphicsContextGL(const WebCore::GraphicsContextGLAttributes&, WebCore::PlatformDisplayID hostWindowDisplayID) const final;
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebCoreSupportmacWebDragClientMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm    2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebKit/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm       2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -68,9 +68,7 @@
</span><span class="cx"> 
</span><span class="cx"> static RefPtr<ShareableBitmap> convertDragImageToBitmap(DragImage image, const IntSize& size, Frame& frame)
</span><span class="cx"> {
</span><del>-    ShareableBitmap::Configuration bitmapConfiguration;
-    bitmapConfiguration.colorSpace.cgColorSpace = screenColorSpace(frame.mainFrame().view());
-    auto bitmap = ShareableBitmap::createShareable(size, bitmapConfiguration);
</del><ins>+    auto bitmap = ShareableBitmap::createShareable(size, { screenColorSpace(frame.mainFrame().view()) });
</ins><span class="cx">     if (!bitmap)
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebPageDrawingAreah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/WebPage/DrawingArea.h (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/WebPage/DrawingArea.h     2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebKit/WebProcess/WebPage/DrawingArea.h        2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -50,6 +50,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><ins>+class DestinationColorSpace;
</ins><span class="cx"> class DisplayRefreshMonitor;
</span><span class="cx"> class Frame;
</span><span class="cx"> class FrameView;
</span><span class="lines">@@ -60,7 +61,6 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><del>-struct ColorSpaceData;
</del><span class="cx"> class LayerTreeHost;
</span><span class="cx"> struct WebPageCreationParameters;
</span><span class="cx"> struct WebPreferencesStore;
</span><span class="lines">@@ -180,7 +180,7 @@
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx">     // Used by TiledCoreAnimationDrawingArea.
</span><span class="cx">     virtual void setDeviceScaleFactor(float) { }
</span><del>-    virtual void setColorSpace(const ColorSpaceData&) { }
</del><ins>+    virtual void setColorSpace(Optional<WebCore::DestinationColorSpace>) { }
</ins><span class="cx"> 
</span><span class="cx">     virtual void adjustTransientZoom(double scale, WebCore::FloatPoint origin) { }
</span><span class="cx">     virtual void commitTransientZoom(double scale, WebCore::FloatPoint origin) { }
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebPageDrawingAreamessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/WebPage/DrawingArea.messages.in (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/WebPage/DrawingArea.messages.in   2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebKit/WebProcess/WebPage/DrawingArea.messages.in      2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -31,7 +31,7 @@
</span><span class="cx">     // Used by TiledCoreAnimationDrawingArea.
</span><span class="cx">     UpdateGeometry(WebCore::IntSize viewSize, bool flushSynchronously, MachSendRight fencePort)
</span><span class="cx">     SetDeviceScaleFactor(float deviceScaleFactor)
</span><del>-    SetColorSpace(struct WebKit::ColorSpaceData colorSpace)
</del><ins>+    SetColorSpace(struct Optional<WebCore::DestinationColorSpace> colorSpace)
</ins><span class="cx">     SetViewExposedRect(Optional<WebCore::FloatRect> viewExposedRect)
</span><span class="cx"> 
</span><span class="cx">     AdjustTransientZoom(double scale, WebCore::FloatPoint origin)
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebPageWebPagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp       2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp  2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -2594,7 +2594,7 @@
</span><span class="cx">     ShareableBitmap::Configuration configuration;
</span><span class="cx"> #if USE(CG)
</span><span class="cx">     if (options & SnapshotOptionsUseScreenColorSpace)
</span><del>-        configuration.colorSpace.cgColorSpace = screenColorSpace(page.corePage()->mainFrame().view());
</del><ins>+        configuration.colorSpace = screenColorSpace(page.corePage()->mainFrame().view());
</ins><span class="cx"> #endif
</span><span class="cx">     return configuration;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebPagemacTiledCoreAnimationDrawingAreah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h       2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h  2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -98,7 +98,7 @@
</span><span class="cx">     void suspendPainting();
</span><span class="cx">     void resumePainting();
</span><span class="cx">     void setLayerHostingMode(LayerHostingMode) override;
</span><del>-    void setColorSpace(const ColorSpaceData&) override;
</del><ins>+    void setColorSpace(Optional<WebCore::DestinationColorSpace>) override;
</ins><span class="cx">     void addFence(const WTF::MachSendRight&) override;
</span><span class="cx"> 
</span><span class="cx">     void addTransactionCallbackID(CallbackID) override;
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebPagemacTiledCoreAnimationDrawingAreamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm      2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm 2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -28,7 +28,6 @@
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx"> 
</span><del>-#import "ColorSpaceData.h"
</del><span class="cx"> #import "DisplayRefreshMonitorMac.h"
</span><span class="cx"> #import "DrawingAreaProxyMessages.h"
</span><span class="cx"> #import "LayerHostingContext.h"
</span><span class="lines">@@ -45,6 +44,7 @@
</span><span class="cx"> #import <pal/spi/cocoa/QuartzCoreSPI.h>
</span><span class="cx"> #import <QuartzCore/QuartzCore.h>
</span><span class="cx"> #import <WebCore/DebugPageOverlays.h>
</span><ins>+#import <WebCore/DestinationColorSpace.h>
</ins><span class="cx"> #import <WebCore/Frame.h>
</span><span class="cx"> #import <WebCore/FrameView.h>
</span><span class="cx"> #import <WebCore/GraphicsContext.h>
</span><span class="lines">@@ -91,6 +91,7 @@
</span><span class="cx">     });
</span><span class="cx"> 
</span><span class="cx">     updateLayerHostingContext();
</span><ins>+    
</ins><span class="cx">     setColorSpace(parameters.colorSpace);
</span><span class="cx"> 
</span><span class="cx">     if (auto viewExposedRect = parameters.viewExposedRect)
</span><span class="lines">@@ -650,9 +651,9 @@
</span><span class="cx">     send(Messages::DrawingAreaProxy::UpdateAcceleratedCompositingMode(0, layerTreeContext));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void TiledCoreAnimationDrawingArea::setColorSpace(const ColorSpaceData& colorSpace)
</del><ins>+void TiledCoreAnimationDrawingArea::setColorSpace(Optional<WebCore::DestinationColorSpace> colorSpace)
</ins><span class="cx"> {
</span><del>-    m_layerHostingContext->setColorSpace(colorSpace.cgColorSpace.get());
</del><ins>+    m_layerHostingContext->setColorSpace(colorSpace ? colorSpace->platformColorSpace() : nullptr);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RefPtr<WebCore::DisplayRefreshMonitor> TiledCoreAnimationDrawingArea::createDisplayRefreshMonitor(PlatformDisplayID displayID)
</span></span></pre></div>
<a id="trunkSourceWebKitLegacymacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKitLegacy/mac/ChangeLog (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKitLegacy/mac/ChangeLog  2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebKitLegacy/mac/ChangeLog     2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2021-05-24  Sam Weinig  <weinig@apple.com>
+
+        Convert DestinationColorSpace from an enum to class wrapping a platform color space (CGColorSpaceRef for CG ports, etc.)
+        https://bugs.webkit.org/show_bug.cgi?id=226143
+
+        Reviewed by Darin Adler.
+
+        * WebCoreSupport/WebContextMenuClient.mm:
+        (WebContextMenuClient::imageForCurrentSharingServicePickerItem):
+        Update for new DestinationColorSpace class.
+
</ins><span class="cx"> 2021-05-24  Darin Adler  <darin@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Remove StringBuilder::appendLiteral
</span></span></pre></div>
<a id="trunkSourceWebKitLegacymacWebCoreSupportWebContextMenuClientmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebContextMenuClient.mm (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebContextMenuClient.mm     2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebContextMenuClient.mm        2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -43,6 +43,7 @@
</span><span class="cx"> #import <WebCore/BitmapImage.h>
</span><span class="cx"> #import <WebCore/ContextMenu.h>
</span><span class="cx"> #import <WebCore/ContextMenuController.h>
</span><ins>+#import <WebCore/DestinationColorSpace.h>
</ins><span class="cx"> #import <WebCore/Document.h>
</span><span class="cx"> #import <WebCore/Frame.h>
</span><span class="cx"> #import <WebCore/FrameView.h>
</span><span class="lines">@@ -213,7 +214,7 @@
</span><span class="cx">         return nil;
</span><span class="cx"> 
</span><span class="cx">     // This is effectively a snapshot, and will be painted in an unaccelerated fashion in line with FrameSnapshotting.
</span><del>-    auto buffer = ImageBuffer::create(rect.size(), RenderingMode::Unaccelerated, 1, DestinationColorSpace::SRGB, PixelFormat::BGRA8);
</del><ins>+    auto buffer = ImageBuffer::create(rect.size(), RenderingMode::Unaccelerated, 1, DestinationColorSpace::SRGB(), PixelFormat::BGRA8);
</ins><span class="cx">     if (!buffer)
</span><span class="cx">         return nil;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog    2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Tools/ChangeLog       2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2021-05-24  Sam Weinig  <weinig@apple.com>
+
+        Convert DestinationColorSpace from an enum to class wrapping a platform color space (CGColorSpaceRef for CG ports, etc.)
+        https://bugs.webkit.org/show_bug.cgi?id=226143
+
+        Reviewed by Darin Adler.
+
+        * TestWebKitAPI/Tests/WebCore/cg/DisplayListTestsCG.cpp:
+        (TestWebKitAPI::TEST):
+        Upate test to use new DestinationColorSpace type.
+
</ins><span class="cx"> 2021-05-24  Stephan Szabo  <stephan.szabo@sony.com>
</span><span class="cx"> 
</span><span class="cx">         [PlayStation] Update scripts for JSC test changes
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreeiosPixelDumpSupportIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/ios/PixelDumpSupportIOS.mm (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/ios/PixelDumpSupportIOS.mm    2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Tools/DumpRenderTree/ios/PixelDumpSupportIOS.mm       2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2005, 2006, 2007, 2009 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2005-2021 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -38,6 +38,7 @@
</span><span class="cx"> #import <CommonCrypto/CommonDigest.h>
</span><span class="cx"> #import <MobileCoreServices/UTCoreTypes.h>
</span><span class="cx"> #import <QuartzCore/QuartzCore.h>
</span><ins>+#import <WebCore/DestinationColorSpace.h>
</ins><span class="cx"> #import <WebCore/GraphicsContextCG.h>
</span><span class="cx"> #import <WebCore/IOSurface.h>
</span><span class="cx"> #import <WebCore/PlatformScreen.h>
</span><span class="lines">@@ -71,7 +72,7 @@
</span><span class="cx"> #else
</span><span class="cx">     WebCore::IOSurface::Format snapshotFormat = WebCore::IOSurface::Format::BGRA;
</span><span class="cx"> #endif
</span><del>-    auto surface = WebCore::IOSurface::create(WebCore::expandedIntSize(snapshotSize), WebCore::sRGBColorSpaceRef(), snapshotFormat);
</del><ins>+    auto surface = WebCore::IOSurface::create(WebCore::expandedIntSize(snapshotSize), WebCore::DestinationColorSpace::SRGB(), snapshotFormat);
</ins><span class="cx">     RetainPtr<CGImageRef> cgImage = surface->createImage();
</span><span class="cx"> 
</span><span class="cx">     void* bitmapBuffer = nullptr;
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebCorecgDisplayListTestsCGcpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebCore/cg/DisplayListTestsCG.cpp (277985 => 277986)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebCore/cg/DisplayListTestsCG.cpp        2021-05-25 00:07:50 UTC (rev 277985)
+++ trunk/Tools/TestWebKitAPI/Tests/WebCore/cg/DisplayListTestsCG.cpp   2021-05-25 01:26:18 UTC (rev 277986)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if USE(CG)
</span><span class="cx"> 
</span><ins>+#include <WebCore/DestinationColorSpace.h>
</ins><span class="cx"> #include <WebCore/DisplayList.h>
</span><span class="cx"> #include <WebCore/DisplayListItems.h>
</span><span class="cx"> #include <WebCore/DisplayListReplayer.h>
</span><span class="lines">@@ -46,8 +47,8 @@
</span><span class="cx"> {
</span><span class="cx">     FloatRect contextBounds { 0, 0, contextWidth, contextHeight };
</span><span class="cx"> 
</span><del>-    auto colorSpace = adoptCF(CGColorSpaceCreateWithName(kCGColorSpaceSRGB));
-    auto cgContext = adoptCF(CGBitmapContextCreate(nullptr, contextWidth, contextHeight, 8, 4 * contextWidth, colorSpace.get(), kCGImageAlphaPremultipliedLast));
</del><ins>+    auto colorSpace = DestinationColorSpace::SRGB();
+    auto cgContext = adoptCF(CGBitmapContextCreate(nullptr, contextWidth, contextHeight, 8, 4 * contextWidth, colorSpace.platformColorSpace(), kCGImageAlphaPremultipliedLast));
</ins><span class="cx">     GraphicsContext context { cgContext.get() };
</span><span class="cx"> 
</span><span class="cx">     auto imageBufferIdentifier = RenderingResourceIdentifier::generate();
</span><span class="lines">@@ -69,7 +70,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     {
</span><del>-        auto imageBuffer = ImageBuffer::create({ 100, 100 }, RenderingMode::Unaccelerated, 1, DestinationColorSpace::SRGB, PixelFormat::BGRA8);
</del><ins>+        auto imageBuffer = ImageBuffer::create({ 100, 100 }, RenderingMode::Unaccelerated, 1, colorSpace, PixelFormat::BGRA8);
</ins><span class="cx">         ImageBufferHashMap imageBufferMap;
</span><span class="cx">         imageBufferMap.set(imageBufferIdentifier, imageBuffer.releaseNonNull());
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>