Remove ColorSpace argument to all the drawing calls
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 8 Nov 2015 07:17:53 +0000 (07:17 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 8 Nov 2015 07:17:53 +0000 (07:17 +0000)
https://bugs.webkit.org/show_bug.cgi?id=150967

Reviewed by Darin Adler.

Source/WebCore:

Since the -webkit-color-correction CSS property was removed in r188202, and ColorSpaceDeviceRGB
and ColorSpaceSRGB are functionally equivalent, we can remove all the ColorSpace arguments passed
to drawing functions, and remove RenderStyle::colorSpace(), which was hardcoded to return ColorSpaceSRGB.

Fill and stroke ColorSpaces are also remove from graphics state, simplifying color save/restore.

* bindings/scripts/CodeGeneratorObjC.pm:
(GenerateImplementation):
* css/CSSFilterImageValue.cpp:
(WebCore::CSSFilterImageValue::image):
* editing/FrameSelection.cpp:
(WebCore::CaretBase::paintCaret):
* editing/cocoa/HTMLConverter.mm:
(_platformColor):
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::paint):
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::clearRect):
(WebCore::CanvasRenderingContext2D::applyShadow):
(WebCore::CanvasRenderingContext2D::drawImage):
(WebCore::CanvasRenderingContext2D::compositeBuffer):
(WebCore::drawImageToContext):
(WebCore::CanvasRenderingContext2D::fullCanvasCompositedDrawImage):
(WebCore::CanvasRenderingContext2D::drawTextInternal):
* html/canvas/CanvasRenderingContext2D.h:
* html/canvas/CanvasStyle.cpp:
(WebCore::CanvasStyle::applyStrokeColor):
(WebCore::CanvasStyle::applyFillColor):
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::drawImageIntoBuffer):
* page/DebugPageOverlays.cpp:
(WebCore::RegionOverlay::drawRect):
* page/FrameView.cpp:
(WebCore::FrameView::paintScrollCorner):
(WebCore::FrameView::paintScrollbar):
(WebCore::FrameView::paintContents):
* page/PrintContext.cpp:
(WebCore::PrintContext::spoolAllPagesWithBoundaries):
* platform/ScrollView.cpp:
(WebCore::ScrollView::paintPanScrollIcon):
* platform/ScrollbarTheme.h:
(WebCore::ScrollbarTheme::defaultPaintScrollCorner):
* platform/ScrollbarThemeComposite.cpp:
(WebCore::ScrollbarThemeComposite::paintScrollCorner):
(WebCore::ScrollbarThemeComposite::paintOverhangAreas):
* platform/Theme.cpp:
(WebCore::Theme::drawNamedImage):
* platform/cocoa/ThemeCocoa.cpp:
(WebCore::ThemeCocoa::drawNamedImage):
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::drawPattern):
* platform/graphics/BitmapImage.h:
* platform/graphics/Color.h:
* platform/graphics/CrossfadeGeneratedImage.cpp:
(WebCore::drawCrossfadeSubimage):
(WebCore::CrossfadeGeneratedImage::draw):
(WebCore::CrossfadeGeneratedImage::drawPattern):
* platform/graphics/CrossfadeGeneratedImage.h:
* platform/graphics/GeneratedImage.h:
* platform/graphics/GradientImage.cpp:
(WebCore::GradientImage::draw):
(WebCore::GradientImage::drawPattern):
* platform/graphics/GradientImage.h:
* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContext::drawRaisedEllipse):
(WebCore::GraphicsContext::setStrokeColor):
(WebCore::GraphicsContext::setShadow):
(WebCore::GraphicsContext::setLegacyShadow):
(WebCore::GraphicsContext::getShadow):
(WebCore::GraphicsContext::setFillColor):
(WebCore::GraphicsContext::drawImage):
(WebCore::GraphicsContext::drawTiledImage):
(WebCore::GraphicsContext::drawImageBuffer):
(WebCore::GraphicsContext::fillRect):
(WebCore::GraphicsContext::fillRoundedRect):
(WebCore::GraphicsContext::fillRectWithRoundedHole):
(WebCore::GraphicsContext::clearShadow): Deleted.
* platform/graphics/GraphicsContext.h:
(WebCore::GraphicsContext::strokeColorSpace): Deleted.
(WebCore::GraphicsContext::fillColorSpace): Deleted.
* platform/graphics/Image.cpp:
(WebCore::Image::fillWithSolidColor):
(WebCore::Image::drawTiled):
* platform/graphics/Image.h:
(WebCore::Image::drawFrameMatchingSourceSize):
* platform/graphics/ImageBuffer.h:
(WebCore::ImageBuffer::create):
* platform/graphics/NamedImageGeneratedImage.cpp:
(WebCore::NamedImageGeneratedImage::draw):
(WebCore::NamedImageGeneratedImage::drawPattern):
* platform/graphics/NamedImageGeneratedImage.h:
* platform/graphics/ShadowBlur.cpp:
(WebCore::ScratchBuffer::setCachedShadowValues):
(WebCore::ScratchBuffer::setCachedInsetShadowValues):
(WebCore::ShadowBlur::ShadowBlur):
(WebCore::ShadowBlur::setShadowValues):
(WebCore::ShadowBlur::drawShadowBuffer):
(WebCore::ShadowBlur::drawRectShadowWithoutTiling):
(WebCore::ShadowBlur::drawInsetShadowWithoutTiling):
(WebCore::ShadowBlur::drawInsetShadowWithTiling):
(WebCore::ShadowBlur::drawRectShadowWithTiling):
(WebCore::ShadowBlur::drawLayerPieces):
(WebCore::ShadowBlur::blurAndColorShadowBuffer):
(WebCore::ShadowBlur::beginShadowLayer):
(WebCore::ShadowBlur::endShadowLayer):
* platform/graphics/ShadowBlur.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer):
(WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::setContentsToImage): Deleted.
* platform/graphics/ca/TileGrid.cpp:
(WebCore::TileGrid::platformCALayerPaintContents):
* platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
(PlatformCALayerWinInternal::drawRepaintCounters):
* platform/graphics/cairo/BitmapImageCairo.cpp:
(WebCore::BitmapImage::draw):
* platform/graphics/cairo/GraphicsContextCairo.cpp:
(WebCore::GraphicsContext::fillRect):
(WebCore::GraphicsContext::setPlatformFillColor):
(WebCore::GraphicsContext::setPlatformStrokeColor):
(WebCore::GraphicsContext::setPlatformShadow):
(WebCore::GraphicsContext::platformFillRoundedRect):
(WebCore::GraphicsContext::fillRectWithRoundedHole):
(WebCore::GraphicsContext::drawPattern):
* platform/graphics/cairo/ImageBufferCairo.cpp:
(WebCore::ImageBuffer::draw):
(WebCore::ImageBuffer::drawPattern):
* platform/graphics/cairo/ImageCairo.cpp:
(WebCore::Image::drawPattern):
* platform/graphics/cg/BitmapImageCG.cpp:
(WebCore::BitmapImage::draw):
* platform/graphics/cg/ColorCG.cpp:
(WebCore::leakCGColor):
(WebCore::cachedCGColor):
* platform/graphics/cg/GraphicsContext3DCG.cpp:
(WebCore::GraphicsContext3D::paintToCanvas):
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::setCGFillColor):
(WebCore::setCGStrokeColor):
(WebCore::GraphicsContext::platformInit):
(WebCore::GraphicsContext::drawNativeImage):
(WebCore::GraphicsContext::drawPattern):
(WebCore::GraphicsContext::drawRect):
(WebCore::GraphicsContext::drawLine):
(WebCore::GraphicsContext::applyFillPattern):
(WebCore::GraphicsContext::fillRect):
(WebCore::GraphicsContext::platformFillRoundedRect):
(WebCore::GraphicsContext::fillRectWithRoundedHole):
(WebCore::GraphicsContext::setPlatformShadow):
(WebCore::GraphicsContext::drawLinesForText):
(WebCore::GraphicsContext::setPlatformStrokeColor):
(WebCore::GraphicsContext::setPlatformFillColor):
(WebCore::sRGBColorSpaceRef): Deleted.
* platform/graphics/cg/ImageBufferCG.cpp:
(WebCore::ImageBuffer::copyImage):
(WebCore::ImageBuffer::draw):
(WebCore::ImageBuffer::drawPattern):
* platform/graphics/cg/ImageCG.cpp:
(WebCore::Image::drawPattern):
(WebCore::Image::imageWithColorSpace): Deleted.
* platform/graphics/cg/PDFDocumentImage.cpp:
(WebCore::PDFDocumentImage::draw):
* platform/graphics/cg/PDFDocumentImage.h:
* platform/graphics/cocoa/FontCascadeCocoa.mm:
(WebCore::FontCascade::drawGlyphs):
* platform/graphics/filters/FEBlend.cpp:
(WebCore::FEBlend::platformApplySoftware):
* platform/graphics/filters/FEColorMatrix.cpp:
(WebCore::FEColorMatrix::platformApplySoftware):
* platform/graphics/filters/FEComposite.cpp:
(WebCore::FEComposite::platformApplySoftware):
* platform/graphics/filters/FEDropShadow.cpp:
(WebCore::FEDropShadow::platformApplySoftware):
* platform/graphics/filters/FEFlood.cpp:
(WebCore::FEFlood::platformApplySoftware):
* platform/graphics/filters/FEMerge.cpp:
(WebCore::FEMerge::platformApplySoftware):
* platform/graphics/filters/FEOffset.cpp:
(WebCore::FEOffset::platformApplySoftware):
* platform/graphics/filters/FETile.cpp:
(WebCore::FETile::platformApplySoftware):
* platform/graphics/filters/SourceAlpha.cpp:
(WebCore::SourceAlpha::platformApplySoftware):
* platform/graphics/filters/SourceGraphic.cpp:
(WebCore::SourceGraphic::platformApplySoftware):
* platform/graphics/ios/IconIOS.mm:
(WebCore::Icon::paint):
* platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp:
* platform/graphics/texmap/coordinated/UpdateAtlas.cpp:
* platform/graphics/win/FontCGWin.cpp:
(WebCore::FontCascade::drawGlyphs):
* platform/graphics/win/GraphicsContextCGWin.cpp:
(WebCore::GraphicsContext::drawFocusRing):
* platform/graphics/win/ImageCGWin.cpp:
(WebCore::BitmapImage::getHBITMAPOfSize):
(WebCore::BitmapImage::drawFrameMatchingSourceSize):
* platform/graphics/win/ImageCairoWin.cpp:
(WebCore::BitmapImage::getHBITMAPOfSize):
(WebCore::BitmapImage::drawFrameMatchingSourceSize):
* platform/ios/LegacyTileCache.mm:
(WebCore::LegacyTileCache::drawLayer):
* platform/ios/LegacyTileGridTile.mm:
(WebCore::LegacyTileGridTile::showBorder):
* platform/ios/WebVideoFullscreenControllerAVKit.mm:
(WebVideoFullscreenControllerContext::didSetupFullscreen):
* platform/mac/DragImageMac.mm:
(WebCore::drawAtPoint):
* platform/mac/ScrollbarThemeMac.mm:
(WebCore::ScrollbarThemeMac::setUpOverhangAreaBackground):
* platform/mac/ThemeMac.mm:
(WebCore::ThemeMac::drawCellOrFocusRingWithViewIntoContext):
* platform/mediastream/MediaStreamPrivate.cpp:
(WebCore::MediaStreamPrivate::paintCurrentFrameInContext):
* platform/mock/ScrollbarThemeMock.cpp:
(WebCore::ScrollbarThemeMock::paintTrackBackground):
(WebCore::ScrollbarThemeMock::paintThumb):
* platform/win/DragImageWin.cpp:
(WebCore::createDragImageForLink):
* platform/win/PopupMenuWin.cpp:
(WebCore::PopupMenuWin::paint):
* platform/win/WebCoreTextRenderer.cpp:
(WebCore::doDrawTextAtPoint):
* rendering/EllipsisBox.cpp:
(WebCore::EllipsisBox::paint):
(WebCore::EllipsisBox::paintSelection):
* rendering/FilterEffectRenderer.cpp:
(WebCore::FilterEffectRendererHelper::applyFilterEffect):
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paintSelection):
(WebCore::InlineTextBox::paintCompositionBackground):
(WebCore::InlineTextBox::paintDecoration):
(WebCore::InlineTextBox::paintTextMatchMarker):
(WebCore::InlineTextBox::paintCompositionUnderline):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::blockSelectionGap):
(WebCore::RenderBlock::logicalLeftSelectionGap):
(WebCore::RenderBlock::logicalRightSelectionGap):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::paintClippingMask):
* rendering/RenderBoxModelObject.cpp:
(WebCore::applyBoxShadowForBackground):
(WebCore::RenderBoxModelObject::paintFillLayerExtended):
(WebCore::RenderBoxModelObject::paintBorder):
(WebCore::RenderBoxModelObject::drawBoxSideFromPath):
(WebCore::RenderBoxModelObject::paintBoxShadow):
* rendering/RenderDetailsMarker.cpp:
(WebCore::RenderDetailsMarker::paint):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::drawLineForBoxSide):
(WebCore::RenderElement::paintOutline):
* rendering/RenderEmbeddedObject.cpp:
(WebCore::RenderEmbeddedObject::paintSnapshotImage):
(WebCore::RenderEmbeddedObject::paintReplaced):
* rendering/RenderFileUploadControl.cpp:
(WebCore::RenderFileUploadControl::paintObject):
* rendering/RenderFrameSet.cpp:
(WebCore::RenderFrameSet::paintColumnBorder):
(WebCore::RenderFrameSet::paintRowBorder):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::paintReplaced):
(WebCore::RenderImage::paintIntoRect):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::beginTransparencyLayers):
(WebCore::RenderLayer::paintScrollCorner):
(WebCore::RenderLayer::drawPlatformResizerImage):
(WebCore::RenderLayer::paintResizer):
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::paintItemForeground):
(WebCore::RenderListBox::paintItemBackground):
* rendering/RenderListMarker.cpp:
(WebCore::RenderListMarker::paint):
* rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::paint):
* rendering/RenderScrollbarTheme.cpp:
(WebCore::RenderScrollbarTheme::paintScrollCorner):
* rendering/RenderSnapshottedPlugIn.cpp:
(WebCore::RenderSnapshottedPlugIn::paintSnapshot):
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::paintSliderTicks):
* rendering/RenderThemeIOS.mm:
(WebCore::drawAxialGradient):
(WebCore::drawRadialGradient):
(WebCore::RenderThemeIOS::paintCheckboxDecorations):
(WebCore::RenderThemeIOS::paintRadioDecorations):
(WebCore::RenderThemeIOS::paintMenuListButtonDecorations):
(WebCore::RenderThemeIOS::paintSliderTrack):
(WebCore::RenderThemeIOS::paintProgressBar):
(WebCore::RenderThemeIOS::paintFileUploadIconDecorations):
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::paintProgressBar):
(WebCore::RenderThemeMac::paintMenuListButtonDecorations):
(WebCore::RenderThemeMac::paintSnapshottedPluginOverlay):
(WebCore::titleTextColorForAttachment):
(WebCore::AttachmentLayout::layOutSubtitle):
(WebCore::paintAttachmentIconBackground):
(WebCore::paintAttachmentTitleBackground):
(WebCore::paintAttachmentProgress):
* rendering/RenderView.cpp:
(WebCore::RenderView::paint):
(WebCore::RenderView::paintBoxDecorations):
* rendering/RenderWidget.cpp:
(WebCore::RenderWidget::paint):
* rendering/RootInlineBox.cpp:
(WebCore::RootInlineBox::lineSelectionGap):
* rendering/SimpleLineLayoutFunctions.cpp:
(WebCore::SimpleLineLayout::paintDebugBorders):
* rendering/TextPaintStyle.cpp:
(WebCore::TextPaintStyle::TextPaintStyle):
(WebCore::adjustColorForVisibilityOnBackground):
(WebCore::computeTextPaintStyle):
(WebCore::updateGraphicsContext):
* rendering/TextPaintStyle.h:
(WebCore::TextPaintStyle::TextPaintStyle):
* rendering/TextPainter.cpp:
(WebCore::ShadowApplier::ShadowApplier):
(WebCore::paintTextWithShadows):
* rendering/mathml/RenderMathMLBlock.cpp:
(WebCore::RenderMathMLBlock::paint):
* rendering/mathml/RenderMathMLFraction.cpp:
(WebCore::RenderMathMLFraction::paint):
* rendering/mathml/RenderMathMLMenclose.cpp:
(WebCore::RenderMathMLMenclose::paint):
* rendering/mathml/RenderMathMLOperator.cpp:
(WebCore::RenderMathMLOperator::paint):
* rendering/mathml/RenderMathMLRadicalOperator.cpp:
(WebCore::RenderMathMLRadicalOperator::paint):
* rendering/mathml/RenderMathMLRoot.cpp:
(WebCore::RenderMathMLRoot::paint):
* rendering/shapes/Shape.cpp:
(WebCore::Shape::createRasterShape):
* rendering/style/NinePieceImage.cpp:
(WebCore::NinePieceImage::paint):
* rendering/style/RenderStyle.h:
* rendering/svg/RenderSVGImage.cpp:
(WebCore::RenderSVGImage::paintForeground):
* rendering/svg/RenderSVGPath.cpp:
(WebCore::useStrokeStyleToFill):
* rendering/svg/RenderSVGResourceFilter.cpp:
(WebCore::RenderSVGResourceFilter::postApplyResource):
* rendering/svg/RenderSVGResourceSolidColor.cpp:
(WebCore::RenderSVGResourceSolidColor::applyResource):
* rendering/svg/SVGInlineTextBox.cpp:
(WebCore::SVGInlineTextBox::paintSelectionBackground):
* rendering/svg/SVGRenderingContext.cpp:
(WebCore::SVGRenderingContext::prepareToRenderSVGContent):
(WebCore::SVGRenderingContext::bufferForeground):
* svg/SVGAnimatedColor.cpp:
(WebCore::SVGAnimatedColorAnimator::calculateAnimatedValue):
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::drawForContainer):
(WebCore::SVGImage::nativeImageForCurrentFrame):
(WebCore::SVGImage::drawPatternForContainer):
(WebCore::SVGImage::draw):
* svg/graphics/SVGImage.h:
* svg/graphics/SVGImageForContainer.cpp:
(WebCore::SVGImageForContainer::draw):
(WebCore::SVGImageForContainer::drawPattern):
* svg/graphics/SVGImageForContainer.h:
* svg/graphics/filters/SVGFEImage.cpp:
(WebCore::FEImage::platformApplySoftware):
* testing/MockPageOverlayClient.cpp:
(WebCore::MockPageOverlayClient::drawRect):

Source/WebKit/ios:

Since the -webkit-color-correction CSS property was removed in r188202, and ColorSpaceDeviceRGB
and ColorSpaceSRGB are functionally equivalent, we can remove all the ColorSpace arguments passed
to drawing functions, and remove RenderStyle::colorSpace(), which was hardcoded to return ColorSpaceSRGB.

* WebView/WebPDFViewIOS.mm:
(-[WebPDFView drawPage:]):
* WebView/WebPlainWhiteView.mm:

Source/WebKit/mac:

Since the -webkit-color-correction CSS property was removed in r188202, and ColorSpaceDeviceRGB
and ColorSpaceSRGB are functionally equivalent, we can remove all the ColorSpace arguments passed
to drawing functions, and remove RenderStyle::colorSpace(), which was hardcoded to return ColorSpaceSRGB.

* Misc/WebKitNSStringExtras.mm:
(-[NSString _web_drawAtPoint:font:textColor:allowingFontSmoothing:]):
* WebInspector/WebNodeHighlightView.mm:
(-[WebNodeHighlightView _layoutForNodeHighlight:parent:]):
(-[WebNodeHighlightView _layoutForRectsHighlight:parent:]):
* WebView/WebFrame.mm:
(-[WebFrame _bodyBackgroundColor]):
* WebView/WebFrameView.mm:
(-[WebFrameView drawRect:]):
* WebView/WebIndicateLayer.mm:

Source/WebKit2:

* Shared/API/c/cg/WKImageCG.cpp:
(WKImageCreateFromCGImage):
* Shared/ContextMenuContextData.cpp:
(WebKit::ContextMenuContextData::ContextMenuContextData):
* Shared/WebCoreArgumentCoders.cpp:
(IPC::encodeImage):
* Shared/mac/RemoteLayerBackingStore.mm:
(WebKit::RemoteLayerBackingStore::drawInContext):
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _updateScrollViewBackground]):
* UIProcess/WKInspectorHighlightView.mm:
(-[WKInspectorHighlightView _layoutForNodeHighlight:offset:]):
(-[WKInspectorHighlightView _layoutForRectsHighlight:]):
* UIProcess/ios/ViewGestureControllerIOS.mm:
(WebKit::ViewGestureController::beginSwipeGesture):
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _updateTapHighlight]):
* UIProcess/mac/ViewGestureControllerMac.mm:
(WebKit::ViewGestureController::beginSwipeGesture):
* WebProcess/WebPage/FindController.cpp:
(WebKit::FindController::drawRect):
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::createSelectionSnapshot):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::snapshotAtSize):
* WebProcess/WebPage/ios/FindControllerIOS.mm:
(WebKit::FindIndicatorOverlayClientIOS::drawRect):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::getPositionInformation):
* WebProcess/ios/WebVideoFullscreenManager.mm:
(WebKit::WebVideoFullscreenManager::didSetupFullscreen):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@192140 268f45cc-cd09-0410-ab3c-d52691b4dbfc

160 files changed:
Source/WebCore/ChangeLog
Source/WebCore/bindings/scripts/CodeGeneratorObjC.pm
Source/WebCore/css/CSSFilterImageValue.cpp
Source/WebCore/editing/FrameSelection.cpp
Source/WebCore/editing/cocoa/HTMLConverter.mm
Source/WebCore/html/HTMLCanvasElement.cpp
Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp
Source/WebCore/html/canvas/CanvasRenderingContext2D.h
Source/WebCore/html/canvas/CanvasStyle.cpp
Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp
Source/WebCore/page/DebugPageOverlays.cpp
Source/WebCore/page/FrameView.cpp
Source/WebCore/page/PrintContext.cpp
Source/WebCore/platform/ScrollView.cpp
Source/WebCore/platform/ScrollbarTheme.h
Source/WebCore/platform/ScrollbarThemeComposite.cpp
Source/WebCore/platform/Theme.cpp
Source/WebCore/platform/cocoa/ThemeCocoa.cpp
Source/WebCore/platform/graphics/BitmapImage.cpp
Source/WebCore/platform/graphics/BitmapImage.h
Source/WebCore/platform/graphics/Color.h
Source/WebCore/platform/graphics/CrossfadeGeneratedImage.cpp
Source/WebCore/platform/graphics/CrossfadeGeneratedImage.h
Source/WebCore/platform/graphics/GeneratedImage.h
Source/WebCore/platform/graphics/GradientImage.cpp
Source/WebCore/platform/graphics/GradientImage.h
Source/WebCore/platform/graphics/GraphicsContext.cpp
Source/WebCore/platform/graphics/GraphicsContext.h
Source/WebCore/platform/graphics/Image.cpp
Source/WebCore/platform/graphics/Image.h
Source/WebCore/platform/graphics/ImageBuffer.h
Source/WebCore/platform/graphics/NamedImageGeneratedImage.cpp
Source/WebCore/platform/graphics/NamedImageGeneratedImage.h
Source/WebCore/platform/graphics/ShadowBlur.cpp
Source/WebCore/platform/graphics/ShadowBlur.h
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm
Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
Source/WebCore/platform/graphics/ca/TileGrid.cpp
Source/WebCore/platform/graphics/ca/win/PlatformCALayerWinInternal.cpp
Source/WebCore/platform/graphics/cairo/BitmapImageCairo.cpp
Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp
Source/WebCore/platform/graphics/cairo/ImageCairo.cpp
Source/WebCore/platform/graphics/cg/BitmapImageCG.cpp
Source/WebCore/platform/graphics/cg/ColorCG.cpp
Source/WebCore/platform/graphics/cg/GraphicsContext3DCG.cpp
Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp
Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp
Source/WebCore/platform/graphics/cg/ImageCG.cpp
Source/WebCore/platform/graphics/cg/PDFDocumentImage.cpp
Source/WebCore/platform/graphics/cg/PDFDocumentImage.h
Source/WebCore/platform/graphics/cocoa/FontCascadeCocoa.mm
Source/WebCore/platform/graphics/filters/FEBlend.cpp
Source/WebCore/platform/graphics/filters/FEColorMatrix.cpp
Source/WebCore/platform/graphics/filters/FEComposite.cpp
Source/WebCore/platform/graphics/filters/FEDropShadow.cpp
Source/WebCore/platform/graphics/filters/FEFlood.cpp
Source/WebCore/platform/graphics/filters/FEMerge.cpp
Source/WebCore/platform/graphics/filters/FEOffset.cpp
Source/WebCore/platform/graphics/filters/FETile.cpp
Source/WebCore/platform/graphics/filters/SourceAlpha.cpp
Source/WebCore/platform/graphics/filters/SourceGraphic.cpp
Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp
Source/WebCore/platform/graphics/ios/IconIOS.mm
Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp
Source/WebCore/platform/graphics/texmap/coordinated/UpdateAtlas.cpp
Source/WebCore/platform/graphics/win/FontCGWin.cpp
Source/WebCore/platform/graphics/win/GraphicsContextCGWin.cpp
Source/WebCore/platform/graphics/win/GraphicsContextCairoWin.cpp
Source/WebCore/platform/graphics/win/ImageCGWin.cpp
Source/WebCore/platform/graphics/win/ImageCairoWin.cpp
Source/WebCore/platform/ios/LegacyTileCache.mm
Source/WebCore/platform/ios/LegacyTileGridTile.mm
Source/WebCore/platform/ios/WebVideoFullscreenControllerAVKit.mm
Source/WebCore/platform/mac/DragImageMac.mm
Source/WebCore/platform/mac/ScrollbarThemeMac.mm
Source/WebCore/platform/mac/ThemeMac.mm
Source/WebCore/platform/mediastream/MediaStreamPrivate.cpp
Source/WebCore/platform/mock/ScrollbarThemeMock.cpp
Source/WebCore/platform/win/DragImageWin.cpp
Source/WebCore/platform/win/PopupMenuWin.cpp
Source/WebCore/platform/win/WebCoreTextRenderer.cpp
Source/WebCore/rendering/EllipsisBox.cpp
Source/WebCore/rendering/FilterEffectRenderer.cpp
Source/WebCore/rendering/InlineTextBox.cpp
Source/WebCore/rendering/RenderBlock.cpp
Source/WebCore/rendering/RenderBox.cpp
Source/WebCore/rendering/RenderBoxModelObject.cpp
Source/WebCore/rendering/RenderDetailsMarker.cpp
Source/WebCore/rendering/RenderElement.cpp
Source/WebCore/rendering/RenderEmbeddedObject.cpp
Source/WebCore/rendering/RenderFileUploadControl.cpp
Source/WebCore/rendering/RenderFrameSet.cpp
Source/WebCore/rendering/RenderImage.cpp
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderListBox.cpp
Source/WebCore/rendering/RenderListMarker.cpp
Source/WebCore/rendering/RenderReplaced.cpp
Source/WebCore/rendering/RenderScrollbarTheme.cpp
Source/WebCore/rendering/RenderSnapshottedPlugIn.cpp
Source/WebCore/rendering/RenderTheme.cpp
Source/WebCore/rendering/RenderThemeGtk.cpp
Source/WebCore/rendering/RenderThemeIOS.mm
Source/WebCore/rendering/RenderThemeMac.mm
Source/WebCore/rendering/RenderView.cpp
Source/WebCore/rendering/RenderWidget.cpp
Source/WebCore/rendering/RootInlineBox.cpp
Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp
Source/WebCore/rendering/TextPaintStyle.cpp
Source/WebCore/rendering/TextPaintStyle.h
Source/WebCore/rendering/TextPainter.cpp
Source/WebCore/rendering/mathml/RenderMathMLBlock.cpp
Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp
Source/WebCore/rendering/mathml/RenderMathMLMenclose.cpp
Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp
Source/WebCore/rendering/mathml/RenderMathMLRadicalOperator.cpp
Source/WebCore/rendering/mathml/RenderMathMLRoot.cpp
Source/WebCore/rendering/shapes/Shape.cpp
Source/WebCore/rendering/style/NinePieceImage.cpp
Source/WebCore/rendering/style/RenderStyle.h
Source/WebCore/rendering/svg/RenderSVGImage.cpp
Source/WebCore/rendering/svg/RenderSVGPath.cpp
Source/WebCore/rendering/svg/RenderSVGResourceFilter.cpp
Source/WebCore/rendering/svg/RenderSVGResourceSolidColor.cpp
Source/WebCore/rendering/svg/SVGInlineTextBox.cpp
Source/WebCore/rendering/svg/SVGRenderingContext.cpp
Source/WebCore/svg/SVGAnimatedColor.cpp
Source/WebCore/svg/graphics/SVGImage.cpp
Source/WebCore/svg/graphics/SVGImage.h
Source/WebCore/svg/graphics/SVGImageForContainer.cpp
Source/WebCore/svg/graphics/SVGImageForContainer.h
Source/WebCore/svg/graphics/filters/SVGFEImage.cpp
Source/WebCore/testing/MockPageOverlayClient.cpp
Source/WebKit/ios/ChangeLog
Source/WebKit/ios/WebView/WebPDFViewIOS.mm
Source/WebKit/ios/WebView/WebPlainWhiteView.mm
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/Misc/WebKitNSStringExtras.mm
Source/WebKit/mac/WebInspector/WebNodeHighlightView.mm
Source/WebKit/mac/WebView/WebFrame.mm
Source/WebKit/mac/WebView/WebFrameView.mm
Source/WebKit/mac/WebView/WebIndicateLayer.mm
Source/WebKit/mac/WebView/WebView.mm
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/API/c/cg/WKImageCG.cpp
Source/WebKit2/Shared/ContextMenuContextData.cpp
Source/WebKit2/Shared/WebCoreArgumentCoders.cpp
Source/WebKit2/Shared/mac/RemoteLayerBackingStore.mm
Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm
Source/WebKit2/UIProcess/WKInspectorHighlightView.mm
Source/WebKit2/UIProcess/cairo/BackingStoreCairo.cpp
Source/WebKit2/UIProcess/ios/ViewGestureControllerIOS.mm
Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm
Source/WebKit2/UIProcess/mac/ViewGestureControllerMac.mm
Source/WebKit2/WebProcess/WebPage/FindController.cpp
Source/WebKit2/WebProcess/WebPage/WebFrame.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Source/WebKit2/WebProcess/WebPage/ios/FindControllerIOS.mm
Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm
Source/WebKit2/WebProcess/ios/WebVideoFullscreenManager.mm

index f9557f4..ed539ab 100644 (file)
@@ -1,5 +1,376 @@
 2015-11-07  Simon Fraser  <simon.fraser@apple.com>
 
+        Remove ColorSpace argument to all the drawing calls
+        https://bugs.webkit.org/show_bug.cgi?id=150967
+
+        Reviewed by Darin Adler.
+
+        Since the -webkit-color-correction CSS property was removed in r188202, and ColorSpaceDeviceRGB
+        and ColorSpaceSRGB are functionally equivalent, we can remove all the ColorSpace arguments passed
+        to drawing functions, and remove RenderStyle::colorSpace(), which was hardcoded to return ColorSpaceSRGB.
+        
+        Fill and stroke ColorSpaces are also remove from graphics state, simplifying color save/restore.
+        
+        * bindings/scripts/CodeGeneratorObjC.pm:
+        (GenerateImplementation):
+        * css/CSSFilterImageValue.cpp:
+        (WebCore::CSSFilterImageValue::image):
+        * editing/FrameSelection.cpp:
+        (WebCore::CaretBase::paintCaret):
+        * editing/cocoa/HTMLConverter.mm:
+        (_platformColor):
+        * html/HTMLCanvasElement.cpp:
+        (WebCore::HTMLCanvasElement::paint):
+        * html/canvas/CanvasRenderingContext2D.cpp:
+        (WebCore::CanvasRenderingContext2D::clearRect):
+        (WebCore::CanvasRenderingContext2D::applyShadow):
+        (WebCore::CanvasRenderingContext2D::drawImage):
+        (WebCore::CanvasRenderingContext2D::compositeBuffer):
+        (WebCore::drawImageToContext):
+        (WebCore::CanvasRenderingContext2D::fullCanvasCompositedDrawImage):
+        (WebCore::CanvasRenderingContext2D::drawTextInternal):
+        * html/canvas/CanvasRenderingContext2D.h:
+        * html/canvas/CanvasStyle.cpp:
+        (WebCore::CanvasStyle::applyStrokeColor):
+        (WebCore::CanvasStyle::applyFillColor):
+        * html/canvas/WebGLRenderingContextBase.cpp:
+        (WebCore::WebGLRenderingContextBase::drawImageIntoBuffer):
+        * page/DebugPageOverlays.cpp:
+        (WebCore::RegionOverlay::drawRect):
+        * page/FrameView.cpp:
+        (WebCore::FrameView::paintScrollCorner):
+        (WebCore::FrameView::paintScrollbar):
+        (WebCore::FrameView::paintContents):
+        * page/PrintContext.cpp:
+        (WebCore::PrintContext::spoolAllPagesWithBoundaries):
+        * platform/ScrollView.cpp:
+        (WebCore::ScrollView::paintPanScrollIcon):
+        * platform/ScrollbarTheme.h:
+        (WebCore::ScrollbarTheme::defaultPaintScrollCorner):
+        * platform/ScrollbarThemeComposite.cpp:
+        (WebCore::ScrollbarThemeComposite::paintScrollCorner):
+        (WebCore::ScrollbarThemeComposite::paintOverhangAreas):
+        * platform/Theme.cpp:
+        (WebCore::Theme::drawNamedImage):
+        * platform/cocoa/ThemeCocoa.cpp:
+        (WebCore::ThemeCocoa::drawNamedImage):
+        * platform/graphics/BitmapImage.cpp:
+        (WebCore::BitmapImage::drawPattern):
+        * platform/graphics/BitmapImage.h:
+        * platform/graphics/Color.h:
+        * platform/graphics/CrossfadeGeneratedImage.cpp:
+        (WebCore::drawCrossfadeSubimage):
+        (WebCore::CrossfadeGeneratedImage::draw):
+        (WebCore::CrossfadeGeneratedImage::drawPattern):
+        * platform/graphics/CrossfadeGeneratedImage.h:
+        * platform/graphics/GeneratedImage.h:
+        * platform/graphics/GradientImage.cpp:
+        (WebCore::GradientImage::draw):
+        (WebCore::GradientImage::drawPattern):
+        * platform/graphics/GradientImage.h:
+        * platform/graphics/GraphicsContext.cpp:
+        (WebCore::GraphicsContext::drawRaisedEllipse):
+        (WebCore::GraphicsContext::setStrokeColor):
+        (WebCore::GraphicsContext::setShadow):
+        (WebCore::GraphicsContext::setLegacyShadow):
+        (WebCore::GraphicsContext::getShadow):
+        (WebCore::GraphicsContext::setFillColor):
+        (WebCore::GraphicsContext::drawImage):
+        (WebCore::GraphicsContext::drawTiledImage):
+        (WebCore::GraphicsContext::drawImageBuffer):
+        (WebCore::GraphicsContext::fillRect):
+        (WebCore::GraphicsContext::fillRoundedRect):
+        (WebCore::GraphicsContext::fillRectWithRoundedHole):
+        (WebCore::GraphicsContext::clearShadow): Deleted.
+        * platform/graphics/GraphicsContext.h:
+        (WebCore::GraphicsContext::strokeColorSpace): Deleted.
+        (WebCore::GraphicsContext::fillColorSpace): Deleted.
+        * platform/graphics/Image.cpp:
+        (WebCore::Image::fillWithSolidColor):
+        (WebCore::Image::drawTiled):
+        * platform/graphics/Image.h:
+        (WebCore::Image::drawFrameMatchingSourceSize):
+        * platform/graphics/ImageBuffer.h:
+        (WebCore::ImageBuffer::create):
+        * platform/graphics/NamedImageGeneratedImage.cpp:
+        (WebCore::NamedImageGeneratedImage::draw):
+        (WebCore::NamedImageGeneratedImage::drawPattern):
+        * platform/graphics/NamedImageGeneratedImage.h:
+        * platform/graphics/ShadowBlur.cpp:
+        (WebCore::ScratchBuffer::setCachedShadowValues):
+        (WebCore::ScratchBuffer::setCachedInsetShadowValues):
+        (WebCore::ShadowBlur::ShadowBlur):
+        (WebCore::ShadowBlur::setShadowValues):
+        (WebCore::ShadowBlur::drawShadowBuffer):
+        (WebCore::ShadowBlur::drawRectShadowWithoutTiling):
+        (WebCore::ShadowBlur::drawInsetShadowWithoutTiling):
+        (WebCore::ShadowBlur::drawInsetShadowWithTiling):
+        (WebCore::ShadowBlur::drawRectShadowWithTiling):
+        (WebCore::ShadowBlur::drawLayerPieces):
+        (WebCore::ShadowBlur::blurAndColorShadowBuffer):
+        (WebCore::ShadowBlur::beginShadowLayer):
+        (WebCore::ShadowBlur::endShadowLayer):
+        * platform/graphics/ShadowBlur.h:
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer):
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput):
+        * platform/graphics/ca/GraphicsLayerCA.cpp:
+        (WebCore::GraphicsLayerCA::setContentsToImage): Deleted.
+        * platform/graphics/ca/TileGrid.cpp:
+        (WebCore::TileGrid::platformCALayerPaintContents):
+        * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
+        (PlatformCALayerWinInternal::drawRepaintCounters):
+        * platform/graphics/cairo/BitmapImageCairo.cpp:
+        (WebCore::BitmapImage::draw):
+        * platform/graphics/cairo/GraphicsContextCairo.cpp:
+        (WebCore::GraphicsContext::fillRect):
+        (WebCore::GraphicsContext::setPlatformFillColor):
+        (WebCore::GraphicsContext::setPlatformStrokeColor):
+        (WebCore::GraphicsContext::setPlatformShadow):
+        (WebCore::GraphicsContext::platformFillRoundedRect):
+        (WebCore::GraphicsContext::fillRectWithRoundedHole):
+        (WebCore::GraphicsContext::drawPattern):
+        * platform/graphics/cairo/ImageBufferCairo.cpp:
+        (WebCore::ImageBuffer::draw):
+        (WebCore::ImageBuffer::drawPattern):
+        * platform/graphics/cairo/ImageCairo.cpp:
+        (WebCore::Image::drawPattern):
+        * platform/graphics/cg/BitmapImageCG.cpp:
+        (WebCore::BitmapImage::draw):
+        * platform/graphics/cg/ColorCG.cpp:
+        (WebCore::leakCGColor):
+        (WebCore::cachedCGColor):
+        * platform/graphics/cg/GraphicsContext3DCG.cpp:
+        (WebCore::GraphicsContext3D::paintToCanvas):
+        * platform/graphics/cg/GraphicsContextCG.cpp:
+        (WebCore::setCGFillColor):
+        (WebCore::setCGStrokeColor):
+        (WebCore::GraphicsContext::platformInit):
+        (WebCore::GraphicsContext::drawNativeImage):
+        (WebCore::GraphicsContext::drawPattern):
+        (WebCore::GraphicsContext::drawRect):
+        (WebCore::GraphicsContext::drawLine):
+        (WebCore::GraphicsContext::applyFillPattern):
+        (WebCore::GraphicsContext::fillRect):
+        (WebCore::GraphicsContext::platformFillRoundedRect):
+        (WebCore::GraphicsContext::fillRectWithRoundedHole):
+        (WebCore::GraphicsContext::setPlatformShadow):
+        (WebCore::GraphicsContext::drawLinesForText):
+        (WebCore::GraphicsContext::setPlatformStrokeColor):
+        (WebCore::GraphicsContext::setPlatformFillColor):
+        (WebCore::sRGBColorSpaceRef): Deleted.
+        * platform/graphics/cg/ImageBufferCG.cpp:
+        (WebCore::ImageBuffer::copyImage):
+        (WebCore::ImageBuffer::draw):
+        (WebCore::ImageBuffer::drawPattern):
+        * platform/graphics/cg/ImageCG.cpp:
+        (WebCore::Image::drawPattern):
+        (WebCore::Image::imageWithColorSpace): Deleted.
+        * platform/graphics/cg/PDFDocumentImage.cpp:
+        (WebCore::PDFDocumentImage::draw):
+        * platform/graphics/cg/PDFDocumentImage.h:
+        * platform/graphics/cocoa/FontCascadeCocoa.mm:
+        (WebCore::FontCascade::drawGlyphs):
+        * platform/graphics/filters/FEBlend.cpp:
+        (WebCore::FEBlend::platformApplySoftware):
+        * platform/graphics/filters/FEColorMatrix.cpp:
+        (WebCore::FEColorMatrix::platformApplySoftware):
+        * platform/graphics/filters/FEComposite.cpp:
+        (WebCore::FEComposite::platformApplySoftware):
+        * platform/graphics/filters/FEDropShadow.cpp:
+        (WebCore::FEDropShadow::platformApplySoftware):
+        * platform/graphics/filters/FEFlood.cpp:
+        (WebCore::FEFlood::platformApplySoftware):
+        * platform/graphics/filters/FEMerge.cpp:
+        (WebCore::FEMerge::platformApplySoftware):
+        * platform/graphics/filters/FEOffset.cpp:
+        (WebCore::FEOffset::platformApplySoftware):
+        * platform/graphics/filters/FETile.cpp:
+        (WebCore::FETile::platformApplySoftware):
+        * platform/graphics/filters/SourceAlpha.cpp:
+        (WebCore::SourceAlpha::platformApplySoftware):
+        * platform/graphics/filters/SourceGraphic.cpp:
+        (WebCore::SourceGraphic::platformApplySoftware):
+        * platform/graphics/ios/IconIOS.mm:
+        (WebCore::Icon::paint):
+        * platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp:
+        * platform/graphics/texmap/coordinated/UpdateAtlas.cpp:
+        * platform/graphics/win/FontCGWin.cpp:
+        (WebCore::FontCascade::drawGlyphs):
+        * platform/graphics/win/GraphicsContextCGWin.cpp:
+        (WebCore::GraphicsContext::drawFocusRing):
+        * platform/graphics/win/ImageCGWin.cpp:
+        (WebCore::BitmapImage::getHBITMAPOfSize):
+        (WebCore::BitmapImage::drawFrameMatchingSourceSize):
+        * platform/graphics/win/ImageCairoWin.cpp:
+        (WebCore::BitmapImage::getHBITMAPOfSize):
+        (WebCore::BitmapImage::drawFrameMatchingSourceSize):
+        * platform/ios/LegacyTileCache.mm:
+        (WebCore::LegacyTileCache::drawLayer):
+        * platform/ios/LegacyTileGridTile.mm:
+        (WebCore::LegacyTileGridTile::showBorder):
+        * platform/ios/WebVideoFullscreenControllerAVKit.mm:
+        (WebVideoFullscreenControllerContext::didSetupFullscreen):
+        * platform/mac/DragImageMac.mm:
+        (WebCore::drawAtPoint):
+        * platform/mac/ScrollbarThemeMac.mm:
+        (WebCore::ScrollbarThemeMac::setUpOverhangAreaBackground):
+        * platform/mac/ThemeMac.mm:
+        (WebCore::ThemeMac::drawCellOrFocusRingWithViewIntoContext):
+        * platform/mediastream/MediaStreamPrivate.cpp:
+        (WebCore::MediaStreamPrivate::paintCurrentFrameInContext):
+        * platform/mock/ScrollbarThemeMock.cpp:
+        (WebCore::ScrollbarThemeMock::paintTrackBackground):
+        (WebCore::ScrollbarThemeMock::paintThumb):
+        * platform/win/DragImageWin.cpp:
+        (WebCore::createDragImageForLink):
+        * platform/win/PopupMenuWin.cpp:
+        (WebCore::PopupMenuWin::paint):
+        * platform/win/WebCoreTextRenderer.cpp:
+        (WebCore::doDrawTextAtPoint):
+        * rendering/EllipsisBox.cpp:
+        (WebCore::EllipsisBox::paint):
+        (WebCore::EllipsisBox::paintSelection):
+        * rendering/FilterEffectRenderer.cpp:
+        (WebCore::FilterEffectRendererHelper::applyFilterEffect):
+        * rendering/InlineTextBox.cpp:
+        (WebCore::InlineTextBox::paintSelection):
+        (WebCore::InlineTextBox::paintCompositionBackground):
+        (WebCore::InlineTextBox::paintDecoration):
+        (WebCore::InlineTextBox::paintTextMatchMarker):
+        (WebCore::InlineTextBox::paintCompositionUnderline):
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::blockSelectionGap):
+        (WebCore::RenderBlock::logicalLeftSelectionGap):
+        (WebCore::RenderBlock::logicalRightSelectionGap):
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::paintClippingMask):
+        * rendering/RenderBoxModelObject.cpp:
+        (WebCore::applyBoxShadowForBackground):
+        (WebCore::RenderBoxModelObject::paintFillLayerExtended):
+        (WebCore::RenderBoxModelObject::paintBorder):
+        (WebCore::RenderBoxModelObject::drawBoxSideFromPath):
+        (WebCore::RenderBoxModelObject::paintBoxShadow):
+        * rendering/RenderDetailsMarker.cpp:
+        (WebCore::RenderDetailsMarker::paint):
+        * rendering/RenderElement.cpp:
+        (WebCore::RenderElement::drawLineForBoxSide):
+        (WebCore::RenderElement::paintOutline):
+        * rendering/RenderEmbeddedObject.cpp:
+        (WebCore::RenderEmbeddedObject::paintSnapshotImage):
+        (WebCore::RenderEmbeddedObject::paintReplaced):
+        * rendering/RenderFileUploadControl.cpp:
+        (WebCore::RenderFileUploadControl::paintObject):
+        * rendering/RenderFrameSet.cpp:
+        (WebCore::RenderFrameSet::paintColumnBorder):
+        (WebCore::RenderFrameSet::paintRowBorder):
+        * rendering/RenderImage.cpp:
+        (WebCore::RenderImage::paintReplaced):
+        (WebCore::RenderImage::paintIntoRect):
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::beginTransparencyLayers):
+        (WebCore::RenderLayer::paintScrollCorner):
+        (WebCore::RenderLayer::drawPlatformResizerImage):
+        (WebCore::RenderLayer::paintResizer):
+        * rendering/RenderListBox.cpp:
+        (WebCore::RenderListBox::paintItemForeground):
+        (WebCore::RenderListBox::paintItemBackground):
+        * rendering/RenderListMarker.cpp:
+        (WebCore::RenderListMarker::paint):
+        * rendering/RenderReplaced.cpp:
+        (WebCore::RenderReplaced::paint):
+        * rendering/RenderScrollbarTheme.cpp:
+        (WebCore::RenderScrollbarTheme::paintScrollCorner):
+        * rendering/RenderSnapshottedPlugIn.cpp:
+        (WebCore::RenderSnapshottedPlugIn::paintSnapshot):
+        * rendering/RenderTheme.cpp:
+        (WebCore::RenderTheme::paintSliderTicks):
+        * rendering/RenderThemeIOS.mm:
+        (WebCore::drawAxialGradient):
+        (WebCore::drawRadialGradient):
+        (WebCore::RenderThemeIOS::paintCheckboxDecorations):
+        (WebCore::RenderThemeIOS::paintRadioDecorations):
+        (WebCore::RenderThemeIOS::paintMenuListButtonDecorations):
+        (WebCore::RenderThemeIOS::paintSliderTrack):
+        (WebCore::RenderThemeIOS::paintProgressBar):
+        (WebCore::RenderThemeIOS::paintFileUploadIconDecorations):
+        * rendering/RenderThemeMac.mm:
+        (WebCore::RenderThemeMac::paintProgressBar):
+        (WebCore::RenderThemeMac::paintMenuListButtonDecorations):
+        (WebCore::RenderThemeMac::paintSnapshottedPluginOverlay):
+        (WebCore::titleTextColorForAttachment):
+        (WebCore::AttachmentLayout::layOutSubtitle):
+        (WebCore::paintAttachmentIconBackground):
+        (WebCore::paintAttachmentTitleBackground):
+        (WebCore::paintAttachmentProgress):
+        * rendering/RenderView.cpp:
+        (WebCore::RenderView::paint):
+        (WebCore::RenderView::paintBoxDecorations):
+        * rendering/RenderWidget.cpp:
+        (WebCore::RenderWidget::paint):
+        * rendering/RootInlineBox.cpp:
+        (WebCore::RootInlineBox::lineSelectionGap):
+        * rendering/SimpleLineLayoutFunctions.cpp:
+        (WebCore::SimpleLineLayout::paintDebugBorders):
+        * rendering/TextPaintStyle.cpp:
+        (WebCore::TextPaintStyle::TextPaintStyle):
+        (WebCore::adjustColorForVisibilityOnBackground):
+        (WebCore::computeTextPaintStyle):
+        (WebCore::updateGraphicsContext):
+        * rendering/TextPaintStyle.h:
+        (WebCore::TextPaintStyle::TextPaintStyle):
+        * rendering/TextPainter.cpp:
+        (WebCore::ShadowApplier::ShadowApplier):
+        (WebCore::paintTextWithShadows):
+        * rendering/mathml/RenderMathMLBlock.cpp:
+        (WebCore::RenderMathMLBlock::paint):
+        * rendering/mathml/RenderMathMLFraction.cpp:
+        (WebCore::RenderMathMLFraction::paint):
+        * rendering/mathml/RenderMathMLMenclose.cpp:
+        (WebCore::RenderMathMLMenclose::paint):
+        * rendering/mathml/RenderMathMLOperator.cpp:
+        (WebCore::RenderMathMLOperator::paint):
+        * rendering/mathml/RenderMathMLRadicalOperator.cpp:
+        (WebCore::RenderMathMLRadicalOperator::paint):
+        * rendering/mathml/RenderMathMLRoot.cpp:
+        (WebCore::RenderMathMLRoot::paint):
+        * rendering/shapes/Shape.cpp:
+        (WebCore::Shape::createRasterShape):
+        * rendering/style/NinePieceImage.cpp:
+        (WebCore::NinePieceImage::paint):
+        * rendering/style/RenderStyle.h:
+        * rendering/svg/RenderSVGImage.cpp:
+        (WebCore::RenderSVGImage::paintForeground):
+        * rendering/svg/RenderSVGPath.cpp:
+        (WebCore::useStrokeStyleToFill):
+        * rendering/svg/RenderSVGResourceFilter.cpp:
+        (WebCore::RenderSVGResourceFilter::postApplyResource):
+        * rendering/svg/RenderSVGResourceSolidColor.cpp:
+        (WebCore::RenderSVGResourceSolidColor::applyResource):
+        * rendering/svg/SVGInlineTextBox.cpp:
+        (WebCore::SVGInlineTextBox::paintSelectionBackground):
+        * rendering/svg/SVGRenderingContext.cpp:
+        (WebCore::SVGRenderingContext::prepareToRenderSVGContent):
+        (WebCore::SVGRenderingContext::bufferForeground):
+        * svg/SVGAnimatedColor.cpp:
+        (WebCore::SVGAnimatedColorAnimator::calculateAnimatedValue):
+        * svg/graphics/SVGImage.cpp:
+        (WebCore::SVGImage::drawForContainer):
+        (WebCore::SVGImage::nativeImageForCurrentFrame):
+        (WebCore::SVGImage::drawPatternForContainer):
+        (WebCore::SVGImage::draw):
+        * svg/graphics/SVGImage.h:
+        * svg/graphics/SVGImageForContainer.cpp:
+        (WebCore::SVGImageForContainer::draw):
+        (WebCore::SVGImageForContainer::drawPattern):
+        * svg/graphics/SVGImageForContainer.h:
+        * svg/graphics/filters/SVGFEImage.cpp:
+        (WebCore::FEImage::platformApplySoftware):
+        * testing/MockPageOverlayClient.cpp:
+        (WebCore::MockPageOverlayClient::drawRect):
+
+2015-11-07  Simon Fraser  <simon.fraser@apple.com>
+
         Use ColorSpaceSRGB for image buffers everywhere
         https://bugs.webkit.org/show_bug.cgi?id=150990
 
index 4171987..f372a10 100644 (file)
@@ -1347,7 +1347,7 @@ sub GenerateImplementation
             } elsif ($idlType eq "Color") {
                 if ($shouldUseCGColor) {
                     $getterContentHead = "WebCore::cachedCGColor($getterContentHead";
-                    $getterContentTail .= ", WebCore::ColorSpaceDeviceRGB)";
+                    $getterContentTail .= ")";
                 } else {
                     $getterContentHead = "WebCore::nsColor($getterContentHead";
                     $getterContentTail .= ")";
index be75dc6..231a32d 100644 (file)
@@ -126,7 +126,7 @@ RefPtr<Image> CSSFilterImageValue::image(RenderElement* renderer, const FloatSiz
         return Image::nullImage();
 
     FloatRect imageRect = FloatRect(FloatPoint(), size);
-    texture->context().drawImage(*image, ColorSpaceDeviceRGB, imageRect);
+    texture->context().drawImage(*image, imageRect);
 
     RefPtr<FilterEffectRenderer> filterRenderer = FilterEffectRenderer::create();
     filterRenderer->setSourceImage(WTF::move(texture));
index a71e8b5..6e4b31e 100644 (file)
@@ -1570,7 +1570,6 @@ void CaretBase::paintCaret(Node* node, GraphicsContext& context, const LayoutPoi
         return;
 
     Color caretColor = Color::black;
-    ColorSpace colorSpace = ColorSpaceDeviceRGB;
     Element* element = is<Element>(*node) ? downcast<Element>(node) : node->parentElement();
     Element* rootEditableElement = node->rootEditableElement();
 
@@ -1583,17 +1582,14 @@ void CaretBase::paintCaret(Node* node, GraphicsContext& context, const LayoutPoi
             auto elementBGColor = elementStyle.visitedDependentColor(CSSPropertyBackgroundColor);
             if (disappearsIntoBackground(elementBGColor, rootEditableBGColor)) {
                 caretColor = rootEditableStyle.visitedDependentColor(CSSPropertyColor);
-                colorSpace = rootEditableStyle.colorSpace();
                 setToRootEditableElement = true;
             }
         }
-        if (!setToRootEditableElement) {
+        if (!setToRootEditableElement)
             caretColor = element->renderer()->style().visitedDependentColor(CSSPropertyColor);
-            colorSpace = element->renderer()->style().colorSpace();
-        }
     }
 
-    context.fillRect(caret, caretColor, colorSpace);
+    context.fillRect(caret, caretColor);
 #else
     UNUSED_PARAM(node);
     UNUSED_PARAM(context);
index d3d465f..75db71d 100644 (file)
@@ -873,7 +873,7 @@ static NSBundle *_webKitBundle()
 
 static inline UIColor *_platformColor(Color color)
 {
-    return [getUIColorClass() _disambiguated_due_to_CIImage_colorWithCGColor:cachedCGColor(color, WebCore::ColorSpaceDeviceRGB)];
+    return [getUIColorClass() _disambiguated_due_to_CIImage_colorWithCGColor:cachedCGColor(color)];
 }
 #else
 static inline NSColor *_platformColor(Color color)
index 5724c1a..c0fb48b 100644 (file)
@@ -388,9 +388,9 @@ void HTMLCanvasElement::paint(GraphicsContext& context, const LayoutRect& r, boo
 #if ENABLE(CSS_IMAGE_ORIENTATION)
                 orientationDescription.setImageOrientationEnum(renderer()->style().imageOrientation());
 #endif 
-                context.drawImage(*m_presentedImage, ColorSpaceDeviceRGB, snappedIntRect(r), ImagePaintingOptions(orientationDescription, useLowQualityScale));
+                context.drawImage(*m_presentedImage, snappedIntRect(r), ImagePaintingOptions(orientationDescription, useLowQualityScale));
             } else
-                context.drawImageBuffer(*imageBuffer, ColorSpaceDeviceRGB, snappedIntRect(r), useLowQualityScale);
+                context.drawImageBuffer(*imageBuffer, snappedIntRect(r), useLowQualityScale);
         }
     }
 
index b19d9e0..d2bdd0b 100644 (file)
@@ -1154,7 +1154,7 @@ void CanvasRenderingContext2D::clearRect(float x, float y, float width, float he
     if (shouldDrawShadows()) {
         context->save();
         saved = true;
-        context->setLegacyShadow(FloatSize(), 0, Color::transparent, ColorSpaceDeviceRGB);
+        context->setLegacyShadow(FloatSize(), 0, Color::transparent);
     }
     if (state().globalAlpha != 1) {
         if (!saved) {
@@ -1319,9 +1319,9 @@ void CanvasRenderingContext2D::applyShadow()
     if (shouldDrawShadows()) {
         float width = state().shadowOffset.width();
         float height = state().shadowOffset.height();
-        c->setLegacyShadow(FloatSize(width, -height), state().shadowBlur, state().shadowColor, ColorSpaceDeviceRGB);
+        c->setLegacyShadow(FloatSize(width, -height), state().shadowBlur, state().shadowColor);
     } else
-        c->setLegacyShadow(FloatSize(), 0, Color::transparent, ColorSpaceDeviceRGB);
+        c->setLegacyShadow(FloatSize(), 0, Color::transparent);
 }
 
 bool CanvasRenderingContext2D::shouldDrawShadows() const
@@ -1448,17 +1448,17 @@ void CanvasRenderingContext2D::drawImage(HTMLImageElement* imageElement, const F
     }
 
     if (rectContainsCanvas(normalizedDstRect)) {
-        c->drawImage(*image, ColorSpaceDeviceRGB, normalizedDstRect, normalizedSrcRect, ImagePaintingOptions(op, blendMode));
+        c->drawImage(*image, normalizedDstRect, normalizedSrcRect, ImagePaintingOptions(op, blendMode));
         didDrawEntireCanvas();
     } else if (isFullCanvasCompositeMode(op)) {
-        fullCanvasCompositedDrawImage(*image, ColorSpaceDeviceRGB, normalizedDstRect, normalizedSrcRect, op);
+        fullCanvasCompositedDrawImage(*image, normalizedDstRect, normalizedSrcRect, op);
         didDrawEntireCanvas();
     } else if (op == CompositeCopy) {
         clearCanvas();
-        c->drawImage(*image, ColorSpaceDeviceRGB, normalizedDstRect, normalizedSrcRect, ImagePaintingOptions(op, blendMode));
+        c->drawImage(*image, normalizedDstRect, normalizedSrcRect, ImagePaintingOptions(op, blendMode));
         didDrawEntireCanvas();
     } else {
-        c->drawImage(*image, ColorSpaceDeviceRGB, normalizedDstRect, normalizedSrcRect, ImagePaintingOptions(op, blendMode));
+        c->drawImage(*image, normalizedDstRect, normalizedSrcRect, ImagePaintingOptions(op, blendMode));
         didDraw(normalizedDstRect);
     }
     
@@ -1536,17 +1536,17 @@ void CanvasRenderingContext2D::drawImage(HTMLCanvasElement* sourceCanvas, const
 #endif
 
     if (rectContainsCanvas(dstRect)) {
-        c->drawImageBuffer(*buffer, ColorSpaceDeviceRGB, dstRect, srcRect, ImagePaintingOptions(state().globalComposite, state().globalBlend));
+        c->drawImageBuffer(*buffer, dstRect, srcRect, ImagePaintingOptions(state().globalComposite, state().globalBlend));
         didDrawEntireCanvas();
     } else if (isFullCanvasCompositeMode(state().globalComposite)) {
-        fullCanvasCompositedDrawImage(*buffer, ColorSpaceDeviceRGB, dstRect, srcRect, state().globalComposite);
+        fullCanvasCompositedDrawImage(*buffer, dstRect, srcRect, state().globalComposite);
         didDrawEntireCanvas();
     } else if (state().globalComposite == CompositeCopy) {
         clearCanvas();
-        c->drawImageBuffer(*buffer, ColorSpaceDeviceRGB, dstRect, srcRect, ImagePaintingOptions(state().globalComposite, state().globalBlend));
+        c->drawImageBuffer(*buffer, dstRect, srcRect, ImagePaintingOptions(state().globalComposite, state().globalBlend));
         didDrawEntireCanvas();
     } else {
-        c->drawImageBuffer(*buffer, ColorSpaceDeviceRGB, dstRect, srcRect, ImagePaintingOptions(state().globalComposite, state().globalBlend));
+        c->drawImageBuffer(*buffer, dstRect, srcRect, ImagePaintingOptions(state().globalComposite, state().globalBlend));
         didDraw(dstRect);
     }
 }
@@ -1612,7 +1612,7 @@ void CanvasRenderingContext2D::drawImage(HTMLVideoElement* video, const FloatRec
 
 #if USE(CG)
     if (PassNativeImagePtr image = video->nativeImageForCurrentTime()) {
-        c->drawNativeImage(image, FloatSize(video->videoWidth(), video->videoHeight()), ColorSpaceDeviceRGB, dstRect, srcRect);
+        c->drawNativeImage(image, FloatSize(video->videoWidth(), video->videoHeight()), dstRect, srcRect);
         if (rectContainsCanvas(dstRect))
             didDrawEntireCanvas();
         else
@@ -1726,21 +1726,21 @@ void CanvasRenderingContext2D::compositeBuffer(ImageBuffer& buffer, const IntRec
     c->clipOut(bufferRect);
     c->clearRect(canvasRect);
     c->restore();
-    c->drawImageBuffer(buffer, ColorSpaceDeviceRGB, bufferRect.location(), state().globalComposite);
+    c->drawImageBuffer(buffer, bufferRect.location(), state().globalComposite);
     c->restore();
 }
 
-static void drawImageToContext(Image& image, GraphicsContext& context, ColorSpace styleColorSpace, const FloatRect& dest, const FloatRect& src, CompositeOperator op)
+static void drawImageToContext(Image& image, GraphicsContext& context, const FloatRect& dest, const FloatRect& src, CompositeOperator op)
 {
-    context.drawImage(image, styleColorSpace, dest, src, op);
+    context.drawImage(image, dest, src, op);
 }
 
-static void drawImageToContext(ImageBuffer& imageBuffer, GraphicsContext& context, ColorSpace styleColorSpace, const FloatRect& dest, const FloatRect& src, CompositeOperator op)
+static void drawImageToContext(ImageBuffer& imageBuffer, GraphicsContext& context, const FloatRect& dest, const FloatRect& src, CompositeOperator op)
 {
-    context.drawImageBuffer(imageBuffer, styleColorSpace, dest, src, op);
+    context.drawImageBuffer(imageBuffer, dest, src, op);
 }
 
-template<class T> void  CanvasRenderingContext2D::fullCanvasCompositedDrawImage(T& image, ColorSpace styleColorSpace, const FloatRect& dest, const FloatRect& src, CompositeOperator op)
+template<class T> void CanvasRenderingContext2D::fullCanvasCompositedDrawImage(T& image, const FloatRect& dest, const FloatRect& src, CompositeOperator op)
 {
     ASSERT(isFullCanvasCompositeMode(op));
 
@@ -1766,7 +1766,7 @@ template<class T> void  CanvasRenderingContext2D::fullCanvasCompositedDrawImage(
     buffer->context().translate(-transformedAdjustedRect.location().x(), -transformedAdjustedRect.location().y());
     buffer->context().translate(croppedOffset.width(), croppedOffset.height());
     buffer->context().concatCTM(effectiveTransform);
-    drawImageToContext(image, buffer->context(), styleColorSpace, adjustedDest, src, CompositeSourceOver);
+    drawImageToContext(image, buffer->context(), adjustedDest, src, CompositeSourceOver);
 
     compositeBuffer(*buffer, bufferRect, op);
 }
@@ -2440,8 +2440,7 @@ void CanvasRenderingContext2D::drawTextInternal(const String& text, float x, flo
             FloatSize shadowOffset;
             float shadowRadius;
             Color shadowColor;
-            ColorSpace shadowColorSpace;
-            c->getShadow(shadowOffset, shadowRadius, shadowColor, shadowColorSpace);
+            c->getShadow(shadowOffset, shadowRadius, shadowColor);
 
             FloatRect shadowRect(maskRect);
             shadowRect.inflate(shadowRadius * 1.4);
@@ -2450,12 +2449,12 @@ void CanvasRenderingContext2D::drawTextInternal(const String& text, float x, flo
 
             shadowOffset += offset;
 
-            c->setLegacyShadow(shadowOffset, shadowRadius, shadowColor, shadowColorSpace);
+            c->setLegacyShadow(shadowOffset, shadowRadius, shadowColor);
 
             if (fill)
-                c->setFillColor(Color::black, ColorSpaceDeviceRGB);
+                c->setFillColor(Color::black);
             else
-                c->setStrokeColor(Color::black, ColorSpaceDeviceRGB);
+                c->setStrokeColor(Color::black);
 
             fontProxy.drawBidiText(*c, textRun, location + offset, FontCascade::UseFallbackIfFontNotReady);
         }
@@ -2467,9 +2466,9 @@ void CanvasRenderingContext2D::drawTextInternal(const String& text, float x, flo
         GraphicsContext& maskImageContext = maskImage->context();
 
         if (fill)
-            maskImageContext.setFillColor(Color::black, ColorSpaceDeviceRGB);
+            maskImageContext.setFillColor(Color::black);
         else {
-            maskImageContext.setStrokeColor(Color::black, ColorSpaceDeviceRGB);
+            maskImageContext.setStrokeColor(Color::black);
             maskImageContext.setStrokeThickness(c->strokeThickness());
         }
 
index 873f643..d6999bf 100644 (file)
@@ -31,7 +31,6 @@
 #include "CanvasRenderingContext.h"
 #include "CanvasStyle.h"
 #include "Color.h"
-#include "ColorSpace.h"
 #include "FloatSize.h"
 #include "FontCascade.h"
 #include "GraphicsContext.h"
@@ -367,7 +366,7 @@ private:
 
     void inflateStrokeRect(FloatRect&) const;
 
-    template<class T> void fullCanvasCompositedDrawImage(T&, ColorSpace, const FloatRect&, const FloatRect&, CompositeOperator);
+    template<class T> void fullCanvasCompositedDrawImage(T&, const FloatRect&, const FloatRect&, CompositeOperator);
 
     void prepareGradientForDashboard(CanvasGradient& gradient) const;
 
index d358a21..b683a2e 100644 (file)
@@ -241,7 +241,7 @@ void CanvasStyle::applyStrokeColor(GraphicsContext* context) const
         return;
     switch (m_type) {
     case RGBA:
-        context->setStrokeColor(m_rgba, ColorSpaceDeviceRGB);
+        context->setStrokeColor(m_rgba);
         break;
     case CMYKA: {
         // FIXME: Do this through platform-independent GraphicsContext API.
@@ -249,7 +249,7 @@ void CanvasStyle::applyStrokeColor(GraphicsContext* context) const
 #if USE(CG)
         CGContextSetCMYKStrokeColor(context->platformContext(), m_cmyka->c, m_cmyka->m, m_cmyka->y, m_cmyka->k, m_cmyka->a);
 #else
-        context->setStrokeColor(m_cmyka->rgba, ColorSpaceDeviceRGB);
+        context->setStrokeColor(m_cmyka->rgba);
 #endif
         break;
     }
@@ -273,7 +273,7 @@ void CanvasStyle::applyFillColor(GraphicsContext* context) const
         return;
     switch (m_type) {
     case RGBA:
-        context->setFillColor(m_rgba, ColorSpaceDeviceRGB);
+        context->setFillColor(m_rgba);
         break;
     case CMYKA: {
         // FIXME: Do this through platform-independent GraphicsContext API.
@@ -281,7 +281,7 @@ void CanvasStyle::applyFillColor(GraphicsContext* context) const
 #if USE(CG)
         CGContextSetCMYKFillColor(context->platformContext(), m_cmyka->c, m_cmyka->m, m_cmyka->y, m_cmyka->k, m_cmyka->a);
 #else
-        context->setFillColor(m_cmyka->rgba, ColorSpaceDeviceRGB);
+        context->setFillColor(m_cmyka->rgba);
 #endif
         break;
     }
index 66bfc90..330c950 100644 (file)
@@ -3176,7 +3176,7 @@ PassRefPtr<Image> WebGLRenderingContextBase::drawImageIntoBuffer(Image& image, i
 
     FloatRect srcRect(FloatPoint(), image.size());
     FloatRect destRect(FloatPoint(), size);
-    buf->context().drawImage(image, ColorSpaceDeviceRGB, destRect, srcRect);
+    buf->context().drawImage(image, destRect, srcRect);
     return buf->copyImage(ImageBuffer::fastCopyImageMode());
 }
 
index cae43da..0ecf83d 100644 (file)
@@ -190,7 +190,7 @@ void RegionOverlay::drawRect(PageOverlay&, GraphicsContext& context, const IntRe
         return;
     
     GraphicsContextStateSaver saver(context);
-    context.setFillColor(m_color, ColorSpaceSRGB);
+    context.setFillColor(m_color);
     for (auto rect : m_region->rects()) {
     
         if (rect.intersects(dirtyRect))
index 8fa0fe4..ad4eb0a 100644 (file)
@@ -3735,7 +3735,7 @@ void FrameView::paintScrollCorner(GraphicsContext& context, const IntRect& corne
 
     if (m_scrollCorner) {
         if (frame().isMainFrame())
-            context.fillRect(cornerRect, baseBackgroundColor(), ColorSpaceDeviceRGB);
+            context.fillRect(cornerRect, baseBackgroundColor());
         m_scrollCorner->paintIntoRect(context, cornerRect.location(), cornerRect);
         return;
     }
@@ -3748,7 +3748,7 @@ void FrameView::paintScrollbar(GraphicsContext& context, Scrollbar& bar, const I
     if (bar.isCustomScrollbar() && frame().isMainFrame()) {
         IntRect toFill = bar.frameRect();
         toFill.intersect(rect);
-        context.fillRect(toFill, baseBackgroundColor(), ColorSpaceDeviceRGB);
+        context.fillRect(toFill, baseBackgroundColor());
     }
 
     ScrollView::paintScrollbar(context, bar, rect);
@@ -4016,7 +4016,7 @@ void FrameView::paintContents(GraphicsContext& context, const IntRect& dirtyRect
         fillWithRed = true;
     
     if (fillWithRed)
-        context.fillRect(dirtyRect, Color(0xFF, 0, 0), ColorSpaceDeviceRGB);
+        context.fillRect(dirtyRect, Color(0xFF, 0, 0));
 #endif
 
     if (m_layoutPhase == InViewSizeAdjust)
index 2637511..034689a 100644 (file)
@@ -337,7 +337,7 @@ void PrintContext::spoolAllPagesWithBoundaries(Frame& frame, GraphicsContext& gr
     int totalHeight = pageRects.size() * (pageSizeInPixels.height() + 1) - 1;
 
     // Fill the whole background by white.
-    graphicsContext.setFillColor(Color(255, 255, 255), ColorSpaceDeviceRGB);
+    graphicsContext.setFillColor(Color(255, 255, 255));
     graphicsContext.fillRect(FloatRect(0, 0, pageWidth, totalHeight));
 
     graphicsContext.save();
@@ -356,8 +356,8 @@ void PrintContext::spoolAllPagesWithBoundaries(Frame& frame, GraphicsContext& gr
             int boundaryLineY = currentHeight - 1;
 #endif
             graphicsContext.save();
-            graphicsContext.setStrokeColor(Color(0, 0, 255), ColorSpaceDeviceRGB);
-            graphicsContext.setFillColor(Color(0, 0, 255), ColorSpaceDeviceRGB);
+            graphicsContext.setStrokeColor(Color(0, 0, 255));
+            graphicsContext.setFillColor(Color(0, 0, 255));
             graphicsContext.drawLine(IntPoint(0, boundaryLineY), IntPoint(pageWidth, boundaryLineY));
             graphicsContext.restore();
         }
index 15a0bb1..ddede65 100644 (file)
@@ -1183,7 +1183,7 @@ void ScrollView::paintPanScrollIcon(GraphicsContext& context)
     IntPoint iconGCPoint = m_panScrollIconPoint;
     if (parent())
         iconGCPoint = parent()->windowToContents(iconGCPoint);
-    context.drawImage(*panScrollIcon, ColorSpaceDeviceRGB, iconGCPoint);
+    context.drawImage(*panScrollIcon, iconGCPoint);
 }
 
 void ScrollView::paint(GraphicsContext& context, const IntRect& rect)
index e54c46a..cae5299 100644 (file)
@@ -85,7 +85,7 @@ public:
     virtual void invalidatePart(Scrollbar&, ScrollbarPart) { }
 
     virtual void paintScrollCorner(ScrollView*, GraphicsContext& context, const IntRect& cornerRect) { defaultPaintScrollCorner(context, cornerRect); }
-    static void defaultPaintScrollCorner(GraphicsContext& context, const IntRect& cornerRect) { context.fillRect(cornerRect, Color::white, ColorSpaceDeviceRGB); }
+    static void defaultPaintScrollCorner(GraphicsContext& context, const IntRect& cornerRect) { context.fillRect(cornerRect, Color::white); }
 
     virtual void paintTickmarks(GraphicsContext&, Scrollbar&, const IntRect&) { }
     virtual void paintOverhangAreas(ScrollView&, GraphicsContext&, const IntRect&, const IntRect&, const IntRect&) { }
index 72f2a63..46d9ee6 100644 (file)
@@ -262,7 +262,7 @@ int ScrollbarThemeComposite::trackLength(Scrollbar& scrollbar)
 
 void ScrollbarThemeComposite::paintScrollCorner(ScrollView*, GraphicsContext& context, const IntRect& cornerRect)
 {
-    context.fillRect(cornerRect, Color::white, ColorSpaceDeviceRGB);
+    context.fillRect(cornerRect, Color::white);
 }
 
 IntRect ScrollbarThemeComposite::thumbRect(Scrollbar& scrollbar)
@@ -281,11 +281,11 @@ IntRect ScrollbarThemeComposite::thumbRect(Scrollbar& scrollbar)
 
 void ScrollbarThemeComposite::paintOverhangAreas(ScrollView&, GraphicsContext& context, const IntRect& horizontalOverhangRect, const IntRect& verticalOverhangRect, const IntRect& dirtyRect)
 {    
-    context.setFillColor(Color::white, ColorSpaceDeviceRGB);
+    context.setFillColor(Color::white);
     if (!horizontalOverhangRect.isEmpty())
         context.fillRect(intersection(horizontalOverhangRect, dirtyRect));
 
-    context.setFillColor(Color::white, ColorSpaceDeviceRGB);
+    context.setFillColor(Color::white);
     if (!verticalOverhangRect.isEmpty())
         context.fillRect(intersection(verticalOverhangRect, dirtyRect));
 }
index 3906342..1934b35 100644 (file)
@@ -64,7 +64,7 @@ void Theme::drawNamedImage(const String& name, GraphicsContext& context, const F
         return;
 
     GraphicsContextStateSaver stateSaver(context);
-    context.setFillColor(Color::black, ColorSpaceDeviceRGB);
+    context.setFillColor(Color::black);
 
     // Draw a generic Wireless Playback icon.
 
index 8fccdc5..314eed5 100644 (file)
@@ -58,7 +58,7 @@ void ThemeCocoa::drawNamedImage(const String& name, GraphicsContext& context, co
     }
 
     GraphicsContextStateSaver stateSaver(context);
-    context.setFillColor(Color::black, ColorSpaceDeviceRGB);
+    context.setFillColor(Color::black);
 
     FloatSize wirelessPlaybackSrcSize(32, 24.016);
     fitContextToBox(context, wirelessPlaybackSrcSize, rect.size());
index 00533af..3ea1b5f 100644 (file)
@@ -607,13 +607,13 @@ void BitmapImage::resetAnimation()
 }
 
 void BitmapImage::drawPattern(GraphicsContext& ctxt, const FloatRect& tileRect, const AffineTransform& transform,
-    const FloatPoint& phase, const FloatSize& spacing, ColorSpace styleColorSpace, CompositeOperator op, const FloatRect& destRect, BlendMode blendMode)
+    const FloatPoint& phase, const FloatSize& spacing, CompositeOperator op, const FloatRect& destRect, BlendMode blendMode)
 {
     if (tileRect.isEmpty())
         return;
 
     if (!ctxt.drawLuminanceMask()) {
-        Image::drawPattern(ctxt, tileRect, transform, phase, spacing, styleColorSpace, op, destRect, blendMode);
+        Image::drawPattern(ctxt, tileRect, transform, phase, spacing, op, destRect, blendMode);
         return;
     }
     if (!m_cachedImage) {
@@ -627,7 +627,7 @@ void BitmapImage::drawPattern(GraphicsContext& ctxt, const FloatRect& tileRect,
         // Temporarily reset image observer, we don't want to receive any changeInRect() calls due to this relayout.
         setImageObserver(nullptr);
 
-        draw(buffer->context(), tileRect, tileRect, styleColorSpace, op, blendMode, ImageOrientationDescription());
+        draw(buffer->context(), tileRect, tileRect, op, blendMode, ImageOrientationDescription());
 
         setImageObserver(observer);
         buffer->convertToLuminanceMask();
@@ -638,7 +638,7 @@ void BitmapImage::drawPattern(GraphicsContext& ctxt, const FloatRect& tileRect,
     }
 
     ctxt.setDrawLuminanceMask(false);
-    m_cachedImage->drawPattern(ctxt, tileRect, transform, phase, spacing, styleColorSpace, op, destRect, blendMode);
+    m_cachedImage->drawPattern(ctxt, tileRect, transform, phase, spacing, op, destRect, blendMode);
 }
 
 
index 40fc74a..891e8c4 100644 (file)
@@ -141,7 +141,7 @@ public:
     virtual void resetAnimation() override;
 
     virtual void drawPattern(GraphicsContext&, const FloatRect& srcRect, const AffineTransform& patternTransform,
-        const FloatPoint& phase, const FloatSize& spacing, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& destRect, BlendMode = BlendModeNormal) override;
+        const FloatPoint& phase, const FloatSize& spacing, CompositeOperator, const FloatRect& destRect, BlendMode = BlendModeNormal) override;
 
     // Accessors for native image formats.
 
@@ -201,13 +201,13 @@ protected:
     WEBCORE_EXPORT BitmapImage(ImageObserver* = 0);
 
 #if PLATFORM(WIN)
-    virtual void drawFrameMatchingSourceSize(GraphicsContext&, const FloatRect& dstRect, const IntSize& srcSize, ColorSpace styleColorSpace, CompositeOperator) override;
+    virtual void drawFrameMatchingSourceSize(GraphicsContext&, const FloatRect& dstRect, const IntSize& srcSize, CompositeOperator) override;
 #endif
-    virtual void draw(GraphicsContext&, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator, BlendMode, ImageOrientationDescription) override;
+    virtual void draw(GraphicsContext&, const FloatRect& dstRect, const FloatRect& srcRect, CompositeOperator, BlendMode, ImageOrientationDescription) override;
 
 #if USE(WINGDI)
     virtual void drawPattern(GraphicsContext&, const FloatRect& srcRect, const AffineTransform& patternTransform,
-        const FloatPoint& phase, const FloatSize& spacing, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& destRect);
+        const FloatPoint& phase, const FloatSize& spacing, CompositeOperator, const FloatRect& destRect);
 #endif
 
     size_t currentFrame() const { return m_currentFrame; }
index d1d4e72..cf2f80b 100644 (file)
@@ -216,7 +216,7 @@ int differenceSquared(const Color&, const Color&);
 uint16_t fastDivideBy255(uint16_t);
 
 #if USE(CG)
-WEBCORE_EXPORT CGColorRef cachedCGColor(const Color&, ColorSpace);
+WEBCORE_EXPORT CGColorRef cachedCGColor(const Color&);
 #endif
 
 inline RGBA::RGBA()
index 43682b0..57e3f1a 100644 (file)
@@ -60,7 +60,7 @@ static void drawCrossfadeSubimage(GraphicsContext& context, Image& image, Compos
 
     if (targetSize != imageSize)
         context.scale(FloatSize(targetSize.width() / imageSize.width(), targetSize.height() / imageSize.height()));
-    context.drawImage(image, ColorSpaceDeviceRGB, IntPoint());
+    context.drawImage(image, IntPoint());
 
     if (useTransparencyLayer)
         context.endTransparencyLayer();
@@ -83,7 +83,7 @@ void CrossfadeGeneratedImage::drawCrossfade(GraphicsContext& context)
     context.endTransparencyLayer();
 }
 
-void CrossfadeGeneratedImage::draw(GraphicsContext& context, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace, CompositeOperator compositeOp, BlendMode blendMode, ImageOrientationDescription)
+void CrossfadeGeneratedImage::draw(GraphicsContext& context, const FloatRect& dstRect, const FloatRect& srcRect, CompositeOperator compositeOp, BlendMode blendMode, ImageOrientationDescription)
 {
     GraphicsContextStateSaver stateSaver(context);
     context.setCompositeOperation(compositeOp, blendMode);
@@ -96,7 +96,7 @@ void CrossfadeGeneratedImage::draw(GraphicsContext& context, const FloatRect& ds
     drawCrossfade(context);
 }
 
-void CrossfadeGeneratedImage::drawPattern(GraphicsContext& context, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, const FloatSize& spacing, ColorSpace styleColorSpace, CompositeOperator compositeOp, const FloatRect& dstRect, BlendMode blendMode)
+void CrossfadeGeneratedImage::drawPattern(GraphicsContext& context, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, const FloatSize& spacing, CompositeOperator compositeOp, const FloatRect& dstRect, BlendMode blendMode)
 {
     std::unique_ptr<ImageBuffer> imageBuffer = ImageBuffer::create(size(), context.renderingMode());
     if (!imageBuffer)
@@ -107,7 +107,7 @@ void CrossfadeGeneratedImage::drawPattern(GraphicsContext& context, const FloatR
     drawCrossfade(graphicsContext);
 
     // Tile the image buffer into the context.
-    imageBuffer->drawPattern(context, srcRect, patternTransform, phase, spacing, styleColorSpace, compositeOp, dstRect, blendMode);
+    imageBuffer->drawPattern(context, srcRect, patternTransform, phase, spacing, compositeOp, dstRect, blendMode);
 }
 
 void CrossfadeGeneratedImage::dump(TextStream& ts) const
index 8028344..8aebbc5 100644 (file)
@@ -49,8 +49,8 @@ public:
     virtual FloatSize size() const override { return m_crossfadeSize; }
 
 protected:
-    virtual void draw(GraphicsContext&, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator, BlendMode, ImageOrientationDescription) override;
-    virtual void drawPattern(GraphicsContext&, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, const FloatSize& spacing, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& dstRect, BlendMode) override;
+    virtual void draw(GraphicsContext&, const FloatRect& dstRect, const FloatRect& srcRect, CompositeOperator, BlendMode, ImageOrientationDescription) override;
+    virtual void drawPattern(GraphicsContext&, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, const FloatSize& spacing, CompositeOperator, const FloatRect& dstRect, BlendMode) override;
 
     CrossfadeGeneratedImage(Image& fromImage, Image& toImage, float percentage, const FloatSize& crossfadeSize, const FloatSize&);
 
index b1023b0..0c038d9 100644 (file)
@@ -49,9 +49,9 @@ public:
     virtual void destroyDecodedData(bool /*destroyAll*/ = true) override { }
 
 protected:
-    virtual void draw(GraphicsContext&, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator, BlendMode, ImageOrientationDescription) override = 0;
+    virtual void draw(GraphicsContext&, const FloatRect& dstRect, const FloatRect& srcRect, CompositeOperator, BlendMode, ImageOrientationDescription) override = 0;
     virtual void drawPattern(GraphicsContext&, const FloatRect& srcRect, const AffineTransform& patternTransform,
-        const FloatPoint& phase, const FloatSize& spacing, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& destRect, BlendMode) override = 0;
+        const FloatPoint& phase, const FloatSize& spacing, CompositeOperator, const FloatRect& destRect, BlendMode) override = 0;
 
     // FIXME: Implement this to be less conservative.
     virtual bool currentFrameKnownToBeOpaque() override { return false; }
index f5ceb70..372691a 100644 (file)
@@ -44,7 +44,7 @@ GradientImage::~GradientImage()
 {
 }
 
-void GradientImage::draw(GraphicsContext& destContext, const FloatRect& destRect, const FloatRect& srcRect, ColorSpace, CompositeOperator compositeOp, BlendMode blendMode, ImageOrientationDescription)
+void GradientImage::draw(GraphicsContext& destContext, const FloatRect& destRect, const FloatRect& srcRect, CompositeOperator compositeOp, BlendMode blendMode, ImageOrientationDescription)
 {
     GraphicsContextStateSaver stateSaver(destContext);
     destContext.setCompositeOperation(compositeOp, blendMode);
@@ -57,7 +57,7 @@ void GradientImage::draw(GraphicsContext& destContext, const FloatRect& destRect
 }
 
 void GradientImage::drawPattern(GraphicsContext& destContext, const FloatRect& srcRect, const AffineTransform& patternTransform,
-    const FloatPoint& phase, const FloatSize& spacing, ColorSpace styleColorSpace, CompositeOperator compositeOp, const FloatRect& destRect, BlendMode blendMode)
+    const FloatPoint& phase, const FloatSize& spacing, CompositeOperator compositeOp, const FloatRect& destRect, BlendMode blendMode)
 {
     // Allow the generator to provide visually-equivalent tiling parameters for better performance.
     FloatSize adjustedSize = size();
@@ -92,7 +92,7 @@ void GradientImage::drawPattern(GraphicsContext& destContext, const FloatRect& s
     destContext.setDrawLuminanceMask(false);
 
     // Tile the image buffer into the context.
-    m_cachedImageBuffer->drawPattern(destContext, adjustedSrcRect, adjustedPatternCTM, phase, spacing, styleColorSpace, compositeOp, destRect, blendMode);
+    m_cachedImageBuffer->drawPattern(destContext, adjustedSrcRect, adjustedPatternCTM, phase, spacing, compositeOp, destRect, blendMode);
 }
 
 void GradientImage::dump(TextStream& ts) const
index 05828f5..92509fb 100644 (file)
@@ -46,9 +46,9 @@ public:
     virtual ~GradientImage();
 
 protected:
-    virtual void draw(GraphicsContext&, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator, BlendMode, ImageOrientationDescription) override;
+    virtual void draw(GraphicsContext&, const FloatRect& dstRect, const FloatRect& srcRect, CompositeOperator, BlendMode, ImageOrientationDescription) override;
     virtual void drawPattern(GraphicsContext&, const FloatRect& srcRect, const AffineTransform& patternTransform,
-        const FloatPoint& phase, const FloatSize& spacing, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& destRect, BlendMode) override;
+        const FloatPoint& phase, const FloatSize& spacing, CompositeOperator, const FloatRect& destRect, BlendMode) override;
 
     GradientImage(PassRefPtr<Gradient>, const FloatSize&);
 
index 9aba1b9..850a381 100644 (file)
@@ -142,20 +142,20 @@ void GraphicsContext::restore()
     restorePlatformState();
 }
 
-void GraphicsContext::drawRaisedEllipse(const FloatRect& rect, const Color& ellipseColor, ColorSpace ellipseColorSpace, const Color& shadowColor, ColorSpace shadowColorSpace)
+void GraphicsContext::drawRaisedEllipse(const FloatRect& rect, const Color& ellipseColor, const Color& shadowColor)
 {
     if (paintingDisabled())
         return;
 
     save();
 
-    setStrokeColor(shadowColor, shadowColorSpace);
-    setFillColor(shadowColor, shadowColorSpace);
+    setStrokeColor(shadowColor);
+    setFillColor(shadowColor);
 
     drawEllipse(FloatRect(rect.x(), rect.y() + 1, rect.width(), rect.height()));
 
-    setStrokeColor(ellipseColor, ellipseColorSpace);
-    setFillColor(ellipseColor, ellipseColorSpace);
+    setStrokeColor(ellipseColor);
+    setFillColor(ellipseColor);
 
     drawEllipse(rect);  
 
@@ -174,34 +174,31 @@ void GraphicsContext::setStrokeStyle(StrokeStyle style)
     setPlatformStrokeStyle(style);
 }
 
-void GraphicsContext::setStrokeColor(const Color& color, ColorSpace colorSpace)
+void GraphicsContext::setStrokeColor(const Color& color)
 {
     m_state.strokeColor = color;
-    m_state.strokeColorSpace = colorSpace;
     m_state.strokeGradient = nullptr;
     m_state.strokePattern = nullptr;
-    setPlatformStrokeColor(color, colorSpace);
+    setPlatformStrokeColor(color);
 }
 
-void GraphicsContext::setShadow(const FloatSize& offset, float blur, const Color& color, ColorSpace colorSpace)
+void GraphicsContext::setShadow(const FloatSize& offset, float blur, const Color& color)
 {
     m_state.shadowOffset = offset;
     m_state.shadowBlur = blur;
     m_state.shadowColor = color;
-    m_state.shadowColorSpace = colorSpace;
-    setPlatformShadow(offset, blur, color, colorSpace);
+    setPlatformShadow(offset, blur, color);
 }
 
-void GraphicsContext::setLegacyShadow(const FloatSize& offset, float blur, const Color& color, ColorSpace colorSpace)
+void GraphicsContext::setLegacyShadow(const FloatSize& offset, float blur, const Color& color)
 {
     m_state.shadowOffset = offset;
     m_state.shadowBlur = blur;
     m_state.shadowColor = color;
-    m_state.shadowColorSpace = colorSpace;
 #if USE(CG)
     m_state.shadowsUseLegacyRadius = true;
 #endif
-    setPlatformShadow(offset, blur, color, colorSpace);
+    setPlatformShadow(offset, blur, color);
 }
 
 void GraphicsContext::clearShadow()
@@ -209,16 +206,14 @@ void GraphicsContext::clearShadow()
     m_state.shadowOffset = FloatSize();
     m_state.shadowBlur = 0;
     m_state.shadowColor = Color();
-    m_state.shadowColorSpace = ColorSpaceDeviceRGB;
     clearPlatformShadow();
 }
 
-bool GraphicsContext::getShadow(FloatSize& offset, float& blur, Color& color, ColorSpace& colorSpace) const
+bool GraphicsContext::getShadow(FloatSize& offset, float& blur, Color& color) const
 {
     offset = m_state.shadowOffset;
     blur = m_state.shadowBlur;
     color = m_state.shadowColor;
-    colorSpace = m_state.shadowColorSpace;
 
     return hasShadow();
 }
@@ -241,13 +236,12 @@ bool GraphicsContext::mustUseShadowBlur() const
 }
 #endif
 
-void GraphicsContext::setFillColor(const Color& color, ColorSpace colorSpace)
+void GraphicsContext::setFillColor(const Color& color)
 {
     m_state.fillColor = color;
-    m_state.fillColorSpace = colorSpace;
     m_state.fillGradient = nullptr;
     m_state.fillPattern = nullptr;
-    setPlatformFillColor(color, colorSpace);
+    setPlatformFillColor(color);
 }
 
 void GraphicsContext::setShouldAntialias(bool shouldAntialias)
@@ -378,12 +372,12 @@ void GraphicsContext::drawBidiText(const FontCascade& font, const TextRun& run,
     bidiRuns.deleteRuns();
 }
 
-void GraphicsContext::drawImage(Image& image, ColorSpace colorSpace, const FloatPoint& destination, const ImagePaintingOptions& imagePaintingOptions)
+void GraphicsContext::drawImage(Image& image, const FloatPoint& destination, const ImagePaintingOptions& imagePaintingOptions)
 {
-    drawImage(image, colorSpace, FloatRect(destination, image.size()), FloatRect(FloatPoint(), image.size()), imagePaintingOptions);
+    drawImage(image, FloatRect(destination, image.size()), FloatRect(FloatPoint(), image.size()), imagePaintingOptions);
 }
 
-void GraphicsContext::drawImage(Image& image, ColorSpace colorSpace, const FloatRect& destination, const ImagePaintingOptions& imagePaintingOptions)
+void GraphicsContext::drawImage(Image& image, const FloatRect& destination, const ImagePaintingOptions& imagePaintingOptions)
 {
 #if PLATFORM(IOS)
     FloatRect srcRect(FloatPoint(), image.originalSize());
@@ -391,29 +385,29 @@ void GraphicsContext::drawImage(Image& image, ColorSpace colorSpace, const Float
     FloatRect srcRect(FloatPoint(), image.size());
 #endif
         
-    drawImage(image, colorSpace, destination, srcRect, imagePaintingOptions);
+    drawImage(image, destination, srcRect, imagePaintingOptions);
 }
 
-void GraphicsContext::drawImage(Image& image, ColorSpace colorSpace, const FloatRect& destination, const FloatRect& source, const ImagePaintingOptions& imagePaintingOptions)
+void GraphicsContext::drawImage(Image& image, const FloatRect& destination, const FloatRect& source, const ImagePaintingOptions& imagePaintingOptions)
 {
     if (paintingDisabled())
         return;
 
     // FIXME (49002): Should be InterpolationLow
     InterpolationQualityMaintainer interpolationQualityForThisScope(*this, imagePaintingOptions.m_useLowQualityScale ? InterpolationNone : imageInterpolationQuality());
-    image.draw(*this, destination, source, colorSpace, imagePaintingOptions.m_compositeOperator, imagePaintingOptions.m_blendMode, imagePaintingOptions.m_orientationDescription);
+    image.draw(*this, destination, source, imagePaintingOptions.m_compositeOperator, imagePaintingOptions.m_blendMode, imagePaintingOptions.m_orientationDescription);
 }
 
-void GraphicsContext::drawTiledImage(Image& image, ColorSpace colorSpace, const FloatRect& destination, const FloatPoint& source, const FloatSize& tileSize, const FloatSize& spacing, const ImagePaintingOptions& imagePaintingOptions)
+void GraphicsContext::drawTiledImage(Image& image, const FloatRect& destination, const FloatPoint& source, const FloatSize& tileSize, const FloatSize& spacing, const ImagePaintingOptions& imagePaintingOptions)
 {
     if (paintingDisabled())
         return;
 
     InterpolationQualityMaintainer interpolationQualityForThisScope(*this, imagePaintingOptions.m_useLowQualityScale ? InterpolationLow : imageInterpolationQuality());
-    image.drawTiled(*this, destination, source, tileSize, spacing, colorSpace, imagePaintingOptions.m_compositeOperator, imagePaintingOptions.m_blendMode);
+    image.drawTiled(*this, destination, source, tileSize, spacing, imagePaintingOptions.m_compositeOperator, imagePaintingOptions.m_blendMode);
 }
 
-void GraphicsContext::drawTiledImage(Image& image, ColorSpace colorSpace, const FloatRect& destination, const FloatRect& source, const FloatSize& tileScaleFactor,
+void GraphicsContext::drawTiledImage(Image& image, const FloatRect& destination, const FloatRect& source, const FloatSize& tileScaleFactor,
     Image::TileRule hRule, Image::TileRule vRule, const ImagePaintingOptions& imagePaintingOptions)
 {
     if (paintingDisabled())
@@ -421,32 +415,32 @@ void GraphicsContext::drawTiledImage(Image& image, ColorSpace colorSpace, const
 
     if (hRule == Image::StretchTile && vRule == Image::StretchTile) {
         // Just do a scale.
-        drawImage(image, colorSpace, destination, source, imagePaintingOptions);
+        drawImage(image, destination, source, imagePaintingOptions);
         return;
     }
 
     InterpolationQualityMaintainer interpolationQualityForThisScope(*this, imagePaintingOptions.m_useLowQualityScale ? InterpolationLow : imageInterpolationQuality());
-    image.drawTiled(*this, destination, source, tileScaleFactor, hRule, vRule, colorSpace, imagePaintingOptions.m_compositeOperator);
+    image.drawTiled(*this, destination, source, tileScaleFactor, hRule, vRule, imagePaintingOptions.m_compositeOperator);
 }
 
-void GraphicsContext::drawImageBuffer(ImageBuffer& image, ColorSpace colorSpace, const FloatPoint& destination, const ImagePaintingOptions& imagePaintingOptions)
+void GraphicsContext::drawImageBuffer(ImageBuffer& image, const FloatPoint& destination, const ImagePaintingOptions& imagePaintingOptions)
 {
-    drawImageBuffer(image, colorSpace, FloatRect(destination, image.logicalSize()), FloatRect(FloatPoint(), image.logicalSize()), imagePaintingOptions);
+    drawImageBuffer(image, FloatRect(destination, image.logicalSize()), FloatRect(FloatPoint(), image.logicalSize()), imagePaintingOptions);
 }
 
-void GraphicsContext::drawImageBuffer(ImageBuffer& image, ColorSpace colorSpace, const FloatRect& destination, const ImagePaintingOptions& imagePaintingOptions)
+void GraphicsContext::drawImageBuffer(ImageBuffer& image, const FloatRect& destination, const ImagePaintingOptions& imagePaintingOptions)
 {
-    drawImageBuffer(image, colorSpace, destination, FloatRect(FloatPoint(), FloatSize(image.logicalSize())), imagePaintingOptions);
+    drawImageBuffer(image, destination, FloatRect(FloatPoint(), FloatSize(image.logicalSize())), imagePaintingOptions);
 }
 
-void GraphicsContext::drawImageBuffer(ImageBuffer& image, ColorSpace colorSpace, const FloatRect& destination, const FloatRect& source, const ImagePaintingOptions& imagePaintingOptions)
+void GraphicsContext::drawImageBuffer(ImageBuffer& image, const FloatRect& destination, const FloatRect& source, const ImagePaintingOptions& imagePaintingOptions)
 {
     if (paintingDisabled())
         return;
 
     // FIXME (49002): Should be InterpolationLow
     InterpolationQualityMaintainer interpolationQualityForThisScope(*this, imagePaintingOptions.m_useLowQualityScale ? InterpolationNone : imageInterpolationQuality());
-    image.draw(*this, colorSpace, destination, source, imagePaintingOptions.m_compositeOperator, imagePaintingOptions.m_blendMode, imagePaintingOptions.m_useLowQualityScale);
+    image.draw(*this, destination, source, imagePaintingOptions.m_compositeOperator, imagePaintingOptions.m_blendMode, imagePaintingOptions.m_useLowQualityScale);
 }
 
 void GraphicsContext::clip(const IntRect& rect)
@@ -509,29 +503,29 @@ void GraphicsContext::fillRect(const FloatRect& rect, Gradient& gradient)
     gradient.fill(this, rect);
 }
 
-void GraphicsContext::fillRect(const FloatRect& rect, const Color& color, ColorSpace styleColorSpace, CompositeOperator op, BlendMode blendMode)
+void GraphicsContext::fillRect(const FloatRect& rect, const Color& color, CompositeOperator op, BlendMode blendMode)
 {
     if (paintingDisabled())
         return;
 
     CompositeOperator previousOperator = compositeOperation();
     setCompositeOperation(op, blendMode);
-    fillRect(rect, color, styleColorSpace);
+    fillRect(rect, color);
     setCompositeOperation(previousOperator);
 }
 
-void GraphicsContext::fillRoundedRect(const FloatRoundedRect& rect, const Color& color, ColorSpace colorSpace, BlendMode blendMode)
+void GraphicsContext::fillRoundedRect(const FloatRoundedRect& rect, const Color& color, BlendMode blendMode)
 {
     if (rect.isRounded()) {
         setCompositeOperation(compositeOperation(), blendMode);
-        platformFillRoundedRect(rect, color, colorSpace);
+        platformFillRoundedRect(rect, color);
         setCompositeOperation(compositeOperation());
     } else
-        fillRect(rect.rect(), color, colorSpace, compositeOperation(), blendMode);
+        fillRect(rect.rect(), color, compositeOperation(), blendMode);
 }
 
 #if !USE(CG) && !USE(CAIRO)
-void GraphicsContext::fillRectWithRoundedHole(const IntRect& rect, const FloatRoundedRect& roundedHoleRect, const Color& color, ColorSpace colorSpace)
+void GraphicsContext::fillRectWithRoundedHole(const IntRect& rect, const FloatRoundedRect& roundedHoleRect, const Color& color)
 {
     if (paintingDisabled())
         return;
@@ -546,15 +540,14 @@ void GraphicsContext::fillRectWithRoundedHole(const IntRect& rect, const FloatRo
 
     WindRule oldFillRule = fillRule();
     Color oldFillColor = fillColor();
-    ColorSpace oldFillColorSpace = fillColorSpace();
     
     setFillRule(RULE_EVENODD);
-    setFillColor(color, colorSpace);
+    setFillColor(color);
 
     fillPath(path);
     
     setFillRule(oldFillRule);
-    setFillColor(oldFillColor, oldFillColorSpace);
+    setFillColor(oldFillColor);
 }
 #endif
 
index b9dc023..be20a73 100644 (file)
@@ -27,7 +27,6 @@
 #ifndef GraphicsContext_h
 #define GraphicsContext_h
 
-#include "ColorSpace.h"
 #include "DashArray.h"
 #include "FloatRect.h"
 #include "FontCascade.h"
@@ -148,10 +147,6 @@ struct GraphicsContextState {
     StrokeStyle strokeStyle { SolidStroke };
     WindRule fillRule { RULE_NONZERO };
 
-    ColorSpace strokeColorSpace { ColorSpaceDeviceRGB };
-    ColorSpace fillColorSpace { ColorSpaceDeviceRGB };
-    ColorSpace shadowColorSpace { ColorSpaceDeviceRGB };
-
     float alpha { 1 };
     CompositeOperator compositeOperator { CompositeSourceOver };
     BlendMode blendMode { BlendModeNormal };
@@ -214,9 +209,8 @@ public:
     void setStrokeStyle(StrokeStyle);
     StrokeStyle strokeStyle() const { return m_state.strokeStyle; }
 
-    WEBCORE_EXPORT void setStrokeColor(const Color&, ColorSpace);
+    WEBCORE_EXPORT void setStrokeColor(const Color&);
     Color strokeColor() const { return m_state.strokeColor; }
-    ColorSpace strokeColorSpace() const { return m_state.strokeColorSpace; }
 
     void setStrokePattern(Ref<Pattern>&&);
     Pattern* strokePattern() const { return m_state.strokePattern.get(); }
@@ -227,9 +221,8 @@ public:
     void setFillRule(WindRule fillRule) { m_state.fillRule = fillRule; }
     WindRule fillRule() const { return m_state.fillRule; }
 
-    WEBCORE_EXPORT void setFillColor(const Color&, ColorSpace);
+    WEBCORE_EXPORT void setFillColor(const Color&);
     Color fillColor() const { return m_state.fillColor; }
-    ColorSpace fillColorSpace() const { return m_state.fillColorSpace; }
 
     void setFillPattern(Ref<Pattern>&&);
     Pattern* fillPattern() const { return m_state.fillPattern.get(); }
@@ -261,7 +254,7 @@ public:
     void applyFillPattern();
     void drawPath(const Path&);
 
-    WEBCORE_EXPORT void drawNativeImage(PassNativeImagePtr, const FloatSize& selfSize, ColorSpace styleColorSpace, const FloatRect& destRect, const FloatRect& srcRect, CompositeOperator = CompositeSourceOver, BlendMode = BlendModeNormal, ImageOrientation = DefaultImageOrientation);
+    WEBCORE_EXPORT void drawNativeImage(PassNativeImagePtr, const FloatSize& selfSize, const FloatRect& destRect, const FloatRect& srcRect, CompositeOperator = CompositeSourceOver, BlendMode = BlendModeNormal, ImageOrientation = DefaultImageOrientation);
 
     void clipToNativeImage(PassNativeImagePtr, const FloatRect& destRect, const FloatSize& bufferSize);
     
@@ -288,7 +281,7 @@ public:
 #endif
 
     void drawEllipse(const FloatRect&);
-    void drawRaisedEllipse(const FloatRect&, const Color& ellipseColor, ColorSpace ellipseColorSpace, const Color& shadowColor, ColorSpace shadowColorSpace);
+    void drawRaisedEllipse(const FloatRect&, const Color& ellipseColor, const Color& shadowColor);
     void drawConvexPolygon(size_t numPoints, const FloatPoint*, bool shouldAntialias = false);
 
     WEBCORE_EXPORT void fillPath(const Path&);
@@ -298,29 +291,29 @@ public:
     void strokeEllipse(const FloatRect&);
 
     WEBCORE_EXPORT void fillRect(const FloatRect&);
-    WEBCORE_EXPORT void fillRect(const FloatRect&, const Color&, ColorSpace);
+    WEBCORE_EXPORT void fillRect(const FloatRect&, const Color&);
     void fillRect(const FloatRect&, Gradient&);
-    void fillRect(const FloatRect&, const Color&, ColorSpace, CompositeOperator, BlendMode = BlendModeNormal);
-    void fillRoundedRect(const FloatRoundedRect&, const Color&, ColorSpace, BlendMode = BlendModeNormal);
-    void fillRectWithRoundedHole(const FloatRect&, const FloatRoundedRect& roundedHoleRect, const Color&, ColorSpace);
+    void fillRect(const FloatRect&, const Color&, CompositeOperator, BlendMode = BlendModeNormal);
+    void fillRoundedRect(const FloatRoundedRect&, const Color&, BlendMode = BlendModeNormal);
+    void fillRectWithRoundedHole(const FloatRect&, const FloatRoundedRect& roundedHoleRect, const Color&);
 
     WEBCORE_EXPORT void clearRect(const FloatRect&);
 
     WEBCORE_EXPORT void strokeRect(const FloatRect&, float lineWidth);
 
-    WEBCORE_EXPORT void drawImage(Image&, ColorSpace, const FloatPoint& destination, const ImagePaintingOptions& = ImagePaintingOptions());
-    WEBCORE_EXPORT void drawImage(Image&, ColorSpace, const FloatRect& destination, const ImagePaintingOptions& = ImagePaintingOptions());
-    void drawImage(Image&, ColorSpace, const FloatRect& destination, const FloatRect& source, const ImagePaintingOptions& = ImagePaintingOptions());
+    WEBCORE_EXPORT void drawImage(Image&, const FloatPoint& destination, const ImagePaintingOptions& = ImagePaintingOptions());
+    WEBCORE_EXPORT void drawImage(Image&, const FloatRect& destination, const ImagePaintingOptions& = ImagePaintingOptions());
+    void drawImage(Image&, const FloatRect& destination, const FloatRect& source, const ImagePaintingOptions& = ImagePaintingOptions());
 
-    void drawTiledImage(Image&, ColorSpace, const FloatRect& destination, const FloatPoint& source, const FloatSize& tileSize, const FloatSize& spacing, const ImagePaintingOptions& = ImagePaintingOptions());
-    void drawTiledImage(Image&, ColorSpace, const FloatRect& destination, const FloatRect& source, const FloatSize& tileScaleFactor,
+    void drawTiledImage(Image&, const FloatRect& destination, const FloatPoint& source, const FloatSize& tileSize, const FloatSize& spacing, const ImagePaintingOptions& = ImagePaintingOptions());
+    void drawTiledImage(Image&, const FloatRect& destination, const FloatRect& source, const FloatSize& tileScaleFactor,
         Image::TileRule, Image::TileRule, const ImagePaintingOptions& = ImagePaintingOptions());
 
-    WEBCORE_EXPORT void drawImageBuffer(ImageBuffer&, ColorSpace, const FloatPoint& destination, const ImagePaintingOptions& = ImagePaintingOptions());
-    void drawImageBuffer(ImageBuffer&, ColorSpace, const FloatRect& destination, const ImagePaintingOptions& = ImagePaintingOptions());
-    void drawImageBuffer(ImageBuffer&, ColorSpace, const FloatRect& destination, const FloatRect& source, const ImagePaintingOptions& = ImagePaintingOptions());
+    WEBCORE_EXPORT void drawImageBuffer(ImageBuffer&, const FloatPoint& destination, const ImagePaintingOptions& = ImagePaintingOptions());
+    void drawImageBuffer(ImageBuffer&, const FloatRect& destination, const ImagePaintingOptions& = ImagePaintingOptions());
+    void drawImageBuffer(ImageBuffer&, const FloatRect& destination, const FloatRect& source, const ImagePaintingOptions& = ImagePaintingOptions());
 
-    void drawPattern(Image&, const FloatRect& srcRect, const AffineTransform&, const FloatPoint& phase, const FloatSize& spacing, ColorSpace, CompositeOperator, const FloatRect& destRect, BlendMode = BlendModeNormal);
+    void drawPattern(Image&, const FloatRect& srcRect, const AffineTransform&, const FloatPoint& phase, const FloatSize& spacing, CompositeOperator, const FloatRect& destRect, BlendMode = BlendModeNormal);
 
     WEBCORE_EXPORT void setImageInterpolationQuality(InterpolationQuality);
     InterpolationQuality imageInterpolationQuality() const { return m_state.imageInterpolationQuality; }
@@ -376,13 +369,13 @@ public:
     WEBCORE_EXPORT void endTransparencyLayer();
     bool isInTransparencyLayer() const { return (m_transparencyCount > 0) && supportsTransparencyLayers(); }
 
-    WEBCORE_EXPORT void setShadow(const FloatSize&, float blur, const Color&, ColorSpace);
+    WEBCORE_EXPORT void setShadow(const FloatSize&, float blur, const Color&);
     // Legacy shadow blur radius is used for canvas, and -webkit-box-shadow.
     // It has different treatment of radii > 8px.
-    void setLegacyShadow(const FloatSize&, float blur, const Color&, ColorSpace);
+    void setLegacyShadow(const FloatSize&, float blur, const Color&);
 
     WEBCORE_EXPORT void clearShadow();
-    bool getShadow(FloatSize&, float&, Color&, ColorSpace&) const;
+    bool getShadow(FloatSize&, float&, Color&) const;
 
     bool hasVisibleShadow() const { return m_state.shadowColor.isValid() && m_state.shadowColor.alpha(); }
     bool hasShadow() const { return hasVisibleShadow() && (m_state.shadowBlur || m_state.shadowOffset.width() || m_state.shadowOffset.height()); }
@@ -463,8 +456,8 @@ public:
     void drawFrameControl(const IntRect& rect, unsigned type, unsigned state);
     void drawFocusRect(const IntRect& rect);
     void paintTextField(const IntRect& rect, unsigned state);
-    void drawBitmap(SharedBitmap*, const IntRect& dstRect, const IntRect& srcRect, ColorSpace styleColorSpace, CompositeOperator compositeOp, BlendMode blendMode);
-    void drawBitmapPattern(SharedBitmap*, const FloatRect& tileRectIn, const AffineTransform& patternTransform, const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator op, const FloatRect& destRect, const IntSize& origSourceSize);
+    void drawBitmap(SharedBitmap*, const IntRect& dstRect, const IntRect& srcRect, CompositeOperator, BlendMode);
+    void drawBitmapPattern(SharedBitmap*, const FloatRect& tileRectIn, const AffineTransform& patternTransform, const FloatPoint& phase, CompositeOperator, const FloatRect& destRect, const IntSize& origSourceSize);
     void drawIcon(HICON icon, const IntRect& dstRect, UINT flags);
     void drawRoundCorner(bool newClip, RECT clipRect, RECT rectWin, HDC dc, int width, int height);
 #else
@@ -529,17 +522,17 @@ private:
 
     void setPlatformTextDrawingMode(TextDrawingModeFlags);
 
-    void setPlatformStrokeColor(const Color&, ColorSpace);
+    void setPlatformStrokeColor(const Color&);
     void setPlatformStrokeStyle(StrokeStyle);
     void setPlatformStrokeThickness(float);
 
-    void setPlatformFillColor(const Color&, ColorSpace);
+    void setPlatformFillColor(const Color&);
 
     void setPlatformShouldAntialias(bool);
     void setPlatformShouldSmoothFonts(bool);
     void setPlatformImageInterpolationQuality(InterpolationQuality);
 
-    void setPlatformShadow(const FloatSize&, float blur, const Color&, ColorSpace);
+    void setPlatformShadow(const FloatSize&, float blur, const Color&);
     void clearPlatformShadow();
 
     void setPlatformAlpha(float);
@@ -555,7 +548,7 @@ private:
     void platformFillEllipse(const FloatRect&);
     void platformStrokeEllipse(const FloatRect&);
 
-    void platformFillRoundedRect(const FloatRoundedRect&, const Color&, ColorSpace);
+    void platformFillRoundedRect(const FloatRoundedRect&, const Color&);
 
     FloatRect computeLineBoundsAndAntialiasingModeForText(const FloatPoint&, float width, bool printing, bool& shouldAntialias, Color&);
 
index 4e3d615..81fbb0f 100644 (file)
@@ -79,21 +79,21 @@ bool Image::setData(PassRefPtr<SharedBuffer> data, bool allDataReceived)
     return dataChanged(allDataReceived);
 }
 
-void Image::fillWithSolidColor(GraphicsContext& ctxt, const FloatRect& dstRect, const Color& color, ColorSpace styleColorSpace, CompositeOperator op)
+void Image::fillWithSolidColor(GraphicsContext& ctxt, const FloatRect& dstRect, const Color& color, CompositeOperator op)
 {
     if (!color.alpha())
         return;
     
     CompositeOperator previousOperator = ctxt.compositeOperation();
     ctxt.setCompositeOperation(!color.hasAlpha() && op == CompositeSourceOver ? CompositeCopy : op);
-    ctxt.fillRect(dstRect, color, styleColorSpace);
+    ctxt.fillRect(dstRect, color);
     ctxt.setCompositeOperation(previousOperator);
 }
 
-void Image::drawTiled(GraphicsContext& ctxt, const FloatRect& destRect, const FloatPoint& srcPoint, const FloatSize& scaledTileSize, const FloatSize& spacing, ColorSpace styleColorSpace, CompositeOperator op, BlendMode blendMode)
+void Image::drawTiled(GraphicsContext& ctxt, const FloatRect& destRect, const FloatPoint& srcPoint, const FloatSize& scaledTileSize, const FloatSize& spacing, CompositeOperator op, BlendMode blendMode)
 {    
     if (mayFillWithSolidColor()) {
-        fillWithSolidColor(ctxt, destRect, solidColor(), styleColorSpace, op);
+        fillWithSolidColor(ctxt, destRect, solidColor(), op);
         return;
     }
 
@@ -125,7 +125,7 @@ void Image::drawTiled(GraphicsContext& ctxt, const FloatRect& destRect, const Fl
         visibleSrcRect.setY((destRect.y() - oneTileRect.y()) / scale.height());
         visibleSrcRect.setWidth(destRect.width() / scale.width());
         visibleSrcRect.setHeight(destRect.height() / scale.height());
-        draw(ctxt, destRect, visibleSrcRect, styleColorSpace, op, blendMode, ImageOrientationDescription());
+        draw(ctxt, destRect, visibleSrcRect, op, blendMode, ImageOrientationDescription());
         return;
     }
 
@@ -138,7 +138,7 @@ void Image::drawTiled(GraphicsContext& ctxt, const FloatRect& destRect, const Fl
             visibleSrcRect.setY((destRect.y() - oneTileRect.y()) / scale.height());
             visibleSrcRect.setWidth(1);
             visibleSrcRect.setHeight(destRect.height() / scale.height());
-            draw(ctxt, destRect, visibleSrcRect, styleColorSpace, op, BlendModeNormal, ImageOrientationDescription());
+            draw(ctxt, destRect, visibleSrcRect, op, BlendModeNormal, ImageOrientationDescription());
             return;
         }
         if (size().height() == 1 && intersection(oneTileRect, destRect).width() == destRect.width()) {
@@ -147,7 +147,7 @@ void Image::drawTiled(GraphicsContext& ctxt, const FloatRect& destRect, const Fl
             visibleSrcRect.setY(0);
             visibleSrcRect.setWidth(destRect.width() / scale.width());
             visibleSrcRect.setHeight(1);
-            draw(ctxt, destRect, visibleSrcRect, styleColorSpace, op, BlendModeNormal, ImageOrientationDescription());
+            draw(ctxt, destRect, visibleSrcRect, op, BlendModeNormal, ImageOrientationDescription());
             return;
         }
     }
@@ -179,7 +179,7 @@ void Image::drawTiled(GraphicsContext& ctxt, const FloatRect& destRect, const Fl
                 FloatRect fromRect(toFloatPoint(currentTileRect.location() - oneTileRect.location()), currentTileRect.size());
                 fromRect.scale(1 / scale.width(), 1 / scale.height());
 
-                draw(ctxt, toRect, fromRect, styleColorSpace, op, BlendModeNormal, ImageOrientationDescription());
+                draw(ctxt, toRect, fromRect, op, BlendModeNormal, ImageOrientationDescription());
                 toX += currentTileRect.width();
                 currentTileRect.shiftXEdgeTo(oneTileRect.x());
             }
@@ -191,7 +191,7 @@ void Image::drawTiled(GraphicsContext& ctxt, const FloatRect& destRect, const Fl
 
     AffineTransform patternTransform = AffineTransform().scaleNonUniform(scale.width(), scale.height());
     FloatRect tileRect(FloatPoint(), intrinsicTileSize);
-    drawPattern(ctxt, tileRect, patternTransform, oneTileRect.location(), spacing, styleColorSpace, op, destRect, blendMode);
+    drawPattern(ctxt, tileRect, patternTransform, oneTileRect.location(), spacing, op, destRect, blendMode);
 
 #if PLATFORM(IOS)
     startAnimation(DoNotCatchUp);
@@ -202,10 +202,10 @@ void Image::drawTiled(GraphicsContext& ctxt, const FloatRect& destRect, const Fl
 
 // FIXME: Merge with the other drawTiled eventually, since we need a combination of both for some things.
 void Image::drawTiled(GraphicsContext& ctxt, const FloatRect& dstRect, const FloatRect& srcRect,
-    const FloatSize& tileScaleFactor, TileRule hRule, TileRule vRule, ColorSpace styleColorSpace, CompositeOperator op)
+    const FloatSize& tileScaleFactor, TileRule hRule, TileRule vRule, CompositeOperator op)
 {    
     if (mayFillWithSolidColor()) {
-        fillWithSolidColor(ctxt, dstRect, solidColor(), styleColorSpace, op);
+        fillWithSolidColor(ctxt, dstRect, solidColor(), op);
         return;
     }
     
@@ -275,7 +275,7 @@ void Image::drawTiled(GraphicsContext& ctxt, const FloatRect& dstRect, const Flo
         vPhase -= (dstRect.height() - scaledTileHeight) / 2;
 
     FloatPoint patternPhase(dstRect.x() - hPhase, dstRect.y() - vPhase);
-    drawPattern(ctxt, srcRect, patternTransform, patternPhase, spacing, styleColorSpace, op, dstRect);
+    drawPattern(ctxt, srcRect, patternTransform, patternPhase, spacing, op, dstRect);
 
 #if PLATFORM(IOS)
     startAnimation(DoNotCatchUp);
index a5b1e4a..47379b3 100644 (file)
@@ -28,7 +28,6 @@
 #define Image_h
 
 #include "Color.h"
-#include "ColorSpace.h"
 #include "FloatRect.h"
 #include "FloatSize.h"
 #include "GraphicsTypes.h"
@@ -154,7 +153,6 @@ public:
     virtual CGImageRef getCGImageRef() { return 0; }
     virtual CGImageRef getFirstCGImageRefOfSize(const IntSize&) { return 0; }
     virtual RetainPtr<CFArrayRef> getCGImageArray() { return 0; }
-    static RetainPtr<CGImageRef> imageWithColorSpace(CGImageRef originalImage, ColorSpace);
 #endif
 
 #if PLATFORM(WIN)
@@ -171,7 +169,7 @@ public:
 #endif
 
     virtual void drawPattern(GraphicsContext&, const FloatRect& srcRect, const AffineTransform& patternTransform,
-        const FloatPoint& phase, const FloatSize& spacing, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& destRect, BlendMode = BlendModeNormal);
+        const FloatPoint& phase, const FloatSize& spacing, CompositeOperator, const FloatRect& destRect, BlendMode = BlendModeNormal);
 
 #if ENABLE(IMAGE_DECODER_DOWN_SAMPLING)
     FloatRect adjustSourceRectForDownSampling(const FloatRect& srcRect, const IntSize& scaledSize) const;
@@ -186,16 +184,14 @@ public:
 protected:
     Image(ImageObserver* = nullptr);
 
-    static void fillWithSolidColor(GraphicsContext&, const FloatRect& dstRect, const Color&, ColorSpace styleColorSpace, CompositeOperator);
+    static void fillWithSolidColor(GraphicsContext&, const FloatRect& dstRect, const Color&, CompositeOperator);
 
-    // The ColorSpace parameter will only be used for untagged images.
 #if PLATFORM(WIN)
-    virtual void drawFrameMatchingSourceSize(GraphicsContext&, const FloatRect& dstRect, const IntSize& srcSize, ColorSpace styleColorSpace, CompositeOperator) { }
+    virtual void drawFrameMatchingSourceSize(GraphicsContext&, const FloatRect& dstRect, const IntSize& srcSize, CompositeOperator) { }
 #endif
-    virtual void draw(GraphicsContext&, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator, BlendMode, ImageOrientationDescription) = 0;
-    void drawTiled(GraphicsContext&, const FloatRect& dstRect, const FloatPoint& srcPoint, const FloatSize& tileSize, const FloatSize& spacing, ColorSpace styleColorSpace,
-        CompositeOperator , BlendMode);
-    void drawTiled(GraphicsContext&, const FloatRect& dstRect, const FloatRect& srcRect, const FloatSize& tileScaleFactor, TileRule hRule, TileRule vRule, ColorSpace styleColorSpace, CompositeOperator);
+    virtual void draw(GraphicsContext&, const FloatRect& dstRect, const FloatRect& srcRect, CompositeOperator, BlendMode, ImageOrientationDescription) = 0;
+    void drawTiled(GraphicsContext&, const FloatRect& dstRect, const FloatPoint& srcPoint, const FloatSize& tileSize, const FloatSize& spacing, CompositeOperator, BlendMode);
+    void drawTiled(GraphicsContext&, const FloatRect& dstRect, const FloatRect& srcRect, const FloatSize& tileScaleFactor, TileRule hRule, TileRule vRule, CompositeOperator);
 
     // Supporting tiled drawing
     virtual bool mayFillWithSolidColor() { return false; }
index 758a9ea..7d58f00 100644 (file)
@@ -134,8 +134,8 @@ private:
 #endif
     void clip(GraphicsContext&, const FloatRect&) const;
 
-    void draw(GraphicsContext&, ColorSpace, const FloatRect& destRect, const FloatRect& srcRect = FloatRect(0, 0, -1, -1), CompositeOperator = CompositeSourceOver, BlendMode = BlendModeNormal, bool useLowQualityScale = false);
-    void drawPattern(GraphicsContext&, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, const FloatSize& spacing, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& destRect, BlendMode = BlendModeNormal);
+    void draw(GraphicsContext&, const FloatRect& destRect, const FloatRect& srcRect = FloatRect(0, 0, -1, -1), CompositeOperator = CompositeSourceOver, BlendMode = BlendModeNormal, bool useLowQualityScale = false);
+    void drawPattern(GraphicsContext&, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, const FloatSize& spacing, CompositeOperator, const FloatRect& destRect, BlendMode = BlendModeNormal);
 
     inline void genericConvertToLuminanceMask();
 
index d0bad30..a0f6434 100644 (file)
@@ -40,7 +40,7 @@ NamedImageGeneratedImage::NamedImageGeneratedImage(String name, const FloatSize&
     setContainerSize(size);
 }
 
-void NamedImageGeneratedImage::draw(GraphicsContext& context, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace, CompositeOperator compositeOp, BlendMode blendMode, ImageOrientationDescription)
+void NamedImageGeneratedImage::draw(GraphicsContext& context, const FloatRect& dstRect, const FloatRect& srcRect, CompositeOperator compositeOp, BlendMode blendMode, ImageOrientationDescription)
 {
 #if USE(NEW_THEME)
     GraphicsContextStateSaver stateSaver(context);
@@ -61,7 +61,7 @@ void NamedImageGeneratedImage::draw(GraphicsContext& context, const FloatRect& d
 #endif
 }
 
-void NamedImageGeneratedImage::drawPattern(GraphicsContext& context, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, const FloatSize& spacing, ColorSpace styleColorSpace, CompositeOperator compositeOp, const FloatRect& dstRect, BlendMode blendMode)
+void NamedImageGeneratedImage::drawPattern(GraphicsContext& context, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, const FloatSize& spacing, CompositeOperator compositeOp, const FloatRect& dstRect, BlendMode blendMode)
 {
 #if USE(NEW_THEME)
     std::unique_ptr<ImageBuffer> imageBuffer = context.createCompatibleBuffer(size(), true);
@@ -72,14 +72,13 @@ void NamedImageGeneratedImage::drawPattern(GraphicsContext& context, const Float
     platformTheme()->drawNamedImage(m_name, graphicsContext, FloatRect(0, 0, size().width(), size().height()));
 
     // Tile the image buffer into the context.
-    imageBuffer->drawPattern(context, srcRect, patternTransform, phase, spacing, styleColorSpace, compositeOp, dstRect, blendMode);
+    imageBuffer->drawPattern(context, srcRect, patternTransform, phase, spacing, compositeOp, dstRect, blendMode);
 #else
     UNUSED_PARAM(context);
     UNUSED_PARAM(srcRect);
     UNUSED_PARAM(patternTransform);
     UNUSED_PARAM(phase);
     UNUSED_PARAM(spacing);
-    UNUSED_PARAM(styleColorSpace);
     UNUSED_PARAM(dstRect);
     UNUSED_PARAM(compositeOp);
     UNUSED_PARAM(blendMode);
index 6f4ecd9..d9f0ac1 100644 (file)
@@ -41,8 +41,8 @@ public:
     }
 
 protected:
-    virtual void draw(GraphicsContext&, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator, BlendMode, ImageOrientationDescription) override;
-    virtual void drawPattern(GraphicsContext&, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, const FloatSize& spacing, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& dstRect, BlendMode) override;
+    virtual void draw(GraphicsContext&, const FloatRect& dstRect, const FloatRect& srcRect, CompositeOperator, BlendMode, ImageOrientationDescription) override;
+    virtual void drawPattern(GraphicsContext&, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, const FloatSize& spacing, CompositeOperator, const FloatRect& dstRect, BlendMode) override;
 
     NamedImageGeneratedImage(String name, const FloatSize&);
 
index 85aeeef..8acbda2 100644 (file)
@@ -85,15 +85,14 @@ public:
         return m_imageBuffer.get();
     }
 
-    bool setCachedShadowValues(const FloatSize& radius, const Color& color, ColorSpace colorSpace, const FloatRect& shadowRect, const FloatRoundedRect::Radii& radii, const FloatSize& layerSize)
+    bool setCachedShadowValues(const FloatSize& radius, const Color& color, const FloatRect& shadowRect, const FloatRoundedRect::Radii& radii, const FloatSize& layerSize)
     {
-        if (!m_lastWasInset && m_lastRadius == radius && m_lastColor == color && m_lastColorSpace == colorSpace && m_lastShadowRect == shadowRect &&  m_lastRadii == radii && m_lastLayerSize == layerSize)
+        if (!m_lastWasInset && m_lastRadius == radius && m_lastColor == color && m_lastShadowRect == shadowRect &&  m_lastRadii == radii && m_lastLayerSize == layerSize)
             return false;
 
         m_lastWasInset = false;
         m_lastRadius = radius;
         m_lastColor = color;
-        m_lastColorSpace = colorSpace;
         m_lastShadowRect = shadowRect;
         m_lastRadii = radii;
         m_lastLayerSize = layerSize;
@@ -101,16 +100,15 @@ public:
         return true;
     }
 
-    bool setCachedInsetShadowValues(const FloatSize& radius, const Color& color, ColorSpace colorSpace, const FloatRect& bounds, const FloatRect& shadowRect, const FloatRoundedRect::Radii& radii)
+    bool setCachedInsetShadowValues(const FloatSize& radius, const Color& color, const FloatRect& bounds, const FloatRect& shadowRect, const FloatRoundedRect::Radii& radii)
     {
-        if (m_lastWasInset && m_lastRadius == radius && m_lastColor == color && m_lastColorSpace == colorSpace && m_lastInsetBounds == bounds && shadowRect == m_lastShadowRect && radii == m_lastRadii)
+        if (m_lastWasInset && m_lastRadius == radius && m_lastColor == color && m_lastInsetBounds == bounds && shadowRect == m_lastShadowRect && radii == m_lastRadii)
             return false;
 
         m_lastWasInset = true;
         m_lastInsetBounds = bounds;
         m_lastRadius = radius;
         m_lastColor = color;
-        m_lastColorSpace = colorSpace;
         m_lastShadowRect = shadowRect;
         m_lastRadii = radii;
 
@@ -146,7 +144,6 @@ private:
     FloatRect m_lastShadowRect;
     FloatRoundedRect::Radii m_lastRadii;
     Color m_lastColor;
-    ColorSpace m_lastColorSpace;
     FloatSize m_lastRadius;
     bool m_lastWasInset;
     FloatSize m_lastLayerSize;
@@ -171,9 +168,8 @@ static float radiusToLegacyRadius(float radius)
 }
 #endif
 
-ShadowBlur::ShadowBlur(const FloatSize& radius, const FloatSize& offset, const Color& color, ColorSpace colorSpace)
+ShadowBlur::ShadowBlur(const FloatSize& radius, const FloatSize& offset, const Color& color)
     : m_color(color)
-    , m_colorSpace(colorSpace)
     , m_blurRadius(radius)
     , m_offset(offset)
     , m_layerImage(0)
@@ -184,7 +180,6 @@ ShadowBlur::ShadowBlur(const FloatSize& radius, const FloatSize& offset, const C
 
 ShadowBlur::ShadowBlur(const GraphicsContextState& state)
     : m_color(state.shadowColor)
-    , m_colorSpace(state.shadowColorSpace)
     , m_blurRadius(state.shadowBlur, state.shadowBlur)
     , m_offset(state.shadowOffset)
     , m_layerImage(0)
@@ -206,12 +201,11 @@ ShadowBlur::ShadowBlur()
 {
 }
 
-void ShadowBlur::setShadowValues(const FloatSize& radius, const FloatSize& offset, const Color& color, ColorSpace colorSpace, bool ignoreTransforms)
+void ShadowBlur::setShadowValues(const FloatSize& radius, const FloatSize& offset, const Color& color, bool ignoreTransforms)
 {
     m_blurRadius = radius;
     m_offset = offset;
     m_color = color;
-    m_colorSpace = colorSpace;
     m_shadowsIgnoreTransforms = ignoreTransforms;
 
     updateShadowBlurValues();
@@ -473,7 +467,7 @@ void ShadowBlur::drawShadowBuffer(GraphicsContext& graphicsContext)
         graphicsContext.clip(FloatRect(m_layerOrigin, m_layerSize));
     }
     graphicsContext.clipToImageBuffer(*m_layerImage, FloatRect(m_layerOrigin, bufferSize));
-    graphicsContext.setFillColor(m_color, m_colorSpace);
+    graphicsContext.setFillColor(m_color);
 
     graphicsContext.clearShadow();
     graphicsContext.fillRect(FloatRect(m_layerOrigin, m_sourceRect.size()));
@@ -572,7 +566,7 @@ void ShadowBlur::drawRectShadowWithoutTiling(GraphicsContext& graphicsContext, c
     bufferRelativeShadowedRect.move(m_layerContextTranslation);
 
     // Only redraw in the scratch buffer if its cached contents don't match our needs
-    bool redrawNeeded = ScratchBuffer::singleton().setCachedShadowValues(m_blurRadius, Color::black, ColorSpaceDeviceRGB, bufferRelativeShadowedRect, shadowedRect.radii(), m_layerSize);
+    bool redrawNeeded = ScratchBuffer::singleton().setCachedShadowValues(m_blurRadius, Color::black, bufferRelativeShadowedRect, shadowedRect.radii(), m_layerSize);
     if (redrawNeeded) {
         GraphicsContext& shadowContext = m_layerImage->context();
         GraphicsContextStateSaver stateSaver(shadowContext);
@@ -580,7 +574,7 @@ void ShadowBlur::drawRectShadowWithoutTiling(GraphicsContext& graphicsContext, c
         // Add a pixel to avoid later edge aliasing when rotated.
         shadowContext.clearRect(FloatRect(0, 0, m_layerSize.width() + 1, m_layerSize.height() + 1));
         shadowContext.translate(m_layerContextTranslation);
-        shadowContext.setFillColor(Color::black, ColorSpaceDeviceRGB);
+        shadowContext.setFillColor(Color::black);
         if (shadowedRect.radii().isZero())
             shadowContext.fillRect(shadowedRect.rect());
         else {
@@ -610,7 +604,7 @@ void ShadowBlur::drawInsetShadowWithoutTiling(GraphicsContext& graphicsContext,
     bufferRelativeHoleRect.move(m_layerContextTranslation);
 
     // Only redraw in the scratch buffer if its cached contents don't match our needs
-    bool redrawNeeded = ScratchBuffer::singleton().setCachedInsetShadowValues(m_blurRadius, Color::black, ColorSpaceDeviceRGB, bufferRelativeRect, bufferRelativeHoleRect, holeRect.radii());
+    bool redrawNeeded = ScratchBuffer::singleton().setCachedInsetShadowValues(m_blurRadius, Color::black, bufferRelativeRect, bufferRelativeHoleRect, holeRect.radii());
     if (redrawNeeded) {
         GraphicsContext& shadowContext = m_layerImage->context();
         GraphicsContextStateSaver stateSaver(shadowContext);
@@ -627,7 +621,7 @@ void ShadowBlur::drawInsetShadowWithoutTiling(GraphicsContext& graphicsContext,
             path.addRoundedRect(holeRect);
 
         shadowContext.setFillRule(RULE_EVENODD);
-        shadowContext.setFillColor(Color::black, ColorSpaceDeviceRGB);
+        shadowContext.setFillColor(Color::black);
         shadowContext.fillPath(path);
 
         blurShadowBuffer(expandedIntSize(m_layerSize));
@@ -681,14 +675,14 @@ void ShadowBlur::drawInsetShadowWithTiling(GraphicsContext& graphicsContext, con
     FloatRect templateHole = FloatRect(edgeSize.width(), edgeSize.height(), templateSize.width() - 2 * edgeSize.width(), templateSize.height() - 2 * edgeSize.height());
 
     // Only redraw in the scratch buffer if its cached contents don't match our needs
-    bool redrawNeeded = ScratchBuffer::singleton().setCachedInsetShadowValues(m_blurRadius, m_color, m_colorSpace, templateBounds, templateHole, holeRect.radii());
+    bool redrawNeeded = ScratchBuffer::singleton().setCachedInsetShadowValues(m_blurRadius, m_color, templateBounds, templateHole, holeRect.radii());
     if (redrawNeeded) {
         // Draw shadow into a new ImageBuffer.
         GraphicsContext& shadowContext = m_layerImage->context();
         GraphicsContextStateSaver shadowStateSaver(shadowContext);
         shadowContext.clearRect(templateBounds);
         shadowContext.setFillRule(RULE_EVENODD);
-        shadowContext.setFillColor(Color::black, ColorSpaceDeviceRGB);
+        shadowContext.setFillColor(Color::black);
 
         Path path;
         path.addRect(templateBounds);
@@ -724,7 +718,7 @@ void ShadowBlur::drawInsetShadowWithTiling(GraphicsContext& graphicsContext, con
     {
         GraphicsContextStateSaver fillStateSaver(graphicsContext);
         graphicsContext.setFillRule(RULE_EVENODD);
-        graphicsContext.setFillColor(m_color, m_colorSpace);
+        graphicsContext.setFillColor(m_color);
         graphicsContext.clearShadow();
         graphicsContext.fillPath(exteriorPath);
     }
@@ -745,14 +739,14 @@ void ShadowBlur::drawRectShadowWithTiling(GraphicsContext& graphicsContext, cons
     FloatRect templateShadow = FloatRect(edgeSize.width(), edgeSize.height(), templateSize.width() - 2 * edgeSize.width(), templateSize.height() - 2 * edgeSize.height());
 
     // Only redraw in the scratch buffer if its cached contents don't match our needs
-    bool redrawNeeded = scratchBuffer.setCachedShadowValues(m_blurRadius, m_color, m_colorSpace, templateShadow, shadowedRect.radii(), m_layerSize);
+    bool redrawNeeded = scratchBuffer.setCachedShadowValues(m_blurRadius, m_color, templateShadow, shadowedRect.radii(), m_layerSize);
     if (redrawNeeded) {
         // Draw shadow into the ImageBuffer.
         GraphicsContext& shadowContext = m_layerImage->context();
         GraphicsContextStateSaver shadowStateSaver(shadowContext);
 
         shadowContext.clearRect(FloatRect(0, 0, templateSize.width(), templateSize.height()));
-        shadowContext.setFillColor(Color::black, ColorSpaceDeviceRGB);
+        shadowContext.setFillColor(Color::black);
         
         if (shadowedRect.radii().isZero())
             shadowContext.fillRect(templateShadow);
@@ -798,14 +792,14 @@ void ShadowBlur::drawLayerPieces(GraphicsContext& graphicsContext, const FloatRe
         FloatRect shadowInterior(shadowBounds.x() + leftSlice, shadowBounds.y() + topSlice, centerWidth, centerHeight);
         if (!shadowInterior.isEmpty()) {
             GraphicsContextStateSaver stateSaver(graphicsContext);
-            graphicsContext.setFillColor(m_color, m_colorSpace);
+            graphicsContext.setFillColor(m_color);
             graphicsContext.clearShadow();
             graphicsContext.fillRect(shadowInterior);
         }
     }
 
     GraphicsContextStateSaver stateSaver(graphicsContext);
-    graphicsContext.setFillColor(m_color, m_colorSpace);
+    graphicsContext.setFillColor(m_color);
     graphicsContext.clearShadow();
 
     // Note that drawing the ImageBuffer is faster than creating a Image and drawing that,
@@ -816,46 +810,46 @@ void ShadowBlur::drawLayerPieces(GraphicsContext& graphicsContext, const FloatRe
     // Top side.
     FloatRect tileRect = FloatRect(leftSlice, 0, templateSideLength, topSlice);
     FloatRect destRect = FloatRect(centerRect.x(), centerRect.y() - topSlice, centerRect.width(), topSlice);
-    graphicsContext.drawImageBuffer(*m_layerImage, ColorSpaceDeviceRGB, destRect, tileRect);
+    graphicsContext.drawImageBuffer(*m_layerImage, destRect, tileRect);
 
     // Draw the bottom side.
     tileRect.setY(templateSize.height() - bottomSlice);
     tileRect.setHeight(bottomSlice);
     destRect.setY(centerRect.maxY());
     destRect.setHeight(bottomSlice);
-    graphicsContext.drawImageBuffer(*m_layerImage, ColorSpaceDeviceRGB, destRect, tileRect);
+    graphicsContext.drawImageBuffer(*m_layerImage, destRect, tileRect);
 
     // Left side.
     tileRect = FloatRect(0, topSlice, leftSlice, templateSideLength);
     destRect = FloatRect(centerRect.x() - leftSlice, centerRect.y(), leftSlice, centerRect.height());
-    graphicsContext.drawImageBuffer(*m_layerImage, ColorSpaceDeviceRGB, destRect, tileRect);
+    graphicsContext.drawImageBuffer(*m_layerImage, destRect, tileRect);
 
     // Right side.
     tileRect.setX(templateSize.width() - rightSlice);
     tileRect.setWidth(rightSlice);
     destRect.setX(centerRect.maxX());
     destRect.setWidth(rightSlice);
-    graphicsContext.drawImageBuffer(*m_layerImage, ColorSpaceDeviceRGB, destRect, tileRect);
+    graphicsContext.drawImageBuffer(*m_layerImage, destRect, tileRect);
 
     // Top left corner.
     tileRect = FloatRect(0, 0, leftSlice, topSlice);
     destRect = FloatRect(centerRect.x() - leftSlice, centerRect.y() - topSlice, leftSlice, topSlice);
-    graphicsContext.drawImageBuffer(*m_layerImage, ColorSpaceDeviceRGB, destRect, tileRect);
+    graphicsContext.drawImageBuffer(*m_layerImage, destRect, tileRect);
 
     // Top right corner.
     tileRect = FloatRect(templateSize.width() - rightSlice, 0, rightSlice, topSlice);
     destRect = FloatRect(centerRect.maxX(), centerRect.y() - topSlice, rightSlice, topSlice);
-    graphicsContext.drawImageBuffer(*m_layerImage, ColorSpaceDeviceRGB, destRect, tileRect);
+    graphicsContext.drawImageBuffer(*m_layerImage, destRect, tileRect);
 
     // Bottom right corner.
     tileRect = FloatRect(templateSize.width() - rightSlice, templateSize.height() - bottomSlice, rightSlice, bottomSlice);
     destRect = FloatRect(centerRect.maxX(), centerRect.maxY(), rightSlice, bottomSlice);
-    graphicsContext.drawImageBuffer(*m_layerImage, ColorSpaceDeviceRGB, destRect, tileRect);
+    graphicsContext.drawImageBuffer(*m_layerImage, destRect, tileRect);
 
     // Bottom left corner.
     tileRect = FloatRect(0, templateSize.height() - bottomSlice, leftSlice, bottomSlice);
     destRect = FloatRect(centerRect.x() - leftSlice, centerRect.maxY(), leftSlice, bottomSlice);
-    graphicsContext.drawImageBuffer(*m_layerImage, ColorSpaceDeviceRGB, destRect, tileRect);
+    graphicsContext.drawImageBuffer(*m_layerImage, destRect, tileRect);
 }
 
 
@@ -878,7 +872,7 @@ void ShadowBlur::blurAndColorShadowBuffer(const IntSize& templateSize)
     GraphicsContext& shadowContext = m_layerImage->context();
     GraphicsContextStateSaver stateSaver(shadowContext);
     shadowContext.setCompositeOperation(CompositeSourceIn);
-    shadowContext.setFillColor(m_color, m_colorSpace);
+    shadowContext.setFillColor(m_color);
     shadowContext.fillRect(FloatRect(0, 0, templateSize.width(), templateSize.height()));
 }
 
@@ -894,7 +888,7 @@ GraphicsContext* ShadowBlur::beginShadowLayer(GraphicsContext& context, const Fl
     // We reset the scratch buffer values here, because the buffer will no longer contain
     // data from any previous rectangle or inset shadows drawn via the tiling path.
     auto& scratchBuffer = ScratchBuffer::singleton();
-    scratchBuffer.setCachedShadowValues(FloatSize(), Color::black, ColorSpaceDeviceRGB, IntRect(), FloatRoundedRect::Radii(), m_layerSize);
+    scratchBuffer.setCachedShadowValues(FloatSize(), Color::black, IntRect(), FloatRoundedRect::Radii(), m_layerSize);
     m_layerImage = scratchBuffer.getScratchBuffer(layerRect.size());
 
     GraphicsContext& shadowContext = m_layerImage->context();
@@ -915,7 +909,7 @@ void ShadowBlur::endShadowLayer(GraphicsContext& context)
     GraphicsContextStateSaver stateSave(context);
 
     context.clearShadow();
-    context.drawImageBuffer(*m_layerImage, ColorSpaceDeviceRGB, FloatRect(roundedIntPoint(m_layerOrigin), m_layerSize), FloatRect(FloatPoint(), m_layerSize), context.compositeOperation());
+    context.drawImageBuffer(*m_layerImage, FloatRect(roundedIntPoint(m_layerOrigin), m_layerSize), FloatRect(FloatPoint(), m_layerSize), context.compositeOperation());
 
     m_layerImage = nullptr;
     ScratchBuffer::singleton().scheduleScratchBufferPurge();
index 2050ab9..ed166cf 100644 (file)
@@ -51,11 +51,11 @@ public:
         BlurShadow
     };
 
-    ShadowBlur(const FloatSize& radius, const FloatSize& offset, const Color&, ColorSpace);
+    ShadowBlur(const FloatSize& radius, const FloatSize& offset, const Color&);
     ShadowBlur(const GraphicsContextState&);
     ShadowBlur();
 
-    void setShadowValues(const FloatSize&, const FloatSize& , const Color&, ColorSpace, bool ignoreTransforms = false);
+    void setShadowValues(const FloatSize&, const FloatSize& , const Color&, bool ignoreTransforms = false);
 
     void setShadowsIgnoreTransforms(bool ignoreTransforms) { m_shadowsIgnoreTransforms = ignoreTransforms; }
     bool shadowsIgnoreTransforms() const { return m_shadowsIgnoreTransforms; }
@@ -104,7 +104,6 @@ private:
     ShadowType m_type;
 
     Color m_color;
-    ColorSpace m_colorSpace;
     FloatSize m_blurRadius;
     FloatSize m_offset;
 
index 503c4fb..55b3d47 100644 (file)
@@ -670,7 +670,7 @@ void MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer()
 
     m_videoLayer = adoptNS([allocAVPlayerLayerInstance() init]);
     [m_videoLayer setPlayer:m_avPlayer.get()];
-    [m_videoLayer setBackgroundColor:cachedCGColor(Color::black, ColorSpaceDeviceRGB)];
+    [m_videoLayer setBackgroundColor:cachedCGColor(Color::black)];
 #ifndef NDEBUG
     [m_videoLayer setName:@"MediaPlayerPrivate AVPlayerLayer"];
 #endif
@@ -2347,7 +2347,7 @@ void MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput(GraphicsContext& c
     FloatRect transformedOutputRect = videoTransform.inverse().mapRect(outputRect);
 
     context.concatCTM(videoTransform);
-    context.drawNativeImage(m_lastImage.get(), imageRect.size(), ColorSpaceDeviceRGB, transformedOutputRect, imageRect);
+    context.drawNativeImage(m_lastImage.get(), imageRect.size(), transformedOutputRect, imageRect);
 
     // If we have created an AVAssetImageGenerator in the past due to m_videoOutput not having an available
     // video frame, destroy it now that it is no longer needed.
index 807ee13..ad79e95 100644 (file)
@@ -986,8 +986,7 @@ void GraphicsLayerCA::setContentsToImage(Image* image)
         if (!newImage)
             return;
 
-        // Check to see if the image changed; we have to do this because the call to
-        // CGImageCreateCopyWithColorSpace() below can create a new image every time.
+        // FIXME: probably don't need m_uncorrectedContentsImage at all now.
         if (m_uncorrectedContentsImage && m_uncorrectedContentsImage.get() == newImage)
             return;
         
index f1809fc..68b9562 100644 (file)
@@ -670,7 +670,7 @@ void TileGrid::platformCALayerPaintContents(PlatformCALayer* platformCALayer, Gr
 
     int repaintCount = platformCALayerIncrementRepaintCount(platformCALayer);
     if (m_controller.rootLayer().owner()->platformCALayerShowRepaintCounter(0))
-        PlatformCALayer::drawRepaintIndicator(context.platformContext(), platformCALayer, repaintCount, cachedCGColor(m_controller.tileDebugBorderColor(), ColorSpaceDeviceRGB));
+        PlatformCALayer::drawRepaintIndicator(context.platformContext(), platformCALayer, repaintCount, cachedCGColor(m_controller.tileDebugBorderColor()));
 
     if (m_controller.scrollingPerformanceLoggingEnabled()) {
         FloatRect visiblePart(platformCALayer->position().x(), platformCALayer->position().y(), platformCALayer->bounds().size().width(), platformCALayer->bounds().size().height());
index 7213b5b..43cd9e4 100644 (file)
@@ -129,7 +129,7 @@ void PlatformCALayerWinInternal::drawRepaintCounters(CACFLayerRef caLayer, CGCon
     if (borderWidth > 0)
         backgroundColor = CACFLayerGetBorderColor(caLayer);
     else
-        backgroundColor = cachedCGColor(Color(255, 0, 0), ColorSpaceDeviceRGB);
+        backgroundColor = cachedCGColor(Color(255, 0, 0));
 
     PlatformCALayer::drawRepaintIndicator(context, owner(), drawCount, backgroundColor);
 }
index f5e3de0..cd57ee4 100644 (file)
@@ -64,7 +64,7 @@ BitmapImage::BitmapImage(PassRefPtr<cairo_surface_t> nativeImage, ImageObserver*
     checkForSolidColor();
 }
 
-void BitmapImage::draw(GraphicsContext& context, const FloatRect& dst, const FloatRect& src, ColorSpace styleColorSpace, CompositeOperator op,
+void BitmapImage::draw(GraphicsContext& context, const FloatRect& dst, const FloatRect& src, CompositeOperator op,
     BlendMode blendMode, ImageOrientationDescription description)
 {
     if (!dst.width() || !dst.height() || !src.width() || !src.height())
@@ -77,7 +77,7 @@ void BitmapImage::draw(GraphicsContext& context, const FloatRect& dst, const Flo
         return;
 
     if (mayFillWithSolidColor()) {
-        fillWithSolidColor(context, dst, solidColor(), styleColorSpace, op);
+        fillWithSolidColor(context, dst, solidColor(), op);
         return;
     }
 
index a42b54d..33c8006 100644 (file)
@@ -224,7 +224,6 @@ void GraphicsContext::restorePlatformState()
     platformContext()->shadowBlur().setShadowValues(FloatSize(m_state.shadowBlur, m_state.shadowBlur),
                                                     m_state.shadowOffset,
                                                     m_state.shadowColor,
-                                                    m_state.shadowColorSpace,
                                                     m_state.shadowsIgnoreTransforms);
 }
 
@@ -451,7 +450,7 @@ void GraphicsContext::fillRect(const FloatRect& rect)
     shadowAndFillCurrentCairoPath(*this);
 }
 
-void GraphicsContext::fillRect(const FloatRect& rect, const Color& color, ColorSpace)
+void GraphicsContext::fillRect(const FloatRect& rect, const Color& color)
 {
     if (paintingDisabled())
         return;
@@ -724,13 +723,13 @@ void GraphicsContext::translate(float x, float y)
     m_data->translate(x, y);
 }
 
-void GraphicsContext::setPlatformFillColor(const Color&, ColorSpace)
+void GraphicsContext::setPlatformFillColor(const Color&)
 {
     // Cairo contexts can't hold separate fill and stroke colors
     // so we set them just before we actually fill or stroke
 }
 
-void GraphicsContext::setPlatformStrokeColor(const Color&, ColorSpace)
+void GraphicsContext::setPlatformStrokeColor(const Color&)
 {
     // Cairo contexts can't hold separate fill and stroke colors
     // so we set them just before we actually fill or stroke
@@ -798,7 +797,7 @@ void GraphicsContext::setCTM(const AffineTransform& transform)
     m_data->setCTM(transform);
 }
 
-void GraphicsContext::setPlatformShadow(FloatSize const& size, float, Color const&, ColorSpace)
+void GraphicsContext::setPlatformShadow(FloatSize const& size, float, Color const&)
 {
     if (paintingDisabled())
         return;
@@ -813,7 +812,6 @@ void GraphicsContext::setPlatformShadow(FloatSize const& size, float, Color cons
     platformContext()->shadowBlur().setShadowValues(FloatSize(m_state.shadowBlur, m_state.shadowBlur),
                                                     m_state.shadowOffset,
                                                     m_state.shadowColor,
-                                                    m_state.shadowColorSpace,
                                                     m_state.shadowsIgnoreTransforms);
 }
 
@@ -1019,7 +1017,7 @@ void GraphicsContext::clipOut(const FloatRect& r)
     cairo_set_fill_rule(cr, savedFillRule);
 }
 
-void GraphicsContext::platformFillRoundedRect(const FloatRoundedRect& rect, const Color& color, ColorSpace)
+void GraphicsContext::platformFillRoundedRect(const FloatRoundedRect& rect, const Color& color)
 {
     if (paintingDisabled())
         return;
@@ -1037,7 +1035,7 @@ void GraphicsContext::platformFillRoundedRect(const FloatRoundedRect& rect, cons
     cairo_restore(cr);
 }
 
-void GraphicsContext::fillRectWithRoundedHole(const FloatRect& rect, const FloatRoundedRect& roundedHoleRect, const Color& color, ColorSpace)
+void GraphicsContext::fillRectWithRoundedHole(const FloatRect& rect, const FloatRoundedRect& roundedHoleRect, const Color& color)
 {
     if (paintingDisabled() || !color.isValid())
         return;
@@ -1059,7 +1057,7 @@ void GraphicsContext::fillRectWithRoundedHole(const FloatRect& rect, const Float
     cairo_restore(cr);
 }
 
-void GraphicsContext::drawPattern(Image& image, const FloatRect& tileRect, const AffineTransform& patternTransform, const FloatPoint& phase, const FloatSize&, ColorSpace, CompositeOperator op, const FloatRect& destRect, BlendMode)
+void GraphicsContext::drawPattern(Image& image, const FloatRect& tileRect, const AffineTransform& patternTransform, const FloatPoint& phase, const FloatSize&, CompositeOperator op, const FloatRect& destRect, BlendMode)
 {
     RefPtr<cairo_surface_t> surface = image.nativeImageForCurrentFrame();
     if (!surface) // If it's too early we won't have an image yet.
index 3e5213f..256d1cc 100644 (file)
@@ -165,19 +165,19 @@ void ImageBuffer::clip(GraphicsContext& context, const FloatRect& maskRect) cons
     context.platformContext()->pushImageMask(m_data.m_surface.get(), maskRect);
 }
 
-void ImageBuffer::draw(GraphicsContext& destinationContext, ColorSpace styleColorSpace, const FloatRect& destRect, const FloatRect& srcRect,
+void ImageBuffer::draw(GraphicsContext& destinationContext, const FloatRect& destRect, const FloatRect& srcRect,
     CompositeOperator op, BlendMode blendMode, bool useLowQualityScale)
 {
     BackingStoreCopy copyMode = &destinationContext == &context() ? CopyBackingStore : DontCopyBackingStore;
     RefPtr<Image> image = copyImage(copyMode);
-    destinationContext.drawImage(*image, styleColorSpace, destRect, srcRect, ImagePaintingOptions(op, blendMode, ImageOrientationDescription(), useLowQualityScale));
+    destinationContext.drawImage(*image, destRect, srcRect, ImagePaintingOptions(op, blendMode, ImageOrientationDescription(), useLowQualityScale));
 }
 
 void ImageBuffer::drawPattern(GraphicsContext& context, const FloatRect& srcRect, const AffineTransform& patternTransform,
-    const FloatPoint& phase, const FloatSize& spacing, ColorSpace styleColorSpace, CompositeOperator op, const FloatRect& destRect, BlendMode)
+    const FloatPoint& phase, const FloatSize& spacing, CompositeOperator op, const FloatRect& destRect, BlendMode)
 {
     if (RefPtr<Image> image = copyImage(DontCopyBackingStore))
-        image->drawPattern(context, srcRect, patternTransform, phase, spacing, styleColorSpace, op, destRect);
+        image->drawPattern(context, srcRect, patternTransform, phase, spacing, op, destRect);
 }
 
 void ImageBuffer::platformTransformColorSpace(const Vector<int>& lookUpTable)
index e4c63a3..11e57b4 100644 (file)
@@ -42,9 +42,9 @@
 namespace WebCore {
 
 void Image::drawPattern(GraphicsContext& context, const FloatRect& tileRect, const AffineTransform& patternTransform,
-    const FloatPoint& phase, const FloatSize& spacing, ColorSpace colorSpace, CompositeOperator op, const FloatRect& destRect, BlendMode blendMode)
+    const FloatPoint& phase, const FloatSize& spacing, CompositeOperator op, const FloatRect& destRect, BlendMode blendMode)
 {
-    context.drawPattern(*this, tileRect, patternTransform, phase, spacing, colorSpace, op, destRect, blendMode);
+    context.drawPattern(*this, tileRect, patternTransform, phase, spacing, op, destRect, blendMode);
 
     if (imageObserver())
         imageObserver()->didDraw(this);
index f080ebf..a53af36 100644 (file)
@@ -203,7 +203,7 @@ RetainPtr<CFArrayRef> BitmapImage::getCGImageArray()
     return adoptCF(array);
 }
 
-void BitmapImage::draw(GraphicsContext& ctxt, const FloatRect& destRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator compositeOp, BlendMode blendMode, ImageOrientationDescription description)
+void BitmapImage::draw(GraphicsContext& ctxt, const FloatRect& destRect, const FloatRect& srcRect, CompositeOperator compositeOp, BlendMode blendMode, ImageOrientationDescription description)
 {
 #if PLATFORM(IOS)
     startAnimation(DoNotCatchUp);
@@ -226,7 +226,7 @@ void BitmapImage::draw(GraphicsContext& ctxt, const FloatRect& destRect, const F
         return;
     
     if (mayFillWithSolidColor()) {
-        fillWithSolidColor(ctxt, destRect, solidColor(), styleColorSpace, compositeOp);
+        fillWithSolidColor(ctxt, destRect, solidColor(), compositeOp);
         return;
     }
 
@@ -245,7 +245,7 @@ void BitmapImage::draw(GraphicsContext& ctxt, const FloatRect& destRect, const F
     if (description.respectImageOrientation() == RespectImageOrientation)
         orientation = frameOrientationAtIndex(m_currentFrame);
 
-    ctxt.drawNativeImage(image.get(), imageSize, styleColorSpace, destRect, scaledSrcRect, compositeOp, blendMode, orientation);
+    ctxt.drawNativeImage(image.get(), imageSize, destRect, scaledSrcRect, compositeOp, blendMode, orientation);
 
     if (imageObserver())
         imageObserver()->didDraw(this);
index 893e674..d8eb63a 100644 (file)
@@ -100,26 +100,26 @@ Color::Color(CGColorRef color)
     m_valid = true;
 }
 
-static CGColorRef leakCGColor(const Color& color, ColorSpace colorSpace)
+static CGColorRef leakCGColor(const Color& color)
 {
     CGFloat components[4];
     color.getRGBA(components[0], components[1], components[2], components[3]);
-    return CGColorCreate(cachedCGColorSpace(colorSpace), components);
+    return CGColorCreate(sRGBColorSpaceRef(), components);
 }
 
-template<ColorSpace colorSpace> static CGColorRef cachedCGColor(const Color& color)
+CGColorRef cachedCGColor(const Color& color)
 {
     switch (color.rgb()) {
     case Color::transparent: {
-        static CGColorRef transparentCGColor = leakCGColor(color, colorSpace);
+        static CGColorRef transparentCGColor = leakCGColor(color);
         return transparentCGColor;
     }
     case Color::black: {
-        static CGColorRef blackCGColor = leakCGColor(color, colorSpace);
+        static CGColorRef blackCGColor = leakCGColor(color);
         return blackCGColor;
     }
     case Color::white: {
-        static CGColorRef whiteCGColor = leakCGColor(color, colorSpace);
+        static CGColorRef whiteCGColor = leakCGColor(color);
         return whiteCGColor;
     }
     }
@@ -135,7 +135,7 @@ template<ColorSpace colorSpace> static CGColorRef cachedCGColor(const Color& col
             return cachedCGColors[i].get();
     }
 
-    CGColorRef newCGColor = leakCGColor(color, colorSpace);
+    CGColorRef newCGColor = leakCGColor(color);
 
     static size_t cursor;
     cachedRGBAValues[cursor] = color.rgb();
@@ -146,20 +146,6 @@ template<ColorSpace colorSpace> static CGColorRef cachedCGColor(const Color& col
     return newCGColor;
 }
 
-CGColorRef cachedCGColor(const Color& color, ColorSpace colorSpace)
-{
-    switch (colorSpace) {
-    case ColorSpaceDeviceRGB:
-        return cachedCGColor<ColorSpaceDeviceRGB>(color);
-    case ColorSpaceSRGB:
-        return cachedCGColor<ColorSpaceSRGB>(color);
-    case ColorSpaceLinearRGB:
-        return cachedCGColor<ColorSpaceLinearRGB>(color);
-    }
-    ASSERT_NOT_REACHED();
-    return cachedCGColor(color, ColorSpaceDeviceRGB);
-}
-
 }
 
 #endif // USE(CG)
index 94aaaa9..37a7289 100644 (file)
@@ -536,7 +536,7 @@ void GraphicsContext3D::paintToCanvas(const unsigned char* imagePixels, int imag
     context.scale(FloatSize(1, -1));
     context.translate(0, -imageHeight);
     context.setImageInterpolationQuality(InterpolationNone);
-    context.drawNativeImage(cgImage.get(), imageSize, ColorSpaceDeviceRGB, canvasRect, FloatRect(FloatPoint(), imageSize), CompositeCopy);
+    context.drawNativeImage(cgImage.get(), imageSize, canvasRect, FloatRect(FloatPoint(), imageSize), CompositeCopy);
 }
 
 } // namespace WebCore
index 2e59d5c..2ac94b2 100644 (file)
@@ -63,16 +63,17 @@ using WTF::GenericHashTraits;
 
 namespace WebCore {
 
-static void setCGFillColor(CGContextRef context, const Color& color, ColorSpace colorSpace)
+static void setCGFillColor(CGContextRef context, const Color& color)
 {
-    CGContextSetFillColorWithColor(context, cachedCGColor(color, colorSpace));
+    CGContextSetFillColorWithColor(context, cachedCGColor(color));
 }
 
-static void setCGStrokeColor(CGContextRef context, const Color& color, ColorSpace colorSpace)
+static void setCGStrokeColor(CGContextRef context, const Color& color)
 {
-    CGContextSetStrokeColorWithColor(context, cachedCGColor(color, colorSpace));
+    CGContextSetStrokeColorWithColor(context, cachedCGColor(color));
 }
 
+// FIXME: This should be removed soon.
 CGColorSpaceRef deviceRGBColorSpaceRef()
 {
     static CGColorSpaceRef deviceSpace = CGColorSpaceCreateDeviceRGB();
@@ -123,8 +124,8 @@ void GraphicsContext::platformInit(CGContextRef cgContext)
     setPaintingDisabled(!cgContext);
     if (cgContext) {
         // Make sure the context starts in sync with our state.
-        setPlatformFillColor(fillColor(), fillColorSpace());
-        setPlatformStrokeColor(strokeColor(), strokeColorSpace());
+        setPlatformFillColor(fillColor());
+        setPlatformStrokeColor(strokeColor());
         setPlatformStrokeThickness(strokeThickness());
         m_state.imageInterpolationQuality = convertInterpolationQuality(CGContextGetInterpolationQuality(platformContext()));
     }
@@ -159,7 +160,7 @@ void GraphicsContext::restorePlatformState()
     m_data->m_userToDeviceTransformKnownToBeIdentity = false;
 }
 
-void GraphicsContext::drawNativeImage(PassNativeImagePtr imagePtr, const FloatSize& imageSize, ColorSpace styleColorSpace, const FloatRect& destRect, const FloatRect& srcRect, CompositeOperator op, BlendMode blendMode, ImageOrientation orientation)
+void GraphicsContext::drawNativeImage(PassNativeImagePtr imagePtr, const FloatSize& imageSize, const FloatRect& destRect, const FloatRect& srcRect, CompositeOperator op, BlendMode blendMode, ImageOrientation orientation)
 {
     RetainPtr<CGImageRef> image(imagePtr);
 
@@ -250,9 +251,6 @@ void GraphicsContext::drawNativeImage(PassNativeImagePtr imagePtr, const FloatSi
     CGContextTranslateCTM(context, 0, adjustedDestRect.height());
     CGContextScaleCTM(context, 1, -1);
 
-    // Adjust the color space.
-    image = Image::imageWithColorSpace(image.get(), styleColorSpace);
-
     // Draw the image.
     CGContextDrawImage(context, adjustedDestRect, image.get());
 }
@@ -276,7 +274,7 @@ static void patternReleaseCallback(void* info)
     });
 }
 
-void GraphicsContext::drawPattern(Image& image, const FloatRect& tileRect, const AffineTransform& patternTransform, const FloatPoint& phase, const FloatSize& spacing, ColorSpace styleColorSpace, CompositeOperator op, const FloatRect& destRect, BlendMode blendMode)
+void GraphicsContext::drawPattern(Image& image, const FloatRect& tileRect, const AffineTransform& patternTransform, const FloatPoint& phase, const FloatSize& spacing, CompositeOperator op, const FloatRect& destRect, BlendMode blendMode)
 {
     if (!patternTransform.isInvertible())
         return;
@@ -316,9 +314,6 @@ void GraphicsContext::drawPattern(Image& image, const FloatRect& tileRect, const
         subImage = adoptCF(CGImageCreateWithImageInRect(tileImage, tileRect));
     }
 
-    // Adjust the color space.
-    subImage = Image::imageWithColorSpace(subImage.get(), styleColorSpace);
-
     // If we need to paint gaps between tiles because we have a partially loaded image or non-zero spacing,
     // fall back to the less efficient CGPattern-based mechanism.
     float scaledTileWidth = tileRect.width() * narrowPrecisionToFloat(patternTransform.a());
@@ -346,7 +341,7 @@ void GraphicsContext::drawPattern(Image& image, const FloatRect& tileRect, const
         if (!pattern)
             return;
 
-        RetainPtr<CGColorSpaceRef> patternSpace = adoptCF(CGColorSpaceCreatePattern(0));
+        RetainPtr<CGColorSpaceRef> patternSpace = adoptCF(CGColorSpaceCreatePattern(nullptr));
 
         CGFloat alpha = 1;
         RetainPtr<CGColorRef> color = adoptCF(CGColorCreateWithPattern(patternSpace.get(), pattern.get(), &alpha));
@@ -390,7 +385,7 @@ void GraphicsContext::drawRect(const FloatRect& rect, float borderThickness)
         // We do a fill of four rects to simulate the stroke of a border.
         Color oldFillColor = fillColor();
         if (oldFillColor != strokeColor())
-            setCGFillColor(context, strokeColor(), strokeColorSpace());
+            setCGFillColor(context, strokeColor());
         CGRect rects[4] = {
             FloatRect(rect.x(), rect.y(), rect.width(), borderThickness),
             FloatRect(rect.x(), rect.maxY() - borderThickness, rect.width(), borderThickness),
@@ -399,7 +394,7 @@ void GraphicsContext::drawRect(const FloatRect& rect, float borderThickness)
         };
         CGContextFillRects(context, rects, 4);
         if (oldFillColor != strokeColor())
-            setCGFillColor(context, oldFillColor, fillColorSpace());
+            setCGFillColor(context, oldFillColor);
     }
 }
 
@@ -428,7 +423,7 @@ void GraphicsContext::drawLine(const FloatPoint& point1, const FloatPoint& point
     if (drawsDashedLine) {
         // Figure out end points to ensure we always paint corners.
         cornerWidth = strokeStyle == DottedStroke ? thickness : std::min(2 * thickness, std::max(thickness, strokeWidth / 3));
-        setCGFillColor(context, strokeColor(), strokeColorSpace());
+        setCGFillColor(context, strokeColor());
         if (isVerticalLine) {
             CGContextFillRect(context, FloatRect(point1.x(), point1.y(), thickness, cornerWidth));
             CGContextFillRect(context, FloatRect(point1.x(), point2.y() - cornerWidth, thickness, cornerWidth));
@@ -603,7 +598,7 @@ void GraphicsContext::applyFillPattern()
     if (!platformPattern)
         return;
 
-    RetainPtr<CGColorSpaceRef> patternSpace = adoptCF(CGColorSpaceCreatePattern(0));
+    RetainPtr<CGColorSpaceRef> patternSpace = adoptCF(CGColorSpaceCreatePattern(nullptr));
     CGContextSetFillColorSpace(cgContext, patternSpace.get());
 
     const CGFloat patternAlpha = 1;
@@ -833,17 +828,16 @@ void GraphicsContext::fillRect(const FloatRect& rect)
     CGContextFillRect(context, rect);
 }
 
-void GraphicsContext::fillRect(const FloatRect& rect, const Color& color, ColorSpace colorSpace)
+void GraphicsContext::fillRect(const FloatRect& rect, const Color& color)
 {
     if (paintingDisabled())
         return;
 
     CGContextRef context = platformContext();
     Color oldFillColor = fillColor();
-    ColorSpace oldColorSpace = fillColorSpace();
 
-    if (oldFillColor != color || oldColorSpace != colorSpace)
-        setCGFillColor(context, color, colorSpace);
+    if (oldFillColor != color)
+        setCGFillColor(context, color);
 
     bool drawOwnShadow = !isAcceleratedContext() && hasBlurredShadow() && !m_state.shadowsIgnoreTransforms; // Don't use ShadowBlur for canvas yet.
     CGContextStateSaver stateSaver(context, drawOwnShadow);
@@ -860,21 +854,20 @@ void GraphicsContext::fillRect(const FloatRect& rect, const Color& color, ColorS
     if (drawOwnShadow)
         stateSaver.restore();
 
-    if (oldFillColor != color || oldColorSpace != colorSpace)
-        setCGFillColor(context, oldFillColor, oldColorSpace);
+    if (oldFillColor != color)
+        setCGFillColor(context, oldFillColor);
 }
 
-void GraphicsContext::platformFillRoundedRect(const FloatRoundedRect& rect, const Color& color, ColorSpace colorSpace)
+void GraphicsContext::platformFillRoundedRect(const FloatRoundedRect& rect, const Color& color)
 {
     if (paintingDisabled())
         return;
 
     CGContextRef context = platformContext();
     Color oldFillColor = fillColor();
-    ColorSpace oldColorSpace = fillColorSpace();
 
-    if (oldFillColor != color || oldColorSpace != colorSpace)
-        setCGFillColor(context, color, colorSpace);
+    if (oldFillColor != color)
+        setCGFillColor(context, color);
 
     bool drawOwnShadow = !isAcceleratedContext() && hasBlurredShadow() && !m_state.shadowsIgnoreTransforms; // Don't use ShadowBlur for canvas yet.
     CGContextStateSaver stateSaver(context, drawOwnShadow);
@@ -902,11 +895,11 @@ void GraphicsContext::platformFillRoundedRect(const FloatRoundedRect& rect, cons
     if (drawOwnShadow)
         stateSaver.restore();
 
-    if (oldFillColor != color || oldColorSpace != colorSpace)
-        setCGFillColor(context, oldFillColor, oldColorSpace);
+    if (oldFillColor != color)
+        setCGFillColor(context, oldFillColor);
 }
 
-void GraphicsContext::fillRectWithRoundedHole(const FloatRect& rect, const FloatRoundedRect& roundedHoleRect, const Color& color, ColorSpace colorSpace)
+void GraphicsContext::fillRectWithRoundedHole(const FloatRect& rect, const FloatRoundedRect& roundedHoleRect, const Color& color)
 {
     if (paintingDisabled())
         return;
@@ -923,10 +916,9 @@ void GraphicsContext::fillRectWithRoundedHole(const FloatRect& rect, const Float
 
     WindRule oldFillRule = fillRule();
     Color oldFillColor = fillColor();
-    ColorSpace oldFillColorSpace = fillColorSpace();
     
     setFillRule(RULE_EVENODD);
-    setFillColor(color, colorSpace);
+    setFillColor(color);
 
     // fillRectWithRoundedHole() assumes that the edges of rect are clipped out, so we only care about shadows cast around inside the hole.
     bool drawOwnShadow = !isAcceleratedContext() && hasBlurredShadow() && !m_state.shadowsIgnoreTransforms;
@@ -945,7 +937,7 @@ void GraphicsContext::fillRectWithRoundedHole(const FloatRect& rect, const Float
         stateSaver.restore();
     
     setFillRule(oldFillRule);
-    setFillColor(oldFillColor, oldFillColorSpace);
+    setFillColor(oldFillColor);
 }
 
 void GraphicsContext::clip(const FloatRect& rect)
@@ -1055,7 +1047,7 @@ static void applyShadowOffsetWorkaroundIfNeeded(const GraphicsContext& context,
 #endif
 }
 
-void GraphicsContext::setPlatformShadow(const FloatSize& offset, float blur, const Color& color, ColorSpace colorSpace)
+void GraphicsContext::setPlatformShadow(const FloatSize& offset, float blur, const Color& color)
 {
     if (paintingDisabled())
         return;
@@ -1095,7 +1087,7 @@ void GraphicsContext::setPlatformShadow(const FloatSize& offset, float blur, con
     if (!color.isValid())
         CGContextSetShadow(context, CGSizeMake(xOffset, yOffset), blurRadius);
     else
-        CGContextSetShadowWithColor(context, CGSizeMake(xOffset, yOffset), blurRadius, cachedCGColor(color, colorSpace));
+        CGContextSetShadowWithColor(context, CGSizeMake(xOffset, yOffset), blurRadius, cachedCGColor(color));
 }
 
 void GraphicsContext::clearPlatformShadow()
@@ -1392,12 +1384,12 @@ void GraphicsContext::drawLinesForText(const FloatPoint& point, const DashArray&
     }
 
     if (fillColorIsNotEqualToStrokeColor)
-        setCGFillColor(platformContext(), localStrokeColor, strokeColorSpace());
+        setCGFillColor(platformContext(), localStrokeColor);
 
     CGContextFillRects(platformContext(), dashBounds.data(), dashBounds.size());
 
     if (fillColorIsNotEqualToStrokeColor)
-        setCGFillColor(platformContext(), fillColor(), fillColorSpace());
+        setCGFillColor(platformContext(), fillColor());
 }
 
 void GraphicsContext::setURLForRect(const URL& link, const IntRect& destRect)
@@ -1497,11 +1489,11 @@ void GraphicsContext::setPlatformTextDrawingMode(TextDrawingModeFlags mode)
     }
 }
 
-void GraphicsContext::setPlatformStrokeColor(const Color& color, ColorSpace colorSpace)
+void GraphicsContext::setPlatformStrokeColor(const Color& color)
 {
     if (paintingDisabled())
         return;
-    setCGStrokeColor(platformContext(), color, colorSpace);
+    setCGStrokeColor(platformContext(), color);
 }
 
 void GraphicsContext::setPlatformStrokeThickness(float thickness)
@@ -1511,11 +1503,11 @@ void GraphicsContext::setPlatformStrokeThickness(float thickness)
     CGContextSetLineWidth(platformContext(), std::max(thickness, 0.f));
 }
 
-void GraphicsContext::setPlatformFillColor(const Color& color, ColorSpace colorSpace)
+void GraphicsContext::setPlatformFillColor(const Color& color)
 {
     if (paintingDisabled())
         return;
-    setCGFillColor(platformContext(), color, colorSpace);
+    setCGFillColor(platformContext(), color);
 }
 
 void GraphicsContext::setPlatformShouldAntialias(bool enable)
index 7c7de5b..e28ec37 100644 (file)
@@ -228,11 +228,8 @@ RetainPtr<CGImageRef> ImageBuffer::copyNativeImage(BackingStoreCopy copyBehavior
     return image;
 }
 
-void ImageBuffer::draw(GraphicsContext& destContext, ColorSpace styleColorSpace, const FloatRect& destRect, const FloatRect& srcRect, CompositeOperator op, BlendMode blendMode, bool useLowQualityScale)
+void ImageBuffer::draw(GraphicsContext& destContext, const FloatRect& destRect, const FloatRect& srcRect, CompositeOperator op, BlendMode blendMode, bool)
 {
-    UNUSED_PARAM(useLowQualityScale);
-    ColorSpace colorSpace = (&destContext == &context()) ? ColorSpaceDeviceRGB : styleColorSpace;
-
     RetainPtr<CGImageRef> image;
     if (&destContext == &context() || destContext.isAcceleratedContext())
         image = copyNativeImage(CopyBackingStore); // Drawing into our own buffer, need to deep copy.
@@ -241,10 +238,10 @@ void ImageBuffer::draw(GraphicsContext& destContext, ColorSpace styleColorSpace,
 
     FloatRect adjustedSrcRect = srcRect;
     adjustedSrcRect.scale(m_resolutionScale, m_resolutionScale);
-    destContext.drawNativeImage(image.get(), m_data.backingStoreSize, colorSpace, destRect, adjustedSrcRect, op, blendMode);
+    destContext.drawNativeImage(image.get(), m_data.backingStoreSize, destRect, adjustedSrcRect, op, blendMode);
 }
 
-void ImageBuffer::drawPattern(GraphicsContext& destContext, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, const FloatSize& spacing, ColorSpace styleColorSpace, CompositeOperator op, const FloatRect& destRect, BlendMode blendMode)
+void ImageBuffer::drawPattern(GraphicsContext& destContext, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, const FloatSize& spacing, CompositeOperator op, const FloatRect& destRect, BlendMode blendMode)
 {
     FloatRect adjustedSrcRect = srcRect;
     adjustedSrcRect.scale(m_resolutionScale, m_resolutionScale);
@@ -252,14 +249,14 @@ void ImageBuffer::drawPattern(GraphicsContext& destContext, const FloatRect& src
     if (!context().isAcceleratedContext()) {
         if (&destContext == &context() || destContext.isAcceleratedContext()) {
             if (RefPtr<Image> copy = copyImage(CopyBackingStore)) // Drawing into our own buffer, need to deep copy.
-                copy->drawPattern(destContext, adjustedSrcRect, patternTransform, phase, spacing, styleColorSpace, op, destRect, blendMode);
+                copy->drawPattern(destContext, adjustedSrcRect, patternTransform, phase, spacing, op, destRect, blendMode);
         } else {
             if (RefPtr<Image> imageForRendering = copyImage(DontCopyBackingStore))
-                imageForRendering->drawPattern(destContext, adjustedSrcRect, patternTransform, phase, spacing, styleColorSpace, op, destRect, blendMode);
+                imageForRendering->drawPattern(destContext, adjustedSrcRect, patternTransform, phase, spacing, op, destRect, blendMode);
         }
     } else {
         if (RefPtr<Image> copy = copyImage(CopyBackingStore))
-            copy->drawPattern(destContext, adjustedSrcRect, patternTransform, phase, spacing, styleColorSpace, op, destRect, blendMode);
+            copy->drawPattern(destContext, adjustedSrcRect, patternTransform, phase, spacing, op, destRect, blendMode);
     }
 }
 
index 75abbf8..f3dd022 100644 (file)
 
 namespace WebCore {
 
-RetainPtr<CGImageRef> Image::imageWithColorSpace(CGImageRef originalImage, ColorSpace colorSpace)
-{
-    CGColorSpaceRef originalColorSpace = CGImageGetColorSpace(originalImage);
-
-    // If the image already has a (non-device) color space, we don't want to
-    // override it, so return.
-    if (!originalColorSpace || !CFEqual(originalColorSpace, deviceRGBColorSpaceRef()))
-        return originalImage;
-
-    switch (colorSpace) {
-    case ColorSpaceDeviceRGB:
-        return originalImage;
-    case ColorSpaceSRGB:
-        return adoptCF(CGImageCreateCopyWithColorSpace(originalImage, sRGBColorSpaceRef()));
-    case ColorSpaceLinearRGB:
-        return adoptCF(CGImageCreateCopyWithColorSpace(originalImage, linearRGBColorSpaceRef()));
-    }
-
-    ASSERT_NOT_REACHED();
-    return originalImage;
-}
-
 void Image::drawPattern(GraphicsContext& ctxt, const FloatRect& tileRect, const AffineTransform& patternTransform,
-    const FloatPoint& phase, const FloatSize& spacing, ColorSpace styleColorSpace, CompositeOperator op, const FloatRect& destRect, BlendMode blendMode)
+    const FloatPoint& phase, const FloatSize& spacing, CompositeOperator op, const FloatRect& destRect, BlendMode blendMode)
 {
     if (!nativeImageForCurrentFrame())
         return;
 
-    ctxt.drawPattern(*this, tileRect, patternTransform, phase, spacing, styleColorSpace, op, destRect, blendMode);
+    ctxt.drawPattern(*this, tileRect, patternTransform, phase, spacing, op, destRect, blendMode);
 
     if (imageObserver())
         imageObserver()->didDraw(this);
index 82a3a5b..bfcea28 100644 (file)
@@ -179,7 +179,7 @@ void PDFDocumentImage::updateCachedImageIfNeeded(GraphicsContext& context, const
     }
 }
 
-void PDFDocumentImage::draw(GraphicsContext& context, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace, CompositeOperator op, BlendMode, ImageOrientationDescription)
+void PDFDocumentImage::draw(GraphicsContext& context, const FloatRect& dstRect, const FloatRect& srcRect, CompositeOperator op, BlendMode, ImageOrientationDescription)
 {
     if (!m_document || !m_hasPage)
         return;
@@ -191,7 +191,7 @@ void PDFDocumentImage::draw(GraphicsContext& context, const FloatRect& dstRect,
         context.setCompositeOperation(op);
 
         if (m_cachedImageBuffer)
-            context.drawImageBuffer(*m_cachedImageBuffer, ColorSpaceDeviceRGB, dstRect);
+            context.drawImageBuffer(*m_cachedImageBuffer, dstRect);
         else {
             transformContextForPainting(context, dstRect, srcRect);
             drawPDFPage(context);
index 7ffd603..9a4c1e9 100644 (file)
@@ -69,7 +69,7 @@ private:
     virtual void computeIntrinsicDimensions(Length& intrinsicWidth, Length& intrinsicHeight, FloatSize& intrinsicRatio) override;
     virtual FloatSize size() const override;
 
-    virtual void draw(GraphicsContext&, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator, BlendMode, ImageOrientationDescription) override;
+    virtual void draw(GraphicsContext&, const FloatRect& dstRect, const FloatRect& srcRect, CompositeOperator, BlendMode, ImageOrientationDescription) override;
 
     // FIXME: Implement this to be less conservative.
     virtual bool currentFrameKnownToBeOpaque() override { return false; }
index 839ca03..d1dcbd6 100644 (file)
@@ -333,9 +333,7 @@ void FontCascade::drawGlyphs(GraphicsContext& context, const Font& font, const G
     FloatSize shadowOffset;
     float shadowBlur;
     Color shadowColor;
-    ColorSpace shadowColorSpace;
-    ColorSpace fillColorSpace = context.fillColorSpace();
-    context.getShadow(shadowOffset, shadowBlur, shadowColor, shadowColorSpace);
+    context.getShadow(shadowOffset, shadowBlur, shadowColor);
 
     AffineTransform contextCTM = context.getCTM();
     float syntheticBoldOffset = font.syntheticBoldOffset();
@@ -352,14 +350,14 @@ void FontCascade::drawGlyphs(GraphicsContext& context, const Font& font, const G
         context.clearShadow();
         Color fillColor = context.fillColor();
         Color shadowFillColor(shadowColor.red(), shadowColor.green(), shadowColor.blue(), shadowColor.alpha() * fillColor.alpha() / 255);
-        context.setFillColor(shadowFillColor, shadowColorSpace);
+        context.setFillColor(shadowFillColor);
         float shadowTextX = point.x() + shadowOffset.width();
         // If shadows are ignoring transforms, then we haven't applied the Y coordinate flip yet, so down is negative.
         float shadowTextY = point.y() + shadowOffset.height() * (context.shadowsIgnoreTransforms() ? -1 : 1);
         showGlyphsWithAdvances(FloatPoint(shadowTextX, shadowTextY), font, cgContext, glyphBuffer.glyphs(from), static_cast<const CGSize*>(glyphBuffer.advances(from)), numGlyphs);
         if (syntheticBoldOffset)
             showGlyphsWithAdvances(FloatPoint(shadowTextX + syntheticBoldOffset, shadowTextY), font, cgContext, glyphBuffer.glyphs(from), static_cast<const CGSize*>(glyphBuffer.advances(from)), numGlyphs);
-        context.setFillColor(fillColor, fillColorSpace);
+        context.setFillColor(fillColor);
     }
 
     if (useLetterpressEffect)
@@ -370,7 +368,7 @@ void FontCascade::drawGlyphs(GraphicsContext& context, const Font& font, const G
         showGlyphsWithAdvances(FloatPoint(point.x() + syntheticBoldOffset, point.y()), font, cgContext, glyphBuffer.glyphs(from), static_cast<const CGSize*>(glyphBuffer.advances(from)), numGlyphs);
 
     if (hasSimpleShadow)
-        context.setShadow(shadowOffset, shadowBlur, shadowColor, shadowColorSpace);
+        context.setShadow(shadowOffset, shadowBlur, shadowColor);
 
 #if !PLATFORM(IOS)
 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101100
index edef578..ff9111c 100644 (file)
@@ -75,8 +75,8 @@ void FEBlend::platformApplySoftware()
     if (!imageBuffer || !imageBuffer2)
         return;
 
-    filterContext.drawImageBuffer(*imageBuffer2, ColorSpaceDeviceRGB, drawingRegionOfInputImage(in2->absolutePaintRect()));
-    filterContext.drawImageBuffer(*imageBuffer, ColorSpaceDeviceRGB, drawingRegionOfInputImage(in->absolutePaintRect()), IntRect(IntPoint(), imageBuffer->logicalSize()), ImagePaintingOptions(CompositeSourceOver, m_mode));
+    filterContext.drawImageBuffer(*imageBuffer2, drawingRegionOfInputImage(in2->absolutePaintRect()));
+    filterContext.drawImageBuffer(*imageBuffer, drawingRegionOfInputImage(in->absolutePaintRect()), IntRect(IntPoint(), imageBuffer->logicalSize()), ImagePaintingOptions(CompositeSourceOver, m_mode));
 }
 #endif
 
index 78ffdce..6860d7d 100644 (file)
@@ -149,7 +149,7 @@ void FEColorMatrix::platformApplySoftware()
 
     ImageBuffer* inBuffer = in->asImageBuffer();
     if (inBuffer)
-        resultImage->context().drawImageBuffer(*inBuffer, ColorSpaceDeviceRGB, drawingRegionOfInputImage(in->absolutePaintRect()));
+        resultImage->context().drawImageBuffer(*inBuffer, drawingRegionOfInputImage(in->absolutePaintRect()));
 
     IntRect imageRect(IntPoint(), resultImage->logicalSize());
     RefPtr<Uint8ClampedArray> pixelArray = resultImage->getUnmultipliedImageData(imageRect);
index 9a156f8..888846a 100644 (file)
@@ -281,8 +281,8 @@ void FEComposite::platformApplySoftware()
 
     switch (m_type) {
     case FECOMPOSITE_OPERATOR_OVER:
-        filterContext.drawImageBuffer(*imageBuffer2, ColorSpaceDeviceRGB, drawingRegionOfInputImage(in2->absolutePaintRect()));
-        filterContext.drawImageBuffer(*imageBuffer, ColorSpaceDeviceRGB, drawingRegionOfInputImage(in->absolutePaintRect()));
+        filterContext.drawImageBuffer(*imageBuffer2, drawingRegionOfInputImage(in2->absolutePaintRect()));
+        filterContext.drawImageBuffer(*imageBuffer, drawingRegionOfInputImage(in->absolutePaintRect()));
         break;
     case FECOMPOSITE_OPERATOR_IN: {
         // Applies only to the intersected region.
@@ -294,21 +294,21 @@ void FEComposite::platformApplySoftware()
         IntRect adjustedDestinationRect = destinationRect - absolutePaintRect().location();
         IntRect sourceRect = destinationRect - in->absolutePaintRect().location();
         IntRect source2Rect = destinationRect - in2->absolutePaintRect().location();
-        filterContext.drawImageBuffer(*imageBuffer2, ColorSpaceDeviceRGB, adjustedDestinationRect, source2Rect);
-        filterContext.drawImageBuffer(*imageBuffer, ColorSpaceDeviceRGB, adjustedDestinationRect, sourceRect, CompositeSourceIn);
+        filterContext.drawImageBuffer(*imageBuffer2, adjustedDestinationRect, source2Rect);
+        filterContext.drawImageBuffer(*imageBuffer, adjustedDestinationRect, sourceRect, CompositeSourceIn);
         break;
     }
     case FECOMPOSITE_OPERATOR_OUT:
-        filterContext.drawImageBuffer(*imageBuffer, ColorSpaceDeviceRGB, drawingRegionOfInputImage(in->absolutePaintRect()));
-        filterContext.drawImageBuffer(*imageBuffer2, ColorSpaceDeviceRGB, drawingRegionOfInputImage(in2->absolutePaintRect()), IntRect(IntPoint(), imageBuffer2->logicalSize()), CompositeDestinationOut);
+        filterContext.drawImageBuffer(*imageBuffer, drawingRegionOfInputImage(in->absolutePaintRect()));
+        filterContext.drawImageBuffer(*imageBuffer2, drawingRegionOfInputImage(in2->absolutePaintRect()), IntRect(IntPoint(), imageBuffer2->logicalSize()), CompositeDestinationOut);
         break;
     case FECOMPOSITE_OPERATOR_ATOP:
-        filterContext.drawImageBuffer(*imageBuffer2, ColorSpaceDeviceRGB, drawingRegionOfInputImage(in2->absolutePaintRect()));
-        filterContext.drawImageBuffer(*imageBuffer, ColorSpaceDeviceRGB, drawingRegionOfInputImage(in->absolutePaintRect()), IntRect(IntPoint(), imageBuffer->logicalSize()), CompositeSourceAtop);
+        filterContext.drawImageBuffer(*imageBuffer2, drawingRegionOfInputImage(in2->absolutePaintRect()));
+        filterContext.drawImageBuffer(*imageBuffer, drawingRegionOfInputImage(in->absolutePaintRect()), IntRect(IntPoint(), imageBuffer->logicalSize()), CompositeSourceAtop);
         break;
     case FECOMPOSITE_OPERATOR_XOR:
-        filterContext.drawImageBuffer(*imageBuffer2, ColorSpaceDeviceRGB, drawingRegionOfInputImage(in2->absolutePaintRect()));
-        filterContext.drawImageBuffer(*imageBuffer, ColorSpaceDeviceRGB, drawingRegionOfInputImage(in->absolutePaintRect()), IntRect(IntPoint(), imageBuffer->logicalSize()), CompositeXOR);
+        filterContext.drawImageBuffer(*imageBuffer2, drawingRegionOfInputImage(in2->absolutePaintRect()));
+        filterContext.drawImageBuffer(*imageBuffer, drawingRegionOfInputImage(in->absolutePaintRect()), IntRect(IntPoint(), imageBuffer->logicalSize()), CompositeXOR);
         break;
     default:
         break;
index dce5aae..c0e8942 100644 (file)
@@ -20,7 +20,6 @@
 #include "config.h"
 #include "FEDropShadow.h"
 
-#include "ColorSpace.h"
 #include "FEGaussianBlur.h"
 #include "Filter.h"
 #include "GraphicsContext.h"
@@ -93,10 +92,10 @@ void FEDropShadow::platformApplySoftware()
 
     GraphicsContext& resultContext = resultImage->context();
     resultContext.setAlpha(m_shadowOpacity);
-    resultContext.drawImageBuffer(*sourceImage, ColorSpaceDeviceRGB, drawingRegionWithOffset);
+    resultContext.drawImageBuffer(*sourceImage, drawingRegionWithOffset);
     resultContext.setAlpha(1);
 
-    ShadowBlur contextShadow(blurRadius, offset, m_shadowColor, ColorSpaceDeviceRGB);
+    ShadowBlur contextShadow(blurRadius, offset, m_shadowColor);
 
     // TODO: Direct pixel access to ImageBuffer would avoid copying the ImageData.
     IntRect shadowArea(IntPoint(), resultImage->internalSize());
@@ -107,10 +106,10 @@ void FEDropShadow::platformApplySoftware()
     resultImage->putByteArray(Premultiplied, srcPixelArray.get(), shadowArea.size(), shadowArea, IntPoint(), ImageBuffer::BackingStoreCoordinateSystem);
 
     resultContext.setCompositeOperation(CompositeSourceIn);
-    resultContext.fillRect(FloatRect(FloatPoint(), absolutePaintRect().size()), m_shadowColor, ColorSpaceDeviceRGB);
+    resultContext.fillRect(FloatRect(FloatPoint(), absolutePaintRect().size()), m_shadowColor);
     resultContext.setCompositeOperation(CompositeDestinationOver);
 
-    resultImage->context().drawImageBuffer(*sourceImage, ColorSpaceDeviceRGB, drawingRegion);
+    resultImage->context().drawImageBuffer(*sourceImage, drawingRegion);
 }
 
 void FEDropShadow::dump()
index 7ed429f..e8da8d3 100644 (file)
@@ -74,7 +74,7 @@ void FEFlood::platformApplySoftware()
         return;
 
     Color color = colorWithOverrideAlpha(floodColor().rgb(), floodOpacity());
-    resultImage->context().fillRect(FloatRect(FloatPoint(), absolutePaintRect().size()), color, ColorSpaceDeviceRGB);
+    resultImage->context().fillRect(FloatRect(FloatPoint(), absolutePaintRect().size()), color);
 }
 
 void FEFlood::dump()
index a02d9fd..32cf254 100644 (file)
@@ -52,7 +52,7 @@ void FEMerge::platformApplySoftware()
     for (unsigned i = 0; i < size; ++i) {
         FilterEffect* in = inputEffect(i);
         if (ImageBuffer* inBuffer = in->asImageBuffer())
-            filterContext.drawImageBuffer(*inBuffer, ColorSpaceDeviceRGB, drawingRegionOfInputImage(in->absolutePaintRect()));
+            filterContext.drawImageBuffer(*inBuffer, drawingRegionOfInputImage(in->absolutePaintRect()));
     }
 }
 
index 18a2e79..ddef587 100644 (file)
@@ -88,7 +88,7 @@ void FEOffset::platformApplySoftware()
     FloatRect drawingRegion = drawingRegionOfInputImage(in->absolutePaintRect());
     Filter& filter = this->filter();
     drawingRegion.move(filter.applyHorizontalScale(m_dx), filter.applyVerticalScale(m_dy));
-    resultImage->context().drawImageBuffer(*inBuffer, ColorSpaceDeviceRGB, drawingRegion);
+    resultImage->context().drawImageBuffer(*inBuffer, drawingRegion);
 }
 
 void FEOffset::dump()
index 7fbfa52..e8803bc 100644 (file)
@@ -70,7 +70,7 @@ void FETile::platformApplySoftware()
 
     GraphicsContext& tileImageContext = tileImage->context();
     tileImageContext.translate(-inMaxEffectLocation.x(), -inMaxEffectLocation.y());
-    tileImageContext.drawImageBuffer(*inBuffer, ColorSpaceDeviceRGB, in->absolutePaintRect().location());
+    tileImageContext.drawImageBuffer(*inBuffer, in->absolutePaintRect().location());
 
     auto tileImageCopy = tileImage->copyImage(CopyBackingStore);
     if (!tileImageCopy)
index 1e3b91a..724893b 100644 (file)
@@ -58,8 +58,8 @@ void SourceAlpha::platformApplySoftware()
         return;
 
     FloatRect imageRect(FloatPoint(), absolutePaintRect().size());
-    filterContext.fillRect(imageRect, Color::black, ColorSpaceDeviceRGB);
-    filterContext.drawImageBuffer(*imageBuffer, ColorSpaceDeviceRGB, IntPoint(), CompositeDestinationIn);
+    filterContext.fillRect(imageRect, Color::black);
+    filterContext.drawImageBuffer(*imageBuffer, IntPoint(), CompositeDestinationIn);
 }
 
 void SourceAlpha::dump()
index df4ee6f..61bb1b8 100644 (file)
@@ -56,7 +56,7 @@ void SourceGraphic::platformApplySoftware()
     if (!resultImage || !sourceImage)
         return;
 
-    resultImage->context().drawImageBuffer(*sourceImage, ColorSpaceDeviceRGB, IntPoint());
+    resultImage->context().drawImageBuffer(*sourceImage, IntPoint());
 }
 
 void SourceGraphic::dump()
index 6ced611..b38ce84 100644 (file)
@@ -497,7 +497,7 @@ void MediaPlayerPrivateGStreamerBase::paint(GraphicsContext& context, const Floa
         return;
 
     if (Image* image = reinterpret_cast<Image*>(gstImage->image().get()))
-        context.drawImage(*image, ColorSpaceSRGB, rect, gstImage->rect(), CompositeCopy);
+        context.drawImage(*image, rect, gstImage->rect(), CompositeCopy);
 }
 
 #if USE(TEXTURE_MAPPER_GL) && !USE(COORDINATED_GRAPHICS)
index be35076..215915f 100644 (file)
@@ -68,7 +68,7 @@ void Icon::paint(GraphicsContext& context, const FloatRect& destRect)
     FloatRect srcRect(FloatPoint(), size);
 
     context.setImageInterpolationQuality(InterpolationHigh);
-    context.drawNativeImage(m_cgImage.get(), size, ColorSpaceDeviceRGB, destRect, srcRect);
+    context.drawNativeImage(m_cgImage.get(), size, destRect, srcRect);
 }
 
 }
index 6982854..064243b 100644 (file)
@@ -43,7 +43,7 @@ public:
 
     virtual void paintToSurfaceContext(GraphicsContext& context) override
     {
-        context.drawImage(m_image, ColorSpaceDeviceRGB, m_rect, m_rect);
+        context.drawImage(m_image, m_rect, m_rect);
     }
 
 private:
index fe28151..db86f95 100644 (file)
@@ -43,7 +43,7 @@ public:
     {
         if (m_supportsAlpha) {
             context.setCompositeOperation(CompositeCopy);
-            context.fillRect(IntRect(IntPoint::zero(), m_size), Color::transparent, ColorSpaceDeviceRGB);
+            context.fillRect(IntRect(IntPoint::zero(), m_size), Color::transparent);
             context.setCompositeOperation(CompositeSourceOver);
         }
 
index a27a2ef..dbbfc6b 100644 (file)
@@ -183,17 +183,15 @@ void FontCascade::drawGlyphs(GraphicsContext& graphicsContext, const Font& font,
     FloatSize shadowOffset;
     float shadowBlur;
     Color shadowColor;
-    ColorSpace shadowColorSpace;
-    graphicsContext.getShadow(shadowOffset, shadowBlur, shadowColor, shadowColorSpace);
+    graphicsContext.getShadow(shadowOffset, shadowBlur, shadowColor);
 
     bool hasSimpleShadow = graphicsContext.textDrawingMode() == TextModeFill && shadowColor.isValid() && !shadowBlur && (!graphicsContext.shadowsIgnoreTransforms() || graphicsContext.getCTM().isIdentityOrTranslationOrFlipped());
     if (hasSimpleShadow) {
         // Paint simple shadows ourselves instead of relying on CG shadows, to avoid losing subpixel antialiasing.
         graphicsContext.clearShadow();
         Color fillColor = graphicsContext.fillColor();
-        ColorSpace fillColorSpace = graphicsContext.fillColorSpace();
         Color shadowFillColor(shadowColor.red(), shadowColor.green(), shadowColor.blue(), shadowColor.alpha() * fillColor.alpha() / 255);
-        graphicsContext.setFillColor(shadowFillColor, shadowColorSpace);
+        graphicsContext.setFillColor(shadowFillColor);
         float shadowTextX = point.x() + translation.width() + shadowOffset.width();
         // If shadows are ignoring transforms, then we haven't applied the Y coordinate flip yet, so down is negative.
         float shadowTextY = point.y() + translation.height() + shadowOffset.height() * (graphicsContext.shadowsIgnoreTransforms() ? -1 : 1);
@@ -203,7 +201,7 @@ void FontCascade::drawGlyphs(GraphicsContext& graphicsContext, const Font& font,
             CGContextSetTextPosition(cgContext, point.x() + translation.width() + shadowOffset.width() + font.syntheticBoldOffset(), point.y() + translation.height() + shadowOffset.height());
             CGContextShowGlyphsWithAdvances(cgContext, glyphBuffer.glyphs(from), static_cast<const CGSize*>(glyphBuffer.advances(from)), numGlyphs);
         }
-        graphicsContext.setFillColor(fillColor, fillColorSpace);
+        graphicsContext.setFillColor(fillColor);
     }
 
     CGContextSetTextPosition(cgContext, point.x() + translation.width(), point.y() + translation.height());
@@ -214,7 +212,7 @@ void FontCascade::drawGlyphs(GraphicsContext& graphicsContext, const Font& font,
     }
 
     if (hasSimpleShadow)
-        graphicsContext.setShadow(shadowOffset, shadowBlur, shadowColor, shadowColorSpace);
+        graphicsContext.setShadow(shadowOffset, shadowBlur, shadowColor);
 
     wkRestoreFontSmoothingStyle(cgContext, oldFontSmoothingStyle);
 }
index 274227b..a873d83 100644 (file)
@@ -82,8 +82,8 @@ void GraphicsContext::platformInit(HDC hdc, bool hasAlpha)
     setPaintingDisabled(!m_data->m_cgContext);
     if (m_data->m_cgContext) {
         // Make sure the context starts in sync with our state.
-        setPlatformFillColor(fillColor(), fillColorSpace());
-        setPlatformStrokeColor(strokeColor(), strokeColorSpace());
+        setPlatformFillColor(fillColor());
+        setPlatformStrokeColor(strokeColor());
     }
 }
 
@@ -144,7 +144,7 @@ void GraphicsContext::drawFocusRing(const Vector<IntRect>& rects, int width, int
 
     float radius = (width - 1) / 2.0f;
     offset += radius;
-    CGColorRef colorRef = color.isValid() ? cachedCGColor(color, ColorSpaceDeviceRGB) : 0;
+    CGColorRef colorRef = color.isValid() ? cachedCGColor(color) : nullptr;
 
     CGMutablePathRef focusRingPath = CGPathCreateMutable();
     unsigned rectCount = rects.size();
index 3e8f77d..2fcb763 100644 (file)
@@ -85,8 +85,8 @@ void GraphicsContext::platformInit(HDC dc, bool hasAlpha)
     m_data->m_hdc = dc;
     if (platformContext()->cr()) {
         // Make sure the context starts in sync with our state.
-        setPlatformFillColor(fillColor(), fillColorSpace());
-        setPlatformStrokeColor(strokeColor(), strokeColorSpace());
+        setPlatformFillColor(fillColor());
+        setPlatformStrokeColor(strokeColor());
     }
     if (cr)
         cairo_destroy(cr);
index 0834707..62d4980 100644 (file)
@@ -76,9 +76,9 @@ bool BitmapImage::getHBITMAPOfSize(HBITMAP bmp, const IntSize* size)
 
     FloatSize imageSize = BitmapImage::size();
     if (size)
-        drawFrameMatchingSourceSize(gc, FloatRect(0.0f, 0.0f, bmpInfo.bmWidth, bmpInfo.bmHeight), *size, ColorSpaceDeviceRGB, CompositeCopy);
+        drawFrameMatchingSourceSize(gc, FloatRect(0.0f, 0.0f, bmpInfo.bmWidth, bmpInfo.bmHeight), *size, CompositeCopy);
     else
-        draw(gc, FloatRect(0.0f, 0.0f, bmpInfo.bmWidth, bmpInfo.bmHeight), FloatRect(0.0f, 0.0f, imageSize.width(), imageSize.height()), ColorSpaceDeviceRGB, CompositeCopy, BlendModeNormal, ImageOrientationDescription());
+        draw(gc, FloatRect(0.0f, 0.0f, bmpInfo.bmWidth, bmpInfo.bmHeight), FloatRect(0.0f, 0.0f, imageSize.width(), imageSize.height()), CompositeCopy, BlendModeNormal, ImageOrientationDescription());
 
     // Do cleanup
     CGContextRelease(cgContext);
@@ -86,7 +86,7 @@ bool BitmapImage::getHBITMAPOfSize(HBITMAP bmp, const IntSize* size)
     return true;
 }
 
-void BitmapImage::drawFrameMatchingSourceSize(GraphicsContext& ctxt, const FloatRect& dstRect, const IntSize& srcSize, ColorSpace styleColorSpace, CompositeOperator compositeOp)
+void BitmapImage::drawFrameMatchingSourceSize(GraphicsContext& ctxt, const FloatRect& dstRect, const IntSize& srcSize, CompositeOperator compositeOp)
 {
     size_t frames = frameCount();
     for (size_t i = 0; i < frames; ++i) {
index c43480b..29a2023 100644 (file)
@@ -79,9 +79,9 @@ bool BitmapImage::getHBITMAPOfSize(HBITMAP bmp, const IntSize* size)
 
     FloatSize imageSize = BitmapImage::size();
     if (size)
-        drawFrameMatchingSourceSize(gc, FloatRect(0.0f, 0.0f, bmpInfo.bmWidth, bmpInfo.bmHeight), *size, ColorSpaceDeviceRGB, CompositeCopy);
+        drawFrameMatchingSourceSize(gc, FloatRect(0.0f, 0.0f, bmpInfo.bmWidth, bmpInfo.bmHeight), *size, CompositeCopy);
     else
-        draw(gc, FloatRect(0.0f, 0.0f, bmpInfo.bmWidth, bmpInfo.bmHeight), FloatRect(0.0f, 0.0f, imageSize.width(), imageSize.height()), ColorSpaceDeviceRGB, CompositeCopy, BlendModeNormal, ImageOrientationDescription());
+        draw(gc, FloatRect(0.0f, 0.0f, bmpInfo.bmWidth, bmpInfo.bmHeight), FloatRect(0.0f, 0.0f, imageSize.width(), imageSize.height()), CompositeCopy, BlendModeNormal, ImageOrientationDescription());
 
     // Do cleanup
     cairo_destroy(targetRef);
@@ -89,7 +89,7 @@ bool BitmapImage::getHBITMAPOfSize(HBITMAP bmp, const IntSize* size)
     return true;
 }
 
-void BitmapImage::drawFrameMatchingSourceSize(GraphicsContext& ctxt, const FloatRect& dstRect, const IntSize& srcSize, ColorSpace styleColorSpace, CompositeOperator compositeOp)
+void BitmapImage::drawFrameMatchingSourceSize(GraphicsContext& ctxt, const FloatRect& dstRect, const IntSize& srcSize, CompositeOperator compositeOp)
 {
     size_t frames = frameCount();
     for (size_t i = 0; i < frames; ++i) {
@@ -100,7 +100,7 @@ void BitmapImage::drawFrameMatchingSourceSize(GraphicsContext& ctxt, const Float
         if (cairo_image_surface_get_height(surface.get()) == static_cast<size_t>(srcSize.height()) && cairo_image_surface_get_width(surface.get()) == static_cast<size_t>(srcSize.width())) {
             size_t currentFrame = m_currentFrame;
             m_currentFrame = i;
-            draw(ctxt, dstRect, FloatRect(0.0f, 0.0f, srcSize.width(), srcSize.height()), ColorSpaceDeviceRGB, compositeOp, BlendModeNormal, ImageOrientationDescription());
+            draw(ctxt, dstRect, FloatRect(0.0f, 0.0f, srcSize.width(), srcSize.height()), compositeOp, BlendModeNormal, ImageOrientationDescription());
             m_currentFrame = currentFrame;
             return;
         }
@@ -108,7 +108,7 @@ void BitmapImage::drawFrameMatchingSourceSize(GraphicsContext& ctxt, const Float
 
     // No image of the correct size was found, fallback to drawing the current frame
     FloatSize imageSize = BitmapImage::size();
-    draw(ctxt, dstRect, FloatRect(0.0f, 0.0f, imageSize.width(), imageSize.height()), ColorSpaceDeviceRGB, compositeOp, BlendModeNormal, ImageOrientationDescription());
+    draw(ctxt, dstRect, FloatRect(0.0f, 0.0f, imageSize.width(), imageSize.height()), compositeOp, BlendModeNormal, ImageOrientationDescription());
 }
 
 } // namespace WebCore
index a71b829..d8d1055 100644 (file)
@@ -580,7 +580,7 @@ void LegacyTileCache::drawLayer(LegacyTileLayer* layer, CGContextRef context)
         CGContextSaveGState(context);
 
         CGContextTranslateCTM(context, frame.origin.x, frame.origin.y);
-        CGContextSetFillColorWithColor(context, cachedCGColor(colorForGridTileBorder([layer tileGrid]), ColorSpaceDeviceRGB));
+        CGContextSetFillColorWithColor(context, cachedCGColor(colorForGridTileBorder([layer tileGrid])));
         
         CGRect labelBounds = [layer bounds];
         labelBounds.size.width = 10 + 12 * strlen(text);
index 2a9a5fc..30a7dbc 100644 (file)
@@ -117,7 +117,7 @@ void LegacyTileGridTile::showBorder(bool flag)
 {
     LegacyTileLayer* layer = m_tileLayer.get();
     if (flag) {
-        [layer setBorderColor:cachedCGColor(m_tileGrid->tileCache().colorForGridTileBorder(m_tileGrid), ColorSpaceDeviceRGB)];
+        [layer setBorderColor:cachedCGColor(m_tileGrid->tileCache().colorForGridTileBorder(m_tileGrid))];
         [layer setBorderWidth:0.5f];
     } else {
         [layer setBorderColor:nil];
index f6ec909..3e2a8d6 100644 (file)
@@ -165,7 +165,7 @@ void WebVideoFullscreenControllerContext::didSetupFullscreen()
     RefPtr<WebVideoFullscreenControllerContext> strongThis(this);
     RetainPtr<CALayer> videoFullscreenLayer = [m_videoFullscreenView layer];
     WebThreadRun([strongThis, this, videoFullscreenLayer] {
-        [videoFullscreenLayer setBackgroundColor:cachedCGColor(WebCore::Color::transparent, WebCore::ColorSpaceDeviceRGB)];
+        [videoFullscreenLayer setBackgroundColor:cachedCGColor(WebCore::Color::transparent)];
         m_model->setVideoFullscreenLayer(videoFullscreenLayer.get());
         dispatch_async(dispatch_get_main_queue(), [strongThis, this] {
             m_interface->enterFullscreen();
index 5fb052d..416d5dd 100644 (file)
@@ -232,7 +232,7 @@ static void drawAtPoint(NSString *string, NSPoint point, NSFont *font, NSColor *
         CGFloat blue;
         CGFloat alpha;
         [[textColor colorUsingColorSpaceName:NSDeviceRGBColorSpace] getRed:&red green:&green blue:&blue alpha:&alpha];
-        graphicsContext.setFillColor(makeRGBA(red * 255, green * 255, blue * 255, alpha * 255), ColorSpaceDeviceRGB);
+        graphicsContext.setFillColor(makeRGBA(red * 255, green * 255, blue * 255, alpha * 255));
         
         webCoreFont.drawText(graphicsContext, run, FloatPoint(point.x, (flipped ? point.y : (-1 * point.y))));
         
index e93d872..9cfd048 100644 (file)
@@ -546,7 +546,7 @@ void ScrollbarThemeMac::setUpOverhangAreaBackground(CALayer *layer, const Color&
     static CGColorRef cachedLinenBackgroundColor = linenBackgroundColor().leakRef();
     // We operate on the CALayer directly here, since GraphicsLayer doesn't have the concept
     // of pattern images, and we know that WebCore won't touch this layer.
-    layer.backgroundColor = customBackgroundColor.isValid() ? cachedCGColor(customBackgroundColor, ColorSpaceDeviceRGB) : cachedLinenBackgroundColor;
+    layer.backgroundColor = customBackgroundColor.isValid() ? cachedCGColor(customBackgroundColor) : cachedLinenBackgroundColor;
 }
 
 void ScrollbarThemeMac::removeOverhangAreaBackground(CALayer *layer)
index e7591be..f1e2113 100644 (file)
@@ -692,7 +692,7 @@ bool ThemeMac::drawCellOrFocusRingWithViewIntoContext(NSCell *cell, GraphicsCont
             LocalCurrentGraphicsContext localContext(imageBuffer->context());
             needsRepaint = drawCellOrFocusRingIntoRectWithView(cell, imageBufferDrawRect, view, drawButtonCell, drawFocusRing);
         }
-        context.drawImageBuffer(*imageBuffer, ColorSpaceSRGB, rect.location() - FloatSize(buttonFocusRectOutlineWidth, buttonFocusRectOutlineWidth));
+        context.drawImageBuffer(*imageBuffer, rect.location() - FloatSize(buttonFocusRectOutlineWidth, buttonFocusRectOutlineWidth));
         return needsRepaint;
     }
     if (drawButtonCell)
index b053c42..6b65668 100644 (file)
@@ -235,7 +235,7 @@ void MediaStreamPrivate::paintCurrentFrameInContext(GraphicsContext& context, co
         context.translate(rect.x(), rect.y() + rect.height());
         context.scale(FloatSize(1, -1));
         IntRect paintRect(IntPoint(0, 0), IntSize(rect.width(), rect.height()));
-        context.fillRect(paintRect, Color::black, ColorSpaceDeviceRGB);
+        context.fillRect(paintRect, Color::black);
     }
 }
 
index 995447b..9ad757f 100644 (file)
@@ -44,13 +44,13 @@ int ScrollbarThemeMock::scrollbarThickness(ScrollbarControlSize controlSize)
 
 void ScrollbarThemeMock::paintTrackBackground(GraphicsContext& context, Scrollbar& scrollbar, const IntRect& trackRect)
 {
-    context.fillRect(trackRect, scrollbar.enabled() ? Color::lightGray : Color(0xFFE0E0E0), ColorSpaceDeviceRGB);
+    context.fillRect(trackRect, scrollbar.enabled() ? Color::lightGray : Color(0xFFE0E0E0));
 }
 
 void ScrollbarThemeMock::paintThumb(GraphicsContext& context, Scrollbar& scrollbar, const IntRect& thumbRect)
 {
     if (scrollbar.enabled())
-        context.fillRect(thumbRect, Color::darkGray, ColorSpaceDeviceRGB);
+        context.fillRect(thumbRect, Color::darkGray);
 }
 
 }
index 7f3fe34..8e4cd89 100644 (file)
@@ -192,7 +192,7 @@ DragImageRef createDragImageForLink(URL& url, const String& inLabel, FontRenderi
     static const Color backgroundColor(140, 140, 140);
     static const IntSize radii(DragLabelRadius, DragLabelRadius);
     IntRect rect(0, 0, imageSize.width(), imageSize.height());
-    context.fillRoundedRect(FloatRoundedRect(rect, radii, radii, radii, radii), backgroundColor, ColorSpaceDeviceRGB);
+    context.fillRoundedRect(FloatRoundedRect(rect, radii, radii, radii, radii), backgroundColor);
  
     // Draw the text
     static const Color topColor(0, 0, 0, 255); // original alpha = 0.75
index eedf6fc..53491cb 100644 (file)
@@ -632,18 +632,18 @@ void PopupMenuWin::paint(const IntRect& damageRect, HDC hdc)
 
         // Draw the background for this menu item
         if (itemStyle.isVisible())
-            context.fillRect(itemRect, optionBackgroundColor, ColorSpaceDeviceRGB);
+            context.fillRect(itemRect, optionBackgroundColor);
 
         if (client()->itemIsSeparator(index)) {
             IntRect separatorRect(itemRect.x() + separatorPadding, itemRect.y() + (itemRect.height() - separatorHeight) / 2, itemRect.width() - 2 * separatorPadding, separatorHeight);
-            context.fillRect(separatorRect, optionTextColor, ColorSpaceDeviceRGB);
+            context.fillRect(separatorRect, optionTextColor);
             continue;
         }
 
         String itemText = client()->itemText(index);
 
         TextRun textRun(itemText, 0, 0, AllowTrailingExpansion, itemStyle.textDirection(), itemStyle.hasTextDirectionOverride());
-        context.setFillColor(optionTextColor, ColorSpaceDeviceRGB);
+        context.setFillColor(optionTextColor);
         
         FontCascade itemFont = client()->menuStyle().font();
         if (client()->itemIsLabel(index)) {
index df57e5a..f1cef09 100644 (file)
@@ -49,7 +49,7 @@ static void doDrawTextAtPoint(GraphicsContext& context, const String& text, cons
 {
     TextRun run(text);
 
-    context.setFillColor(color, ColorSpaceDeviceRGB);
+    context.setFillColor(color);
     if (isOneLeftToRightRun(run))
         font.drawText(context, run, point);
     else
@@ -71,7 +71,7 @@ static void doDrawTextAtPoint(GraphicsContext& context, const String& text, cons
         IntPoint underlinePoint(point);
         underlinePoint.move(beforeWidth, 1);
 
-        context.setStrokeColor(color, ColorSpaceDeviceRGB);
+        context.setStrokeColor(color);
         context.drawLineForText(underlinePoint, underlinedWidth, false);
     }
 }
index 2e8fd0b..3685cbe 100644 (file)
@@ -46,11 +46,11 @@ void EllipsisBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset, La
     const RenderStyle& lineStyle = this->lineStyle();
     Color textColor = lineStyle.visitedDependentColor(CSSPropertyWebkitTextFillColor);
     if (textColor != context.fillColor())
-        context.setFillColor(textColor, lineStyle.colorSpace());
+        context.setFillColor(textColor);
     bool setShadow = false;
     if (lineStyle.textShadow()) {
         context.setShadow(LayoutSize(lineStyle.textShadow()->x(), lineStyle.textShadow()->y()),
-            lineStyle.textShadow()->radius(), lineStyle.textShadow()->color(), lineStyle.colorSpace());
+            lineStyle.textShadow()->radius(), lineStyle.textShadow()->color());
         setShadow = true;
     }
 
@@ -61,7 +61,7 @@ void EllipsisBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset, La
         // Select the correct color for painting the text.
         Color foreground = paintInfo.forceTextColor() ? paintInfo.forcedTextColor() : blockFlow().selectionForegroundColor();
         if (foreground.isValid() && foreground != textColor)
-            context.setFillColor(foreground, lineStyle.colorSpace());
+            context.setFillColor(foreground);
     }
 
     // FIXME: Why is this always LTR? Fix by passing correct text run flags below.
@@ -69,7 +69,7 @@ void EllipsisBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset, La
 
     // Restore the regular fill color.
     if (textColor != context.fillColor())
-        context.setFillColor(textColor, lineStyle.colorSpace());
+        context.setFillColor(textColor);
 
     if (setShadow)
         context.clearShadow();
@@ -137,7 +137,7 @@ void EllipsisBox::paintSelection(GraphicsContext& context, const LayoutPoint& pa
     LayoutRect selectionRect = LayoutRect(x() + paintOffset.x(), y() + paintOffset.y() + rootBox.selectionTop(), 0, rootBox.selectionHeight());
     TextRun run = RenderBlock::constructTextRun(&blockFlow(), font, m_str, style, AllowTrailingExpansion);
     font.adjustSelectionRectForText(run, selectionRect, 0, -1);
-    context.fillRect(snapRectToDevicePixelsWithWritingDirection(selectionRect, renderer().document().deviceScaleFactor(), run.ltr()), c, style.colorSpace());
+    context.fillRect(snapRectToDevicePixelsWithWritingDirection(selectionRect, renderer().document().deviceScaleFactor(), run.ltr()), c);
 }
 
 bool EllipsisBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, LayoutUnit lineTop, LayoutUnit lineBottom, HitTestAction hitTestAction)
index 01c7f20..12c69ed 100644 (file)
@@ -429,10 +429,8 @@ void FilterEffectRendererHelper::applyFilterEffect(GraphicsContext& destinationC
     LayoutRect destRect = filter->outputRect();
     destRect.move(m_paintOffset.x(), m_paintOffset.y());
 
-    if (ImageBuffer* outputBuffer = filter->output()) {
-        destinationContext.drawImageBuffer(*outputBuffer, m_renderLayer->renderer().style().colorSpace(),
-            snapRectToDevicePixels(destRect, m_renderLayer->renderer().document().deviceScaleFactor()));
-    }
+    if (ImageBuffer* outputBuffer = filter->output())
+        destinationContext.drawImageBuffer(*outputBuffer, snapRectToDevicePixels(destRect, m_renderLayer->renderer().document().deviceScaleFactor()));
 
     filter->clearIntermediateResults();
 }
index 021a1ab..c78b2ca 100644 (file)
@@ -697,7 +697,7 @@ void InlineTextBox::paintSelection(GraphicsContext& context, const FloatPoint& b
         c = Color(0xff - c.red(), 0xff - c.green(), 0xff - c.blue());
 
     GraphicsContextStateSaver stateSaver(context);
-    updateGraphicsContext(context, TextPaintStyle(c, style.colorSpace())); // Don't draw text at all!
+    updateGraphicsContext(context, TextPaintStyle(c)); // Don't draw text at all!
     
     // If the text is truncated, let the thing being painted in the truncation
     // draw its own highlight.
@@ -724,7 +724,7 @@ void InlineTextBox::paintSelection(GraphicsContext& context, const FloatPoint& b
 
     LayoutRect selectionRect = LayoutRect(boxOrigin.x(), boxOrigin.y() - deltaY, m_logicalWidth, selectionHeight);
     font.adjustSelectionRectForText(textRun, selectionRect, sPos, ePos);
-    context.fillRect(snapRectToDevicePixelsWithWritingDirection(selectionRect, renderer().document().deviceScaleFactor(), textRun.ltr()), c, style.colorSpace());
+    context.fillRect(snapRectToDevicePixelsWithWritingDirection(selectionRect, renderer().document().deviceScaleFactor(), textRun.ltr()), c);
 #else
     UNUSED_PARAM(context);
     UNUSED_PARAM(boxOrigin);
@@ -745,13 +745,13 @@ void InlineTextBox::paintCompositionBackground(GraphicsContext& context, const F
 
     GraphicsContextStateSaver stateSaver(context);
     Color compositionColor = Color::compositionFill;
-    updateGraphicsContext(context, TextPaintStyle(compositionColor, style.colorSpace())); // Don't draw text at all!
+    updateGraphicsContext(context, TextPaintStyle(compositionColor)); // Don't draw text at all!
 
     LayoutUnit deltaY = renderer().style().isFlippedLinesWritingMode() ? selectionBottom() - logicalBottom() : logicalTop() - selectionTop();
     LayoutRect selectionRect = LayoutRect(boxOrigin.x(), boxOrigin.y() - deltaY, 0, selectionHeight());
     TextRun textRun = constructTextRun(style, font);
     font.adjustSelectionRectForText(textRun, selectionRect, sPos, ePos);
-    context.fillRect(snapRectToDevicePixelsWithWritingDirection(selectionRect, renderer().document().deviceScaleFactor(), textRun.ltr()), compositionColor, style.colorSpace());
+    context.fillRect(snapRectToDevicePixelsWithWritingDirection(selectionRect, renderer().document().deviceScaleFactor(), textRun.ltr()), compositionColor);
 }
 
 static StrokeStyle textDecorationStyleToStrokeStyle(TextDecorationStyle decorationStyle)
@@ -949,7 +949,6 @@ void InlineTextBox::paintDecoration(GraphicsContext& context, const FloatPoint&
         setClip = true;
     }
 
-    ColorSpace colorSpace = renderer().style().colorSpace();
     bool setShadow = false;
 
     do {
@@ -961,7 +960,7 @@ void InlineTextBox::paintDecoration(GraphicsContext& context, const FloatPoint&
             }
             int shadowX = isHorizontal() ? shadow->x() : shadow->y();
             int shadowY = isHorizontal() ? shadow->y() : -shadow->x();
-            context.setShadow(FloatSize(shadowX, shadowY - extraOffset), shadow->radius(), shadow->color(), colorSpace);
+            context.setShadow(FloatSize(shadowX, shadowY - extraOffset), shadow->radius(), shadow->color());
             setShadow = true;
             shadow = shadow->next();
         }
@@ -970,7 +969,7 @@ void InlineTextBox::paintDecoration(GraphicsContext& context, const FloatPoint&
 
         // These decorations should match the visual overflows computed in visualOverflowForDecorations()
         if (decoration & TextDecorationUnderline) {
-            context.setStrokeColor(underlineColor, colorSpace);
+            context.setStrokeColor(underlineColor);
             context.setStrokeStyle(textDecorationStyleToStrokeStyle(underlineStyle));
             const int underlineOffset = computeUnderlineOffset(lineStyle.textUnderlinePosition(), lineStyle.fontMetrics(), this, textDecorationThickness);
 
@@ -994,7 +993,7 @@ void InlineTextBox::paintDecoration(GraphicsContext& context, const FloatPoint&
             }
         }
         if (decoration & TextDecorationOverline) {
-            context.setStrokeColor(overlineColor, colorSpace);
+            context.setStrokeColor(overlineColor);
             context.setStrokeStyle(textDecorationStyleToStrokeStyle(overlineStyle));
             switch (overlineStyle) {
             case TextDecorationStyleWavy: {
@@ -1015,7 +1014,7 @@ void InlineTextBox::paintDecoration(GraphicsContext& context, const FloatPoint&
             }
         }
         if (decoration & TextDecorationLineThrough) {
-            context.setStrokeColor(linethroughColor, colorSpace);
+            context.setStrokeColor(linethroughColor);
             context.setStrokeStyle(textDecorationStyleToStrokeStyle(linethroughStyle));
             switch (linethroughStyle) {
             case TextDecorationStyleWavy: {
@@ -1127,7 +1126,7 @@ void InlineTextBox::paintTextMatchMarker(GraphicsContext& context, const FloatPo
 
     Color color = marker.activeMatch() ? renderer().theme().platformActiveTextSearchHighlightColor() : renderer().theme().platformInactiveTextSearchHighlightColor();
     GraphicsContextStateSaver stateSaver(context);
-    updateGraphicsContext(context, TextPaintStyle(color, style.colorSpace())); // Don't draw text at all!
+    updateGraphicsContext(context, TextPaintStyle(color)); // Don't draw text at all!
 
     // Use same y positioning and height as for selection, so that when the selection and this highlight are on
     // the same word there are no pieces sticking out.
@@ -1142,7 +1141,7 @@ void InlineTextBox::paintTextMatchMarker(GraphicsContext& context, const FloatPo
     if (selectionRect.isEmpty())
         return;
 
-    context.fillRect(snapRectToDevicePixelsWithWritingDirection(selectionRect, renderer().document().deviceScaleFactor(), run.ltr()), color, style.colorSpace());
+    context.fillRect(snapRectToDevicePixelsWithWritingDirection(selectionRect, renderer().document().deviceScaleFactor(), run.ltr()), color);
 }
     
 void InlineTextBox::paintDocumentMarkers(GraphicsContext& context, const FloatPoint& boxOrigin, const RenderStyle& style, const FontCascade& font, bool background)
@@ -1261,7 +1260,7 @@ void InlineTextBox::paintCompositionUnderline(GraphicsContext& context, const Fl
     start += 1;
     width -= 2;
 
-    context.setStrokeColor(underline.color, renderer().style().colorSpace());
+    context.setStrokeColor(underline.color);
     context.setStrokeThickness(lineThickness);
     context.drawLineForText(FloatPoint(boxOrigin.x() + start, boxOrigin.y() + logicalHeight() - lineThickness), width, renderer().document().printing());
 }
index 731a0a1..93c706c 100644 (file)
@@ -1973,7 +1973,7 @@ LayoutRect RenderBlock::blockSelectionGap(RenderBlock& rootBlock, const LayoutPo
 
     LayoutRect gapRect = rootBlock.logicalRectToPhysicalRect(rootBlockPhysicalPosition, LayoutRect(logicalLeft, logicalTop, logicalWidth, logicalHeight));
     if (paintInfo)
-        paintInfo->context().fillRect(snapRectToDevicePixels(gapRect, document().deviceScaleFactor()), selectionBackgroundColor(), style().colorSpace());
+        paintInfo->context().fillRect(snapRectToDevicePixels(gapRect, document().deviceScaleFactor()), selectionBackgroundColor());
     return gapRect;
 }
 
@@ -1990,7 +1990,7 @@ LayoutRect RenderBlock::logicalLeftSelectionGap(RenderBlock& rootBlock, const La
 
     LayoutRect gapRect = rootBlock.logicalRectToPhysicalRect(rootBlockPhysicalPosition, LayoutRect(rootBlockLogicalLeft, rootBlockLogicalTop, rootBlockLogicalWidth, logicalHeight));
     if (paintInfo)
-        paintInfo->context().fillRect(snapRectToDevicePixels(gapRect, document().deviceScaleFactor()), selObj->selectionBackgroundColor(), selObj->style().colorSpace());
+        paintInfo->context().fillRect(snapRectToDevicePixels(gapRect, document().deviceScaleFactor()), selObj->selectionBackgroundColor());
     return gapRect;
 }
 
@@ -2007,7 +2007,7 @@ LayoutRect RenderBlock::logicalRightSelectionGap(RenderBlock& rootBlock, const L
 
     LayoutRect gapRect = rootBlock.logicalRectToPhysicalRect(rootBlockPhysicalPosition, LayoutRect(rootBlockLogicalLeft, rootBlockLogicalTop, rootBlockLogicalWidth, logicalHeight));
     if (paintInfo)
-        paintInfo->context().fillRect(snapRectToDevicePixels(gapRect, document().deviceScaleFactor()), selObj->selectionBackgroundColor(), selObj->style().colorSpace());
+        paintInfo->context().fillRect(snapRectToDevicePixels(gapRect, document().deviceScaleFactor()), selObj->selectionBackgroundColor());
     return gapRect;
 }
 
index 2e0c762..3573c13 100644 (file)
@@ -1545,7 +1545,7 @@ void RenderBox::paintClippingMask(PaintInfo& paintInfo, const LayoutPoint& paint
         return;
 
     LayoutRect paintRect = LayoutRect(paintOffset, size());
-    paintInfo.context().fillRect(snappedIntRect(paintRect), Color::black, style().colorSpace());
+    paintInfo.context().fillRect(snappedIntRect(paintRect), Color::black);
 }
 
 void RenderBox::paintMaskImages(const PaintInfo& paintInfo, const LayoutRect& paintRect)
index d69c27b..838da85 100644 (file)
@@ -589,9 +589,9 @@ static void applyBoxShadowForBackground(GraphicsContext& context, RenderStyle* s
 
     FloatSize shadowOffset(boxShadow->x(), boxShadow->y());
     if (!boxShadow->isWebkitBoxShadow())
-        context.setShadow(shadowOffset, boxShadow->radius(), boxShadow->color(), style->colorSpace());
+        context.setShadow(shadowOffset, boxShadow->radius(), boxShadow->color());
     else
-        context.setLegacyShadow(shadowOffset, boxShadow->radius(), boxShadow->color(), style->colorSpace());
+        context.setLegacyShadow(shadowOffset, boxShadow->radius(), boxShadow->color());
 }
 
 void RenderBoxModelObject::paintMaskForTextFillBox(ImageBuffer* maskImage, const IntRect& maskRect, InlineFlowBox* box, const LayoutRect& scrolledPaintRect)
@@ -680,15 +680,15 @@ void RenderBoxModelObject::paintFillLayerExtended(const PaintInfo& paintInfo, co
             FloatRoundedRect pixelSnappedBorder = backgroundRoundedRectAdjustedForBleedAvoidance(context, rect, bleedAvoidance, box, boxSize,
                 includeLeftEdge, includeRightEdge).pixelSnappedRoundedRectForPainting(deviceScaleFactor);
             if (pixelSnappedBorder.isRenderable())
-                context.fillRoundedRect(pixelSnappedBorder, bgColor, style().colorSpace());
+                context.fillRoundedRect(pixelSnappedBorder, bgColor);
             else {
                 context.save();
                 clipRoundedInnerRect(context, pixelSnappedRect, pixelSnappedBorder);
-                context.fillRect(pixelSnappedBorder.rect(), bgColor, style().colorSpace());
+                context.fillRect(pixelSnappedBorder.rect(), bgColor);
                 context.restore();
             }
         } else
-            context.fillRect(pixelSnappedRect, bgColor, style().colorSpace());
+            context.fillRect(pixelSnappedRect, bgColor);
 
         return;
     }
@@ -817,10 +817,10 @@ void RenderBoxModelObject::paintFillLayerExtended(const PaintInfo& paintInfo, co
                 if (!baseBgColorOnly && bgColor.alpha())
                     baseColor = baseColor.blend(bgColor);
 
-                context.fillRect(backgroundRectForPainting, baseColor, style().colorSpace(), CompositeCopy);
+                context.fillRect(backgroundRectForPainting, baseColor, CompositeCopy);
             } else if (!baseBgColorOnly && bgColor.alpha()) {
                 CompositeOperator operation = shouldClearBackground ? CompositeCopy : context.compositeOperation();
-                context.fillRect(backgroundRectForPainting, bgColor, style().colorSpace(), operation);
+                context.fillRect(backgroundRectForPainting, bgColor, operation);
             } else if (shouldClearBackground)
                 context.clearRect(backgroundRectForPainting);
         }
@@ -835,12 +835,12 @@ void RenderBoxModelObject::paintFillLayerExtended(const PaintInfo& paintInfo, co
             CompositeOperator compositeOp = op == CompositeSourceOver ? bgLayer->composite() : op;
             context.setDrawLuminanceMask(bgLayer->maskSourceType() == MaskLuminance);
             bool useLowQualityScaling = shouldPaintAtLowQuality(context, *image, bgLayer, geometry.tileSize());
-            context.drawTiledImage(*image, style().colorSpace(), geometry.destRect(), toLayoutPoint(geometry.relativePhase()), geometry.tileSize(), geometry.spaceSize(), ImagePaintingOptions(compositeOp, bgLayer->blendMode(), ImageOrientationDescription(), useLowQualityScaling));
+            context.drawTiledImage(*image, geometry.destRect(), toLayoutPoint(geometry.relativePhase()), geometry.tileSize(), geometry.spaceSize(), ImagePaintingOptions(compositeOp, bgLayer->blendMode(), ImageOrientationDescription(), useLowQualityScaling));
         }
     }
 
     if (maskImage && bgLayer->clip() == TextFillBox) {
-        context.drawImageBuffer(*maskImage, ColorSpaceDeviceRGB, maskRect, CompositeDestinationIn);
+        context.drawImageBuffer(*maskImage, maskRect, CompositeDestinationIn);
         context.endTransparencyLayer();
     }
 }
@@ -1691,7 +1691,7 @@ void RenderBoxModelObject::paintBorder(const PaintInfo& info, const LayoutRect&
                 path.addRect(pixelSnappedInnerBorder.rect());
             
             graphicsContext.setFillRule(RULE_EVENODD);
-            graphicsContext.setFillColor(edges[firstVisibleEdge].color(), style.colorSpace());
+            graphicsContext.setFillColor(edges[firstVisibleEdge].color());
             graphicsContext.fillPath(path);
             return;
         } 
@@ -1708,7 +1708,7 @@ void RenderBoxModelObject::paintBorder(const PaintInfo& info, const LayoutRect&
             }
 
             graphicsContext.setFillRule(RULE_NONZERO);
-            graphicsContext.setFillColor(edges[firstVisibleEdge].color(), style.colorSpace());
+            graphicsContext.setFillColor(edges[firstVisibleEdge].color());
             graphicsContext.fillPath(path);
             return;
         }
@@ -1752,7 +1752,7 @@ void RenderBoxModelObject::drawBoxSideFromPath(GraphicsContext& graphicsContext,
         return;
     case DOTTED:
     case DASHED: {
-        graphicsContext.setStrokeColor(color, style.colorSpace());
+        graphicsContext.setStrokeColor(color);
 
         // The stroke is doubled here because the provided path is the 
         // outside edge of the border so half the stroke is clipped off. 
@@ -1880,7 +1880,7 @@ void RenderBoxModelObject::drawBoxSideFromPath(GraphicsContext& graphicsContext,
     }
 
     graphicsContext.setStrokeStyle(NoStroke);
-    graphicsContext.setFillColor(color, style.colorSpace());
+    graphicsContext.setFillColor(color);
     graphicsContext.drawRect(snapRectToDevicePixels(borderRect, document().deviceScaleFactor()));
 }
 
@@ -2265,9 +2265,9 @@ void RenderBoxModelObject::paintBoxShadow(const PaintInfo& info, const LayoutRec
             fillRect.move(extraOffset);
 
             if (shadow->isWebkitBoxShadow())
-                context.setLegacyShadow(shadowOffset, shadowRadius, shadowColor, style.colorSpace());
+                context.setLegacyShadow(shadowOffset, shadowRadius, shadowColor);
             else
-                context.setShadow(shadowOffset, shadowRadius, shadowColor, style.colorSpace());
+                context.setShadow(shadowOffset, shadowRadius, shadowColor);
 
             FloatRoundedRect rectToClipOut = border.pixelSnappedRoundedRectForPainting(deviceScaleFactor);
             FloatRoundedRect pixelSnappedFillRect = fillRect.pixelSnappedRoundedRectForPainting(deviceScaleFactor);
@@ -2285,12 +2285,12 @@ void RenderBoxModelObject::paintBoxShadow(const PaintInfo& info, const LayoutRec
                 influenceRect.expandRadii(2 * shadowPaintingExtent + shadowSpread);
 
                 if (allCornersClippedOut(influenceRect, info.rect))
-                    context.fillRect(pixelSnappedFillRect.rect(), Color::black, style.colorSpace());
+                    context.fillRect(pixelSnappedFillRect.rect(), Color::black);
                 else {
                     pixelSnappedFillRect.expandRadii(shadowSpread);
                     if (!pixelSnappedFillRect.isRenderable())
                         pixelSnappedFillRect.adjustRadii();
-                    context.fillRoundedRect(pixelSnappedFillRect, Color::black, style.colorSpace());
+                    context.fillRoundedRect(pixelSnappedFillRect, Color::black);
                 }
             } else {
                 // If the box is opaque, it is unnecessary to clip it out. However, doing so saves time
@@ -2307,7 +2307,7 @@ void RenderBoxModelObject::paintBoxShadow(const PaintInfo& info, const LayoutRec
 
                 if (!rectToClipOut.isEmpty())
                     context.clipOut(rectToClipOut.rect());
-                context.fillRect(pixelSnappedFillRect.rect(), Color::black, style.colorSpace());
+                context.fillRect(pixelSnappedFillRect.rect(), Color::black);
             }
         } else {
             // Inset shadow.
@@ -2317,9 +2317,9 @@ void RenderBoxModelObject::paintBoxShadow(const PaintInfo& info, const LayoutRec
 
             if (pixelSnappedHoleRect.isEmpty()) {
                 if (hasBorderRadius)
-                    context.fillRoundedRect(pixelSnappedBorderRect, shadowColor, style.colorSpace());
+                    context.fillRoundedRect(pixelSnappedBorderRect, shadowColor);
                 else
-                    context.fillRect(pixelSnappedBorderRect.rect(), shadowColor, style.colorSpace());
+                    context.fillRect(pixelSnappedBorderRect.rect(), shadowColor);
                 continue;
             }
 
@@ -2356,11 +2356,11 @@ void RenderBoxModelObject::paintBoxShadow(const PaintInfo& info, const LayoutRec
             shadowOffset -= extraOffset;
 
             if (shadow->isWebkitBoxShadow())
-                context.setLegacyShadow(shadowOffset, shadowRadius, shadowColor, style.colorSpace());
+                context.setLegacyShadow(shadowOffset, shadowRadius, shadowColor);
             else
-                context.setShadow(shadowOffset, shadowRadius, shadowColor, style.colorSpace());
+                context.setShadow(shadowOffset, shadowRadius, shadowColor);
 
-            context.fillRectWithRoundedHole(pixelSnappedOuterRect, pixelSnappedRoundedHole, fillColor, style.colorSpace());
+            context.fillRectWithRoundedHole(pixelSnappedOuterRect, pixelSnappedRoundedHole, fillColor);
         }
     }
 }
index b53f2af..5c66b77 100644 (file)
@@ -130,10 +130,10 @@ void RenderDetailsMarker::paint(PaintInfo& paintInfo, const LayoutPoint& paintOf
         return;
 
     const Color color(style().visitedDependentColor(CSSPropertyColor));
-    paintInfo.context().setStrokeColor(color, style().colorSpace());
+    paintInfo.context().setStrokeColor(color);
     paintInfo.context().setStrokeStyle(SolidStroke);
     paintInfo.context().setStrokeThickness(1.0f);
-    paintInfo.context().setFillColor(color, style().colorSpace());
+    paintInfo.context().setFillColor(color);
 
     boxOrigin.move(borderLeft() + paddingLeft(), borderTop() + paddingTop());
     paintInfo.context().fillPath(getPath(boxOrigin));
index e70038e..8c2ea08 100644 (file)
@@ -1820,7 +1820,6 @@ void RenderElement::drawLineForBoxSide(GraphicsContext& graphicsContext, const F
     if (borderStyle == DOUBLE && (thickness * deviceScaleFactor) < 3)
         borderStyle = SOLID;
 
-    const RenderStyle& style = this->style();
     switch (borderStyle) {
     case BNONE:
     case BHIDDEN:
@@ -1830,7 +1829,7 @@ void RenderElement::drawLineForBoxSide(GraphicsContext& graphicsContext, const F
         bool wasAntialiased = graphicsContext.shouldAntialias();
         StrokeStyle oldStrokeStyle = graphicsContext.strokeStyle();
         graphicsContext.setShouldAntialias(antialias);
-        graphicsContext.setStrokeColor(color, style.colorSpace());
+        graphicsContext.setStrokeColor(color);
         graphicsContext.setStrokeThickness(thickness);
         graphicsContext.setStrokeStyle(borderStyle == DASHED ? DashedStroke : DottedStroke);
         graphicsContext.drawLine(roundPointToDevicePixels(LayoutPoint(x1, y1), deviceScaleFactor), roundPointToDevicePixels(LayoutPoint(x2, y2), deviceScaleFactor));
@@ -1845,7 +1844,7 @@ void RenderElement::drawLineForBoxSide(GraphicsContext& graphicsContext, const F
         if (!adjacentWidth1 && !adjacentWidth2) {
             StrokeStyle oldStrokeStyle = graphicsContext.strokeStyle();
             graphicsContext.setStrokeStyle(NoStroke);
-            graphicsContext.setFillColor(color, style.colorSpace());
+            graphicsContext.setFillColor(color);
 
             bool wasAntialiased = graphicsContext.shouldAntialias();
             graphicsContext.setShouldAntialias(antialias);
@@ -1996,7 +1995,7 @@ void RenderElement::drawLineForBoxSide(GraphicsContext& graphicsContext, const F
             // Turn off antialiasing to match the behavior of drawConvexPolygon();
             // this matters for rects in transformed contexts.
             graphicsContext.setStrokeStyle(NoStroke);
-            graphicsContext.setFillColor(color, style.colorSpace());
+            graphicsContext.setFillColor(color);
             bool wasAntialiased = graphicsContext.shouldAntialias();
             graphicsContext.setShouldAntialias(antialias);
             graphicsContext.drawRect(snapRectToDevicePixels(x1, y1, x2 - x1, y2 - y1, deviceScaleFactor));
@@ -2040,7 +2039,7 @@ void RenderElement::drawLineForBoxSide(GraphicsContext& graphicsContext, const F
         }
 
         graphicsContext.setStrokeStyle(NoStroke);
-        graphicsContext.setFillColor(color, style.colorSpace());
+        graphicsContext.setFillColor(color);
         graphicsContext.drawConvexPolygon(4, quad, antialias);
         graphicsContext.setStrokeStyle(oldStrokeStyle);
         break;
@@ -2108,7 +2107,7 @@ void RenderElement::paintOutline(PaintInfo& paintInfo, const LayoutRect& paintRe
             path.addRect(outer);
             path.addRect(inner);
             graphicsContext.setFillRule(RULE_EVENODD);
-            graphicsContext.setFillColor(outlineColor, styleToUse.colorSpace());
+            graphicsContext.setFillColor(outlineColor);
             graphicsContext.fillPath(path);
             return;
         }
index a3f8891..136e10b 100644 (file)
@@ -219,7 +219,7 @@ void RenderEmbeddedObject::paintSnapshotImage(PaintInfo& paintInfo, const Layout
 #if ENABLE(CSS_IMAGE_ORIENTATION)
     orientationDescription.setImageOrientationEnum(style().imageOrientation());
 #endif
-    context.drawImage(image, style().colorSpace(), alignedRect, ImagePaintingOptions(orientationDescription, useLowQualityScaling));
+    context.drawImage(image, alignedRect, ImagePaintingOptions(orientationDescription, useLowQualityScaling));
 }
 
 void RenderEmbeddedObject::paintContents(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
@@ -312,7 +312,7 @@ void RenderEmbeddedObject::paintReplaced(PaintInfo& paintInfo, const LayoutPoint
 
     GraphicsContextStateSaver stateSaver(context);
     context.clip(contentRect);
-    context.setFillColor(m_unavailablePluginIndicatorIsPressed ? replacementTextRoundedRectPressedColor() : replacementTextRoundedRectColor(), style().colorSpace());
+    context.setFillColor(m_unavailablePluginIndicatorIsPressed ? replacementTextRoundedRectPressedColor() : replacementTextRoundedRectColor());
     context.fillPath(background);
 
     Path strokePath;
@@ -320,21 +320,21 @@ void RenderEmbeddedObject::paintReplaced(PaintInfo& paintInfo, const LayoutPoint
     strokeRect.inflate(1);
     strokePath.addRoundedRect(strokeRect, FloatSize(replacementTextRoundedRectRadius + 1, replacementTextRoundedRectRadius + 1));
 
-    context.setStrokeColor(unavailablePluginBorderColor(), style().colorSpace());
+    context.setStrokeColor(unavailablePluginBorderColor());
     context.setStrokeThickness(2);
     context.strokePath(strokePath);
 
     const FontMetrics& fontMetrics = font.fontMetrics();
     float labelX = roundf(replacementTextRect.location().x() + replacementTextRoundedRectLeftTextMargin);
     float labelY = roundf(replacementTextRect.location().y() + (replacementTextRect.size().height() - fontMetrics.height()) / 2 + fontMetrics.ascent() + replacementTextRoundedRectTopTextMargin);
-    context.setFillColor(replacementTextColor(), style().colorSpace());
+    context.setFillColor(replacementTextColor());
     context.drawBidiText(font, run, FloatPoint(labelX, labelY));
 
     if (shouldUnavailablePluginMessageBeButton(document(), m_pluginUnavailabilityReason)) {
         arrowRect.inflate(-replacementArrowCirclePadding);
 
         context.beginTransparencyLayer(1.0);
-        context.setFillColor(replacementTextColor(), style().colorSpace());
+        context.setFillColor(replacementTextColor());
         context.fillEllipse(arrowRect);
 
         context.setCompositeOperation(CompositeClear);
index 64ecacb..fd113c4 100644 (file)
@@ -163,7 +163,7 @@ void RenderFileUploadControl::paintObject(PaintInfo& paintInfo, const LayoutPoin
         else
             textY = baselinePosition(AlphabeticBaseline, true, HorizontalLine, PositionOnContainingLine);
 
-        paintInfo.context().setFillColor(style().visitedDependentColor(CSSPropertyColor), style().colorSpace());
+        paintInfo.context().setFillColor(style().visitedDependentColor(CSSPropertyColor));
         
         // Draw the filename
         paintInfo.context().drawBidiText(font, textRun, IntPoint(roundToInt(textX), roundToInt(textY)));
index 2f82dcb..63ca6da 100644 (file)
@@ -91,14 +91,13 @@ void RenderFrameSet::paintColumnBorder(const PaintInfo& paintInfo, const IntRect
     
     // Fill first.
     GraphicsContext& context = paintInfo.context();
-    ColorSpace colorSpace = style().colorSpace();
-    context.fillRect(borderRect, frameSetElement().hasBorderColor() ? style().visitedDependentColor(CSSPropertyBorderLeftColor) : borderFillColor(), colorSpace);
+    context.fillRect(borderRect, frameSetElement().hasBorderColor() ? style().visitedDependentColor(CSSPropertyBorderLeftColor) : borderFillColor());
     
     // Now stroke the edges but only if we have enough room to paint both edges with a little
     // bit of the fill color showing through.
     if (borderRect.width() >= 3) {
-        context.fillRect(IntRect(borderRect.location(), IntSize(1, height())), borderStartEdgeColor(), colorSpace);
-        context.fillRect(IntRect(IntPoint(borderRect.maxX() - 1, borderRect.y()), IntSize(1, height())), borderEndEdgeColor(), colorSpace);
+        context.fillRect(IntRect(borderRect.location(), IntSize(1, height())), borderStartEdgeColor());
+        context.fillRect(IntRect(IntPoint(borderRect.maxX() - 1, borderRect.y()), IntSize(1, height())), borderEndEdgeColor());
     }
 }
 
@@ -111,14 +110,13 @@ void RenderFrameSet::paintRowBorder(const PaintInfo& paintInfo, const IntRect& b
     
     // Fill first.
     GraphicsContext& context = paintInfo.context();
-    ColorSpace colorSpace = style().colorSpace();
-    context.fillRect(borderRect, frameSetElement().hasBorderColor() ? style().visitedDependentColor(CSSPropertyBorderLeftColor) : borderFillColor(), colorSpace);
+    context.fillRect(borderRect, frameSetElement().hasBorderColor() ? style().visitedDependentColor(CSSPropertyBorderLeftColor) : borderFillColor());
 
     // Now stroke the edges but only if we have enough room to paint both edges with a little
     // bit of the fill color showing through.
     if (borderRect.height() >= 3) {
-        context.fillRect(IntRect(borderRect.location(), IntSize(width(), 1)), borderStartEdgeColor(), colorSpace);
-        context.fillRect(IntRect(IntPoint(borderRect.x(), borderRect.maxY() - 1), IntSize(width(), 1)), borderEndEdgeColor(), colorSpace);
+        context.fillRect(IntRect(borderRect.location(), IntSize(width(), 1)), borderStartEdgeColor());
+        context.fillRect(IntRect(IntPoint(borderRect.x(), borderRect.maxY() - 1), IntSize(width(), 1)), borderEndEdgeColor());
     }
 }
 
index 1d478bf..14c7a02 100644 (file)
@@ -392,8 +392,8 @@ void RenderImage::paintReplaced(PaintInfo& paintInfo, const LayoutPoint& paintOf
 
             // Draw an outline rect where the image should be.
             context.setStrokeStyle(SolidStroke);
-            context.setStrokeColor(Color::lightGray, style().colorSpace());
-            context.setFillColor(Color::transparent, style().colorSpace());
+            context.setStrokeColor(Color::lightGray);
+            context.setFillColor(Color::transparent);
             context.drawRect(snapRectToDevicePixels(LayoutRect(paintOffset.x() + leftBorder + leftPad, paintOffset.y() + topBorder + topPad, cWidth, cHeight), deviceScaleFactor), borderWidth);
 
             bool errorPictureDrawn = false;
@@ -424,13 +424,13 @@ void RenderImage::paintReplaced(PaintInfo& paintInfo, const LayoutPoint& paintOf
 #if ENABLE(CSS_IMAGE_ORIENTATION)
                 orientationDescription.setImageOrientationEnum(style().imageOrientation());
 #endif
-                context.drawImage(*image, style().colorSpace(), snapRectToDevicePixels(LayoutRect(paintOffset + imageOffset, imageSize), deviceScaleFactor), orientationDescription);
+                context.drawImage(*image, snapRectToDevicePixels(LayoutRect(paintOffset + imageOffset, imageSize), deviceScaleFactor), orientationDescription);
                 errorPictureDrawn = true;
             }
 
             if (!m_altText.isEmpty()) {
                 String text = document().displayStringModifiedByEncoding(m_altText);
-                context.setFillColor(style().visitedDependentColor(CSSPropertyColor), style().colorSpace());
+                context.setFillColor(style().visitedDependentColor(CSSPropertyColor));
                 const FontCascade& font = style().fontCascade();
                 const FontMetrics& fontMetrics = font.fontMetrics();
                 LayoutUnit ascent = fontMetrics.ascent();
@@ -553,7 +553,7 @@ void RenderImage::paintIntoRect(GraphicsContext& context, const FloatRect& rect)
 #if ENABLE(CSS_IMAGE_ORIENTATION)
     orientationDescription.setImageOrientationEnum(style().imageOrientation());
 #endif
-    context.drawImage(*img, style().colorSpace(), rect,
+    context.drawImage(*img, rect,
         ImagePaintingOptions(compositeOperator, BlendModeNormal, orientationDescription, useLowQualityScaling));
 }
 
index dfe16b7..6e217a7 100644 (file)
@@ -1821,7 +1821,7 @@ void RenderLayer::beginTransparencyLayers(GraphicsContext& context, const LayerP
 #endif
 
 #ifdef REVEAL_TRANSPARENCY_LAYERS
-        context->setFillColor(Color(0.0f, 0.0f, 0.5f, 0.2f), ColorSpaceDeviceRGB);
+        context->setFillColor(Color(0.0f, 0.0f, 0.5f, 0.2f));
         context->fillRect(pixelSnappedClipRect);
 #endif
     }
@@ -3608,9 +3608,6 @@ void RenderLayer::paintOverflowControls(GraphicsContext& context, const IntPoint
 
 void RenderLayer::paintScrollCorner(GraphicsContext& context, const IntPoint& paintOffset, const IntRect& damageRect)
 {
-    RenderBox* box = renderBox();
-    ASSERT(box);
-
     IntRect absRect = scrollCornerRect();
     absRect.moveBy(paintOffset);
     if (!absRect.intersects(damageRect))
@@ -3629,7 +3626,7 @@ void RenderLayer::paintScrollCorner(GraphicsContext& context, const IntPoint& pa
     // We don't want to paint white if we have overlay scrollbars, since we need
     // to see what is behind it.
     if (!hasOverlayScrollbars())
-        context.fillRect(absRect, Color::white, box->style().colorSpace());
+        context.fillRect(absRect, Color::white);
 }
 
 void RenderLayer::drawPlatformResizerImage(GraphicsContext& context, const LayoutRect& resizerCornerRect)
@@ -3652,7 +3649,7 @@ void RenderLayer::drawPlatformResizerImage(GraphicsContext& context, const Layou
         context.translate(resizerCornerRect.x() + cornerResizerSize.width(), resizerCornerRect.y() + resizerCornerRect.height() - cornerResizerSize.height());
         context.scale(FloatSize(-1.0, 1.0));
         if (resizeCornerImage)
-            context.drawImage(*resizeCornerImage, renderer().style().colorSpace(), FloatRect(FloatPoint(), cornerResizerSize));
+            context.drawImage(*resizeCornerImage, FloatRect(FloatPoint(), cornerResizerSize));
         context.restore();
         return;
     }
@@ -3660,7 +3657,7 @@ void RenderLayer::drawPlatformResizerImage(GraphicsContext& context, const Layou
     if (!resizeCornerImage)
         return;
     FloatRect imageRect = snapRectToDevicePixels(LayoutRect(resizerCornerRect.maxXMaxYCorner() - cornerResizerSize, cornerResizerSize), renderer().document().deviceScaleFactor());
-    context.drawImage(*resizeCornerImage, renderer().style().colorSpace(), imageRect);
+    context.drawImage(*resizeCornerImage, imageRect);
 }
 
 void RenderLayer::paintResizer(GraphicsContext& context, const LayoutPoint& paintOffset, const LayoutRect& damageRect)
@@ -3695,9 +3692,9 @@ void RenderLayer::paintResizer(GraphicsContext& context, const LayoutPoint& pain
         context.clip(absRect);
         LayoutRect largerCorner = absRect;
         largerCorner.setSize(LayoutSize(largerCorner.width() + LayoutUnit::fromPixel(1), largerCorner.height() + LayoutUnit::fromPixel(1)));
-        context.setStrokeColor(Color(makeRGB(217, 217, 217)), ColorSpaceDeviceRGB);
+        context.setStrokeColor(Color(makeRGB(217, 217, 217)));
         context.setStrokeThickness(1.0f);
-        context.setFillColor(Color::transparent, ColorSpaceDeviceRGB);
+        context.setFillColor(Color::transparent);
         context.drawRect(snappedIntRect(largerCorner));
     }
 }
index e573d50..553170a 100644 (file)
@@ -396,8 +396,7 @@ void RenderListBox::paintItemForeground(PaintInfo& paintInfo, const LayoutPoint&
             textColor = theme().inactiveListBoxSelectionForegroundColor();
     }
 
-    ColorSpace colorSpace = itemStyle.colorSpace();
-    paintInfo.context().setFillColor(textColor, colorSpace);
+    paintInfo.context().setFillColor(textColor);
 
     TextRun textRun(itemText, 0, 0, AllowTrailingExpansion, itemStyle.direction(), isOverride(itemStyle.unicodeBidi()), true, TextRun::NoRounding);
     FontCascade itemFont = style().fontCascade();
@@ -432,10 +431,9 @@ void RenderListBox::paintItemBackground(PaintInfo& paintInfo, const LayoutPoint&
 
     // Draw the background for this list box item
     if (itemStyle.visibility() != HIDDEN) {
-        ColorSpace colorSpace = itemStyle.colorSpace();
         LayoutRect itemRect = itemBoundingBoxRect(paintOffset, listIndex);
         itemRect.intersect(controlClipRect(paintOffset));
-        paintInfo.context().fillRect(snappedIntRect(itemRect), backColor, colorSpace);
+        paintInfo.context().fillRect(snappedIntRect(itemRect), backColor);
     }
 }
 
index f6e346d..476e9c4 100644 (file)
@@ -1198,11 +1198,11 @@ void RenderListMarker::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffse
 
     if (isImage()) {
         if (RefPtr<Image> markerImage = m_image->image(this, marker.size()))
-            context.drawImage(*markerImage, style().colorSpace(), marker);
+            context.drawImage(*markerImage, marker);
         if (selectionState() != SelectionNone) {
             LayoutRect selRect = localSelectionRect();
             selRect.moveBy(boxOrigin);
-            context.fillRect(snappedIntRect(selRect), m_listItem.selectionBackgroundColor(), style().colorSpace());
+            context.fillRect(snappedIntRect(selRect), m_listItem.selectionBackgroundColor());
         }
         return;
     }
@@ -1210,14 +1210,14 @@ void RenderListMarker::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffse
     if (selectionState() != SelectionNone) {
         LayoutRect selRect = localSelectionRect();
         selRect.moveBy(boxOrigin);
-        context.fillRect(snappedIntRect(selRect), m_listItem.selectionBackgroundColor(), style().colorSpace());
+        context.fillRect(snappedIntRect(selRect), m_listItem.selectionBackgroundColor());
     }
 
     const Color color(style().visitedDependentColor(CSSPropertyColor));
-    context.setStrokeColor(color, style().colorSpace());
+    context.setStrokeColor(color);
     context.setStrokeStyle(SolidStroke);
     context.setStrokeThickness(1.0f);
-    context.setFillColor(color, style().colorSpace());
+    context.setFillColor(color);
 
     EListStyleType type = style().listStyleType();
     switch (type) {
@@ -1225,7 +1225,7 @@ void RenderListMarker::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffse
             context.drawEllipse(marker);
             return;
         case Circle:
-            context.setFillColor(Color::transparent, ColorSpaceDeviceRGB);
+            context.setFillColor(Color::transparent);
             context.drawEllipse(marker);
             return;
         case Square:
index 34b55f2..84d44b1 100644 (file)
@@ -197,7 +197,7 @@ void RenderReplaced::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
     if (drawSelectionTint) {
         LayoutRect selectionPaintingRect = localSelectionRect();
         selectionPaintingRect.moveBy(adjustedPaintOffset);
-        paintInfo.context().fillRect(snappedIntRect(selectionPaintingRect), selectionBackgroundColor(), style().colorSpace());
+        paintInfo.context().fillRect(snappedIntRect(selectionPaintingRect), selectionBackgroundColor());
     }
 }
 
index af96118..54fea0c 100644 (file)
@@ -128,7 +128,7 @@ void RenderScrollbarTheme::didPaintScrollbar(GraphicsContext& context, Scrollbar
 void RenderScrollbarTheme::paintScrollCorner(ScrollView*, GraphicsContext& context, const IntRect& cornerRect)
 {
     // FIXME: Implement.
-    context.fillRect(cornerRect, Color::white, ColorSpaceDeviceRGB);
+    context.fillRect(cornerRect, Color::white);
 }
 
 void RenderScrollbarTheme::paintScrollbarBackground(GraphicsContext& context, Scrollbar& scrollbar)
index ec42c62..e8b8f0f 100644 (file)
@@ -141,7 +141,7 @@ void RenderSnapshottedPlugIn::paintSnapshot(PaintInfo& paintInfo, const LayoutPo
 #if ENABLE(CSS_IMAGE_ORIENTATION)
     orientationDescription.setImageOrientationEnum(style().imageOrientation());
 #endif
-    context.drawImage(*image, style().colorSpace(), alignedRect, ImagePaintingOptions(orientationDescription, useLowQualityScaling));
+    context.drawImage(*image, alignedRect, ImagePaintingOptions(orientationDescription, useLowQualityScaling));
 }
 
 CursorDirective RenderSnapshottedPlugIn::getCursor(const LayoutPoint& point, Cursor& overrideCursor) const
index 1aaf369..e5a85cf 100644 (file)
@@ -1036,7 +1036,7 @@ void RenderTheme::paintSliderTicks(const RenderObject& o, const PaintInfo& paint
     }
     Ref<HTMLCollection> options = dataList->options();
     GraphicsContextStateSaver stateSaver(paintInfo.context());
-    paintInfo.context().setFillColor(o.style().visitedDependentColor(CSSPropertyColor), ColorSpaceDeviceRGB);
+    paintInfo.context().setFillColor(o.style().visitedDependentColor(CSSPropertyColor));
     for (unsigned i = 0; Node* node = options->item(i); i++) {
         ASSERT(is<HTMLOptionElement>(*node));
         HTMLOptionElement& optionElement = downcast<HTMLOptionElement>(*node);
index a4d8f8f..806aff9 100644 (file)
@@ -1533,7 +1533,7 @@ bool RenderThemeGtk::paintMediaSliderTrack(const RenderObject& o, const PaintInf
         rangeRect.setWidth(lengthRatio * totalTrackWidth);
         if (index)
             rangeRect.move(startRatio * totalTrackWidth, 0);
-        context.fillRoundedRect(FloatRoundedRect(rangeRect, borderRadiiFromStyle(style)), style.visitedDependentColor(CSSPropertyColor), style.colorSpace());
+        context.fillRoundedRect(FloatRoundedRect(rangeRect, borderRadiiFromStyle(style)), style.visitedDependentColor(CSSPropertyColor));
     }
 
     context.restore();
@@ -1543,7 +1543,7 @@ bool RenderThemeGtk::paintMediaSliderTrack(const RenderObject& o, const PaintInf
 bool RenderThemeGtk::paintMediaSliderThumb(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r)
 {
     RenderStyle& style = o.style();
-    paintInfo.context().fillRoundedRect(FloatRoundedRect(r, borderRadiiFromStyle(style)), style.visitedDependentColor(CSSPropertyColor), style.colorSpace());
+    paintInfo.context().fillRoundedRect(FloatRoundedRect(r, borderRadiiFromStyle(style)), style.visitedDependentColor(CSSPropertyColor));
     return false;
 }
 
@@ -1573,8 +1573,7 @@ bool RenderThemeGtk::paintMediaVolumeSliderTrack(const RenderObject& renderObjec
     volumeRect.move(0, rectHeight - trackHeight);
     volumeRect.setHeight(ceil(trackHeight));
 
-    context.fillRoundedRect(FloatRoundedRect(volumeRect, borderRadiiFromStyle(style)),
-        style.visitedDependentColor(CSSPropertyColor), style.colorSpace());
+    context.fillRoundedRect(FloatRoundedRect(volumeRect, borderRadiiFromStyle(style)), style.visitedDependentColor(CSSPropertyColor));
     context.restore();
 
     return false;
index 1bf2052..0d5b5ef 100644 (file)
@@ -160,13 +160,13 @@ static CGFunctionRef getSharedFunctionRef(IOSGradientRef gradient, Interpolation
 
 static void drawAxialGradient(CGContextRef context, IOSGradientRef gradient, const FloatPoint& startPoint, const FloatPoint& stopPoint, Interpolation interpolation)
 {
-    RetainPtr<CGShadingRef> shading = adoptCF(CGShadingCreateAxial(deviceRGBColorSpaceRef(), startPoint, stopPoint, getSharedFunctionRef(gradient, interpolation), false, false));
+    RetainPtr<CGShadingRef> shading = adoptCF(CGShadingCreateAxial(sRGBColorSpaceRef(), startPoint, stopPoint, getSharedFunctionRef(gradient, interpolation), false, false));
     CGContextDrawShading(context, shading.get());
 }
 
 static void drawRadialGradient(CGContextRef context, IOSGradientRef gradient, const FloatPoint& startPoint, float startRadius, const FloatPoint& stopPoint, float stopRadius, Interpolation interpolation)
 {
-    RetainPtr<CGShadingRef> shading = adoptCF(CGShadingCreateRadial(deviceRGBColorSpaceRef(), startPoint, startRadius, stopPoint, stopRadius, getSharedFunctionRef(gradient, interpolation), false, false));
+    RetainPtr<CGShadingRef> shading = adoptCF(CGShadingCreateRadial(deviceRGBColorSpaceRef() /* FIXME */, startPoint, startRadius, stopPoint, stopRadius, getSharedFunctionRef(gradient, interpolation), false, false));
     CGContextDrawShading(context, shading.get());
 }
 
@@ -392,12 +392,12 @@ bool RenderThemeIOS::paintCheckboxDecorations(const RenderObject& box, const Pai
         };
 
         paintInfo.context().setStrokeThickness(lineWidth);
-        paintInfo.context().setStrokeColor(Color(0.0f, 0.0f, 0.0f, 0.7f), ColorSpaceDeviceRGB);
+        paintInfo.context().setStrokeColor(Color(0.0f, 0.0f, 0.0f, 0.7f));
 
         paintInfo.context().drawJoinedLines(shadow, 3, true, kCGLineCapSquare);
 
         paintInfo.context().setStrokeThickness(std::min(clip.width(), clip.height()) * thicknessRatio);
-        paintInfo.context().setStrokeColor(Color(1.0f, 1.0f, 1.0f, 240 / 255.0f), ColorSpaceDeviceRGB);
+        paintInfo.context().setStrokeColor(Color(1.0f, 1.0f, 1.0f, 240 / 255.0f));
 
         paintInfo.context().drawJoinedLines(line, 3, true);
     } else {
@@ -458,7 +458,7 @@ bool RenderThemeIOS::paintRadioDecorations(const RenderObject& box, const PaintI
         clip.inflateX(-clip.width() * InnerInverseRatio);
         clip.inflateY(-clip.height() * InnerInverseRatio);
 
-        paintInfo.context().drawRaisedEllipse(clip, Color::white, ColorSpaceDeviceRGB, shadowColor(), ColorSpaceDeviceRGB);
+        paintInfo.context().drawRaisedEllipse(clip, Color::white, shadowColor());
 
         FloatSize radius(clip.width() / 2.0f, clip.height() / 2.0f);
         paintInfo.context().clipRoundedRect(FloatRoundedRect(clip, radius, radius, radius, radius));
@@ -648,7 +648,7 @@ bool RenderThemeIOS::paintMenuListButtonDecorations(const RenderBox& box, const
             FloatSize(0, 0), FloatSize(valueForLength(style.borderTopRightRadius().width(), rect.width()) - style.borderRightWidth(), valueForLength(style.borderTopRightRadius().height(), rect.height()) - style.borderTopWidth()),
             FloatSize(0, 0), FloatSize(valueForLength(style.borderBottomRightRadius().width(), rect.width()) - style.borderRightWidth(), valueForLength(style.borderBottomRightRadius().height(), rect.height()) - style.borderBottomWidth())));
 
-        paintInfo.context().fillRect(buttonClip, style.visitedDependentColor(CSSPropertyBorderTopColor), style.colorSpace());
+        paintInfo.context().fillRect(buttonClip, style.visitedDependentColor(CSSPropertyBorderTopColor));
 
         drawAxialGradient(cgContext, gradientWithName(isFocused(box) && !isReadOnlyControl(box) ? ConcaveGradient : ConvexGradient), buttonClip.location(), FloatPoint(buttonClip.x(), buttonClip.maxY()), LinearInterpolation);
     }
@@ -663,7 +663,7 @@ bool RenderThemeIOS::paintMenuListButtonDecorations(const RenderBox& box, const
         FloatRect ellipse(buttonClip.x() + (buttonClip.width() - count * (size + padding) + padding) / 2.0, buttonClip.maxY() - 10.0, size, size);
 
         for (int i = 0; i < count; ++i) {
-            paintInfo.context().drawRaisedEllipse(ellipse, Color::white, ColorSpaceDeviceRGB, Color(0.0f, 0.0f, 0.0f, 0.5f), ColorSpaceDeviceRGB);
+            paintInfo.context().drawRaisedEllipse(ellipse, Color::white, Color(0.0f, 0.0f, 0.0f, 0.5f));
             ellipse.move(size + padding, 0);
         }
     }  else {
@@ -682,12 +682,12 @@ bool RenderThemeIOS::paintMenuListButtonDecorations(const RenderBox& box, const
         shadow[2] = FloatPoint(arrow[2].x(), arrow[2].y() + 1.0f);
 
         float opacity = isReadOnlyControl(box) ? 0.2 : 0.5;
-        paintInfo.context().setStrokeColor(Color(0.0f, 0.0f, 0.0f, opacity), ColorSpaceDeviceRGB);
-        paintInfo.context().setFillColor(Color(0.0f, 0.0f, 0.0f, opacity), ColorSpaceDeviceRGB);
+        paintInfo.context().setStrokeColor(Color(0.0f, 0.0f, 0.0f, opacity));
+        paintInfo.context().setFillColor(Color(0.0f, 0.0f, 0.0f, opacity));
         paintInfo.context().drawConvexPolygon(3, shadow, true);
 
-        paintInfo.context().setStrokeColor(Color::white, ColorSpaceDeviceRGB);
-        paintInfo.context().setFillColor(Color::white, ColorSpaceDeviceRGB);
+        paintInfo.context().setStrokeColor(Color::white);
+        paintInfo.context().setFillColor(Color::white);
         paintInfo.context().drawConvexPolygon(3, arrow, true);
     }
 
@@ -772,9 +772,9 @@ bool RenderThemeIOS::paintSliderTrack(const RenderObject& box, const PaintInfo&
 
         CGContextRef cgContext = paintInfo.context().platformContext();
         if (readonly)
-            paintInfo.context().setStrokeColor(Color(178, 178, 178), ColorSpaceDeviceRGB);
+            paintInfo.context().setStrokeColor(Color(178, 178, 178));
         else
-            paintInfo.context().setStrokeColor(Color(76, 76, 76), ColorSpaceDeviceRGB);
+            paintInfo.context().setStrokeColor(Color(76, 76, 76));
 
         RetainPtr<CGMutablePathRef> roundedRectPath = adoptCF(CGPathCreateMutable());
         CGPathAddRoundedRect(roundedRectPath.get(), 0, trackClip, cornerWidth, cornerHeight);
@@ -859,8 +859,7 @@ bool RenderThemeIOS::paintProgressBar(const RenderObject& renderer, const PaintI
     strokeGradient->addColorStop(1.0, Color(0x8d, 0x8d, 0x8d));
     context.setStrokeGradient(strokeGradient.releaseNonNull());
 
-    ColorSpace colorSpace = renderer.style().colorSpace();
-    context.setFillColor(Color(255, 255, 255), colorSpace);
+    context.setFillColor(Color(255, 255, 255));
 
     Path trackPath;
     FloatRect trackRect(rect.x() + 0.25, verticalRenderingPosition + 0.25, rect.width() - 0.5, progressBarHeight - 0.5);
@@ -1024,8 +1023,8 @@ bool RenderThemeIOS::paintFileUploadIconDecorations(const RenderObject&, const R
 
         // Background picture frame and simple background icon with a gradient matching the button.
         Color backgroundImageColor = Color(buttonRenderer.style().visitedDependentColor(CSSPropertyBackgroundColor).rgb());
-        paintInfo.context().fillRoundedRect(FloatRoundedRect(thumbnailPictureFrameRect, cornerSize, cornerSize, cornerSize, cornerSize), pictureFrameColor, ColorSpaceDeviceRGB);
-        paintInfo.context().fillRect(thumbnailRect, backgroundImageColor, ColorSpaceDeviceRGB);
+        paintInfo.context().fillRoundedRect(FloatRoundedRect(thumbnailPictureFrameRect, cornerSize, cornerSize, cornerSize, cornerSize), pictureFrameColor);
+        paintInfo.context().fillRect(thumbnailRect, backgroundImageColor);
         {
             GraphicsContextStateSaver stateSaver2(paintInfo.context());
             CGContextRef cgContext = paintInfo.context().platformContext();
@@ -1045,7 +1044,7 @@ bool RenderThemeIOS::paintFileUploadIconDecorations(const RenderObject&, const R
     }
 
     // Foreground picture frame and icon.
-    paintInfo.context().fillRoundedRect(FloatRoundedRect(thumbnailPictureFrameRect, cornerSize, cornerSize, cornerSize, cornerSize), pictureFrameColor, ColorSpaceDeviceRGB);
+    paintInfo.context().fillRoundedRect(FloatRoundedRect(thumbnailPictureFrameRect, cornerSize, cornerSize, cornerSize, cornerSize), pictureFrameColor);
     icon->paint(paintInfo.context(), thumbnailRect);
 
     return false;
index 1e4d58f..218ac3e 100644 (file)
@@ -1156,7 +1156,7 @@ bool RenderThemeMac::paintProgressBar(const RenderObject& renderObject, const Pa
         paintInfo.context().scale(FloatSize(-1, 1));
     }
 
-    paintInfo.context().drawImageBuffer(*imageBuffer, ColorSpaceDeviceRGB, inflatedRect.location());
+    paintInfo.context().drawImageBuffer(*imageBuffer, inflatedRect.location());
     return false;
 }
 
@@ -1301,7 +1301,7 @@ bool RenderThemeMac::paintMenuListButtonDecorations(const RenderBox& renderer, c
 
     GraphicsContextStateSaver stateSaver(paintInfo.context());
 
-    paintInfo.context().setFillColor(renderer.style().visitedDependentColor(CSSPropertyColor), renderer.style().colorSpace());
+    paintInfo.context().setFillColor(renderer.style().visitedDependentColor(CSSPropertyColor));
     paintInfo.context().setStrokeStyle(NoStroke);
 
     FloatPoint arrow1[3];
@@ -1330,11 +1330,11 @@ bool RenderThemeMac::paintMenuListButtonDecorations(const RenderBox& renderer, c
     // Draw the separator to the left of the arrows
     paintInfo.context().setStrokeThickness(1); // Deliberately ignores zoom since it looks nicer if it stays thin.
     paintInfo.context().setStrokeStyle(SolidStroke);
-    paintInfo.context().setStrokeColor(leftSeparatorColor, ColorSpaceDeviceRGB);
+    paintInfo.context().setStrokeColor(leftSeparatorColor);
     paintInfo.context().drawLine(IntPoint(leftEdgeOfSeparator, bounds.y()),
                                 IntPoint(leftEdgeOfSeparator, bounds.maxY()));
 
-    paintInfo.context().setStrokeColor(rightSeparatorColor, ColorSpaceDeviceRGB);
+    paintInfo.context().setStrokeColor(rightSeparatorColor);
     paintInfo.context().drawLine(IntPoint(leftEdgeOfSeparator + separatorSpace, bounds.y()),
                                 IntPoint(leftEdgeOfSeparator + separatorSpace, bounds.maxY()));
     return false;
@@ -1914,7 +1914,7 @@ bool RenderThemeMac::paintSnapshottedPluginOverlay(const RenderObject& renderer,
     if (alignedPluginRect.width() <= 0 || alignedPluginRect.height() <= 0)
         return true;
 
-    context.drawImage(*snapshot, plugInRenderer.style().colorSpace(), alignedPluginRect, CompositeSourceOver);
+    context.drawImage(*snapshot, alignedPluginRect, CompositeSourceOver);
     return false;
 }
 
@@ -2184,7 +2184,7 @@ static NSColor *titleTextColorForAttachment(const RenderAttachment& attachment)
     if (attachment.selectionState() != RenderObject::SelectionNone) {
         if (attachment.frame().selection().isFocusedAndActive())
             return [NSColor alternateSelectedControlTextColor];    
-        return (NSColor *)cachedCGColor(attachmentTitleInactiveTextColor(), ColorSpaceDeviceRGB);
+        return (NSColor *)cachedCGColor(attachmentTitleInactiveTextColor());
     }
 
     return [NSColor blackColor];
@@ -2294,7 +2294,7 @@ void AttachmentLayout::layOutSubtitle(const RenderAttachment& attachment)
     RetainPtr<CTFontRef> font = adoptCF(CTFontCreateUIFontForLanguage(kCTFontUIFontSystem, attachmentSubtitleFontSize, language));
     NSDictionary *textAttributes = @{
         (id)kCTFontAttributeName: (id)font.get(),
-        (id)kCTForegroundColorAttributeName: (NSColor *)cachedCGColor(attachmentSubtitleTextColor(), ColorSpaceDeviceRGB)
+        (id)kCTForegroundColorAttributeName: (NSColor *)cachedCGColor(attachmentSubtitleTextColor())
     };
     RetainPtr<NSAttributedString> attributedSubtitleText = adoptNS([[NSAttributedString alloc] initWithString:subtitleText attributes:textAttributes]);
     subtitleLine = adoptCF(CTLineCreateWithAttributedString((CFAttributedStringRef)attributedSubtitleText.get()));
@@ -2355,7 +2355,7 @@ static void paintAttachmentIconBackground(const RenderAttachment&, GraphicsConte
     if (paintBorder)
         backgroundRect.inflate(-attachmentIconSelectionBorderThickness);
 
-    context.fillRoundedRect(FloatRoundedRect(backgroundRect, FloatRoundedRect::Radii(attachmentIconBackgroundRadius)), attachmentIconBackgroundColor(), ColorSpaceDeviceRGB);
+    context.fillRoundedRect(FloatRoundedRect(backgroundRect, FloatRoundedRect::Radii(attachmentIconBackgroundRadius)), attachmentIconBackgroundColor());
 
     if (paintBorder) {
         FloatRect borderRect = layout.iconBackgroundRect;
@@ -2364,7 +2364,7 @@ static void paintAttachmentIconBackground(const RenderAttachment&, GraphicsConte
         FloatSize iconBackgroundRadiusSize(attachmentIconBackgroundRadius, attachmentIconBackgroundRadius);
         Path borderPath;
         borderPath.addRoundedRect(borderRect, iconBackgroundRadiusSize);
-        context.setStrokeColor(attachmentIconBorderColor(), ColorSpaceDeviceRGB);
+        context.setStrokeColor(attachmentIconBorderColor());
         context.setStrokeThickness(attachmentIconSelectionBorderThickness);
         context.strokePath(borderPath);
     }
@@ -2397,7 +2397,7 @@ static void paintAttachmentTitleBackground(const RenderAttachment& attachment, G
     else
         backgroundColor = attachmentTitleInactiveBackgroundColor();
 
-    context.setFillColor(backgroundColor, ColorSpaceDeviceRGB);
+    context.setFillColor(backgroundColor);
 
     Path backgroundPath = PathUtilities::pathWithShrinkWrappedRects(backgroundRects, attachmentTitleBackgroundRadius);
     context.fillPath(backgroundPath);
@@ -2447,7 +2447,7 @@ static void paintAttachmentProgress(const RenderAttachment& attachment, Graphics
     backgroundRect.inflate(-attachmentProgressBarBorderWidth / 2);
 
     FloatRoundedRect backgroundRoundedRect(backgroundRect, FloatRoundedRect::Radii(backgroundRect.height() / 2));
-    context.fillRoundedRect(backgroundRoundedRect, attachmentProgressBarBackgroundColor(), ColorSpaceDeviceRGB);
+    context.fillRoundedRect(backgroundRoundedRect, attachmentProgressBarBackgroundColor());
 
     {
         GraphicsContextStateSaver clipSaver(context);
@@ -2457,13 +2457,13 @@ static void paintAttachmentProgress(const RenderAttachment& attachment, Graphics
         progressRect.setWidth(progressRect.width() * progress);
         progressRect = encloseRectToDevicePixels(progressRect, attachment.document().deviceScaleFactor());
 
-        context.fillRect(progressRect, attachmentProgressBarFillColor(), ColorSpaceDeviceRGB);
+        context.fillRect(progressRect, attachmentProgressBarFillColor());
     }
 
     Path borderPath;
     float borderRadius = borderRect.height() / 2;
     borderPath.addRoundedRect(borderRect, FloatSize(borderRadius, borderRadius));
-    context.setStrokeColor(attachmentProgressBarBorderColor(), ColorSpaceDeviceRGB);
+    context.setStrokeColor(attachmentProgressBarBorderColor());
     context.setStrokeThickness(attachmentProgressBarBorderWidth);
     context.strokePath(borderPath);
 }
index 90295cb..2d154de 100644 (file)
@@ -517,7 +517,7 @@ void RenderView::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
 
     // This avoids painting garbage between columns if there is a column gap.
     if (frameView().pagination().mode != Pagination::Unpaginated && paintInfo.shouldPaintWithinRoot(*this))
-        paintInfo.context().fillRect(paintInfo.rect, frameView().baseBackgroundColor(), ColorSpaceDeviceRGB);
+        paintInfo.context().fillRect(paintInfo.rect, frameView().baseBackgroundColor());
 
     paintObject(paintInfo, paintOffset);
 }
@@ -610,7 +610,7 @@ void RenderView::paintBoxDecorations(PaintInfo& paintInfo, const LayoutPoint&)
         if (backgroundColor.alpha()) {
             CompositeOperator previousOperator = paintInfo.context().compositeOperation();
             paintInfo.context().setCompositeOperation(CompositeCopy);
-            paintInfo.context().fillRect(paintInfo.rect, backgroundColor, style().colorSpace());
+            paintInfo.context().fillRect(paintInfo.rect, backgroundColor);
             paintInfo.context().setCompositeOperation(previousOperator);
         } else
             paintInfo.context().clearRect(paintInfo.rect);
index 4541e90..cc9b8ce 100644 (file)
@@ -290,7 +290,7 @@ void RenderWidget::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
     // Paint a partially transparent wash over selected widgets.
     if (isSelected() && !document().printing()) {
         // FIXME: selectionRect() is in absolute, not painting coordinates.
-        paintInfo.context().fillRect(snappedIntRect(selectionRect()), selectionBackgroundColor(), style().colorSpace());
+        paintInfo.context().fillRect(snappedIntRect(selectionRect()), selectionBackgroundColor());
     }
 
     if (hasLayer() && layer()->canResize())
index cfda5cf..c918a6c 100644 (file)
@@ -477,7 +477,7 @@ GapRects RootInlineBox::lineSelectionGap(RenderBlock& rootBlock, const LayoutPoi
                 LayoutRect gapRect = rootBlock.logicalRectToPhysicalRect(rootBlockPhysicalPosition, logicalRect);
                 if (isPreviousBoxSelected && gapRect.width() > 0 && gapRect.height() > 0) {
                     if (paintInfo && box->parent()->renderer().style().visibility() == VISIBLE)
-                        paintInfo->context().fillRect(gapRect, box->parent()->renderer().selectionBackgroundColor(), box->parent()->renderer().style().colorSpace());
+                        paintInfo->context().fillRect(gapRect, box->parent()->renderer().selectionBackgroundColor());
                     // VisibleSelection may be non-contiguous, see comment above.
                     result.uniteCenter(gapRect);
                 }
index 656c7d4..322c1b2 100644 (file)
@@ -57,8 +57,8 @@ static void paintDebugBorders(GraphicsContext& context, LayoutRect borderRect, c
     if (snappedRect.isEmpty())
         return;
     GraphicsContextStateSaver stateSaver(context);
-    context.setStrokeColor(Color(0, 255, 0), ColorSpaceDeviceRGB);
-    context.setFillColor(Color::transparent, ColorSpaceDeviceRGB);
+    context.setStrokeColor(Color(0, 255, 0));
+    context.setFillColor(Color::transparent);
     context.drawRect(snappedRect);
 }
 
index 2226ecd..e1debbb 100644 (file)
 
 namespace WebCore {
 
-TextPaintStyle::TextPaintStyle(ColorSpace colorSpace)
-    : colorSpace(colorSpace)
-    , strokeWidth(0)
-#if ENABLE(LETTERPRESS)
-    , useLetterpressEffect(false)
-#endif
-{
-}
-
-TextPaintStyle::TextPaintStyle(Color color, ColorSpace colorSpace)
-    : colorSpace(colorSpace)
-    , fillColor(color)
+TextPaintStyle::TextPaintStyle(const Color& color)
+    : fillColor(color)
     , strokeColor(color)
-    , strokeWidth(0)
-#if ENABLE(LETTERPRESS)
-    , useLetterpressEffect(false)
-#endif
 {
 }
 
-static Color adjustColorForVisibilityOnBackground(Color textColor, Color backgroundColor)
+static Color adjustColorForVisibilityOnBackground(const Color& textColor, const Color& backgroundColor)
 {
     int d = differenceSquared(textColor, backgroundColor);
     // Semi-arbitrarily chose 65025 (255^2) value here after a few tests.
@@ -76,7 +62,7 @@ static Color adjustColorForVisibilityOnBackground(Color textColor, Color backgro
 
 TextPaintStyle computeTextPaintStyle(const Frame& frame, const RenderStyle& lineStyle, const PaintInfo& paintInfo)
 {
-    TextPaintStyle paintStyle(lineStyle.colorSpace());
+    TextPaintStyle paintStyle;
 
 #if ENABLE(LETTERPRESS)
     paintStyle.useLetterpressEffect = lineStyle.textDecorationsInEffect() & TextDecorationLetterpress;
@@ -198,12 +184,12 @@ void updateGraphicsContext(GraphicsContext& context, const TextPaintStyle& paint
     }
 
     Color fillColor = fillColorType == UseEmphasisMarkColor ? paintStyle.emphasisMarkColor : paintStyle.fillColor;
-    if (mode & TextModeFill && (fillColor != context.fillColor() || paintStyle.colorSpace != context.fillColorSpace()))
-        context.setFillColor(fillColor, paintStyle.colorSpace);
+    if (mode & TextModeFill && (fillColor != context.fillColor()))
+        context.setFillColor(fillColor);
 
     if (mode & TextModeStroke) {
         if (paintStyle.strokeColor != context.strokeColor())
-            context.setStrokeColor(paintStyle.strokeColor, paintStyle.colorSpace);
+            context.setStrokeColor(paintStyle.strokeColor);
         if (paintStyle.strokeWidth != context.strokeThickness())
             context.setStrokeThickness(paintStyle.strokeWidth);
     }
index 994e45d..f0cbebb 100644 (file)
@@ -39,16 +39,15 @@ class ShadowData;
 struct PaintInfo;
 
 struct TextPaintStyle {
-    TextPaintStyle(ColorSpace);
-    TextPaintStyle(Color, ColorSpace);
+    TextPaintStyle() { }
+    TextPaintStyle(const Color&);
 
-    ColorSpace colorSpace;
     Color fillColor;
     Color strokeColor;
     Color emphasisMarkColor;
-    float strokeWidth;
+    float strokeWidth { 0 };
 #if ENABLE(LETTERPRESS)
-    bool useLetterpressEffect;
+    bool useLetterpressEffect { false };
 #endif
 };
 
index e4286c0..ec2302c 100644 (file)
@@ -100,7 +100,7 @@ ShadowApplier::ShadowApplier(GraphicsContext& context, const ShadowData* shadow,
     }
 
     if (!m_avoidDrawingShadow)
-        context.setShadow(shadowOffset, shadowRadius, shadowColor, context.fillColorSpace());
+        context.setShadow(shadowOffset, shadowRadius, shadowColor);
 }
 
 ShadowApplier::~ShadowApplier()
@@ -118,11 +118,10 @@ static void paintTextWithShadows(GraphicsContext& context, const FontCascade& fo
     const ShadowData* shadow, bool stroked, bool horizontal)
 {
     Color fillColor = context.fillColor();
-    ColorSpace fillColorSpace = context.fillColorSpace();
     bool opaque = !fillColor.hasAlpha();
     bool lastShadowIterationShouldDrawText = !stroked && opaque;
     if (!opaque)
-        context.setFillColor(Color::black, fillColorSpace);
+        context.setFillColor(Color::black);
 
     do {
         ShadowApplier shadowApplier(context, shadow, boxRect, lastShadowIterationShouldDrawText, opaque, horizontal ? Horizontal : Vertical);
@@ -133,7 +132,7 @@ static void paintTextWithShadows(GraphicsContext& context, const FontCascade& fo
 
         IntSize extraOffset = roundedIntSize(shadowApplier.extraOffset());
         if (!shadow && !opaque)
-            context.setFillColor(fillColor, fillColorSpace);
+            context.setFillColor(fillColor);
 
         if (startOffset <= endOffset)
             drawTextOrEmphasisMarks(context, font, textRun, emphasisMark, emphasisMarkOffset, textOrigin + extraOffset, startOffset, endOffset);
index b6de79e..90c59ce 100644 (file)
@@ -104,7 +104,7 @@ void RenderMathMLBlock::paint(PaintInfo& info, const LayoutPoint& paintOffset)
     
     info.context().setStrokeThickness(1.0f);
     info.context().setStrokeStyle(SolidStroke);
-    info.context().setStrokeColor(Color(0, 0, 255), ColorSpaceSRGB);
+    info.context().setStrokeColor(Color(0, 0, 255));
     
     info.context().drawLine(adjustedPaintOffset, IntPoint(adjustedPaintOffset.x() + pixelSnappedOffsetWidth(), adjustedPaintOffset.y()));
     info.context().drawLine(IntPoint(adjustedPaintOffset.x() + pixelSnappedOffsetWidth(), adjustedPaintOffset.y()), IntPoint(adjustedPaintOffset.x() + pixelSnappedOffsetWidth(), adjustedPaintOffset.y() + pixelSnappedOffsetHeight()));
@@ -113,13 +113,13 @@ void RenderMathMLBlock::paint(PaintInfo& info, const LayoutPoint& paintOffset)
     
     int topStart = paddingTop();
     
-    info.context().setStrokeColor(Color(0, 255, 0), ColorSpaceSRGB);
+    info.context().setStrokeColor(Color(0, 255, 0));
     
     info.context().drawLine(IntPoint(adjustedPaintOffset.x(), adjustedPaintOffset.y() + topStart), IntPoint(adjustedPaintOffset.x() + pixelSnappedOffsetWidth(), adjustedPaintOffset.y() + topStart));
     
     int baseline = roundToInt(baselinePosition(AlphabeticBaseline, true, HorizontalLine));
     
-    info.context().setStrokeColor(Color(255, 0, 0), ColorSpaceSRGB);
+    info.context().setStrokeColor(Color(255, 0, 0));
     
     info.context().drawLine(IntPoint(adjustedPaintOffset.x(), adjustedPaintOffset.y() + baseline), IntPoint(adjustedPaintOffset.x() + pixelSnappedOffsetWidth(), adjustedPaintOffset.y() + baseline));
 }
index 519bb38..92e2182 100644 (file)
@@ -154,7 +154,7 @@ void RenderMathMLFraction::paint(PaintInfo& info, const LayoutPoint& paintOffset
     
     info.context().setStrokeThickness(m_lineThickness);
     info.context().setStrokeStyle(SolidStroke);
-    info.context().setStrokeColor(style().visitedDependentColor(CSSPropertyColor), ColorSpaceSRGB);
+    info.context().setStrokeColor(style().visitedDependentColor(CSSPropertyColor));
     info.context().drawLine(adjustedPaintOffset, roundedIntPoint(LayoutPoint(adjustedPaintOffset.x() + denominatorWrapper->offsetWidth(), adjustedPaintOffset.y())));
 }
 
index b86e362..e9e534c 100644 (file)
@@ -117,7 +117,7 @@ void RenderMathMLMenclose::paint(PaintInfo& info, const LayoutPoint& paintOffset
         GraphicsContextStateSaver stateSaver(info.context());
         info.context().setStrokeThickness(1);
         info.context().setStrokeStyle(SolidStroke);
-        info.context().setStrokeColor(style().visitedDependentColor(CSSPropertyColor), ColorSpaceDeviceRGB);
+        info.context().setStrokeColor(style().visitedDependentColor(CSSPropertyColor));
         // TODO add support for notation value updiagonalarrow https://bugs.webkit.org/show_bug.cgi?id=127466
         for (size_t i = 0; i < notationalValueSize; i++) {
             if (notationValues[i] == "updiagonalstrike")
@@ -129,7 +129,7 @@ void RenderMathMLMenclose::paint(PaintInfo& info, const LayoutPoint& paintOffset
             else if (notationValues[i] == "horizontalstrike")
                 info.context().drawLine(IntPoint(left, top + halfboxHeight), IntPoint(left + boxWidth, top + halfboxHeight));
             else if (notationValues[i] == "circle") {
-                info.context().setFillColor(Color::transparent, ColorSpaceDeviceRGB);
+                info.context().setFillColor(Color::transparent);
                 info.context().drawEllipse(rect);
             } else if (notationValues[i] == "longdiv")
                 isDefaultLongDiv = true;
index 3cfeb21..660210f 100644 (file)
@@ -1889,7 +1889,7 @@ void RenderMathMLOperator::paint(PaintInfo& info, const LayoutPoint& paintOffset
         return;
 
     GraphicsContextStateSaver stateSaver(info.context());
-    info.context().setFillColor(style().visitedDependentColor(CSSPropertyColor), style().colorSpace());
+    info.context().setFillColor(style().visitedDependentColor(CSSPropertyColor));
 
     if (m_stretchyData.mode() == DrawSizeVariant) {
         ASSERT(m_stretchyData.variant().glyph);
index 6925a79..180829d 100644 (file)
@@ -133,7 +133,7 @@ void RenderMathMLRadicalOperator::paint(PaintInfo& info, const LayoutPoint& pain
 
     info.context().setStrokeThickness(gRadicalLineThicknessEms * style().fontSize());
     info.context().setStrokeStyle(SolidStroke);
-    info.context().setStrokeColor(style().visitedDependentColor(CSSPropertyColor), ColorSpaceDeviceRGB);
+    info.context().setStrokeColor(style().visitedDependentColor(CSSPropertyColor));
     info.context().setLineJoin(MiterJoin);
     info.context().setMiterLimit(style().fontSize());
 
index ac4a15d..c243d20 100644 (file)
@@ -332,7 +332,7 @@ void RenderMathMLRoot::paint(PaintInfo& info, const LayoutPoint& paintOffset)
 
     info.context().setStrokeThickness(m_ruleThickness);
     info.context().setStrokeStyle(SolidStroke);
-    info.context().setStrokeColor(style().visitedDependentColor(CSSPropertyColor), ColorSpaceDeviceRGB);
+    info.context().setStrokeColor(style().visitedDependentColor(CSSPropertyColor));
 
     // The preferred width of the radical is sometimes incorrect, so we draw a slightly longer line to ensure it touches the radical symbol (https://bugs.webkit.org/show_bug.cgi?id=130326).
     LayoutUnit sizeError = radical->trailingSpaceError();
index e0caeac..fcc8b7a 100644 (file)
@@ -185,7 +185,7 @@ std::unique_ptr<Shape> Shape::createRasterShape(Image* image, float threshold, c
     if (imageBuffer) {
         GraphicsContext& graphicsContext = imageBuffer->context();
         if (image)
-            graphicsContext.drawImage(*image, ColorSpaceDeviceRGB, IntRect(IntPoint(), imageRect.size()));
+            graphicsContext.drawImage(*image, IntRect(IntPoint(), imageRect.size()));
 
         RefPtr<Uint8ClampedArray> pixelArray = imageBuffer->getUnmultipliedImageData(IntRect(IntPoint(), imageRect.size()));
         unsigned pixelArrayLength = pixelArray->length();
index c939ae7..5dedb55 100644 (file)
@@ -209,20 +209,18 @@ void NinePieceImage::paint(GraphicsContext& graphicsContext, RenderElement* rend
     if (!image)
         return;
 
-    ColorSpace colorSpace = style.colorSpace();
-
     for (ImagePiece piece = MinPiece; piece < MaxPiece; ++piece) {
         if ((piece == MiddlePiece && !fill()) || isEmptyPieceRect(piece, destinationRects, sourceRects))
             continue;
 
         if (isCornerPiece(piece)) {
-            graphicsContext.drawImage(*image, colorSpace, destinationRects[piece], sourceRects[piece], op);
+            graphicsContext.drawImage(*image, destinationRects[piece], sourceRects[piece], op);
             continue;
         }
 
         Image::TileRule hRule = isHorizontalPiece(piece) ? static_cast<Image::TileRule>(horizontalRule()) : Image::StretchTile;
         Image::TileRule vRule = isVerticalPiece(piece) ? static_cast<Image::TileRule>(verticalRule()) : Image::StretchTile;
-        graphicsContext.drawTiledImage(*image, colorSpace, destinationRects[piece], sourceRects[piece], tileScales[piece], hRule, vRule, op);
+        graphicsContext.drawTiledImage(*image, destinationRects[piece], sourceRects[piece], tileScales[piece], hRule, vRule, op);
     }
 }
 
index 2b64507..bf1c219 100644 (file)
@@ -902,7 +902,6 @@ public:
     void getTextShadowBlockDirectionExtent(LayoutUnit& logicalTop, LayoutUnit& logicalBottom) const { getShadowBlockDirectionExtent(textShadow(), logicalTop, logicalBottom); }
 
     float textStrokeWidth() const { return rareInheritedData->textStrokeWidth; }
-    static ColorSpace colorSpace() { return ColorSpaceSRGB; } // FIXME: Remove after adding color space handling into the Color class.
     float opacity() const { return rareNonInheritedData->opacity; }
     ControlPart appearance() const { return static_cast<ControlPart>(rareNonInheritedData->m_appearance); }
     AspectRatioType aspectRatioType() const { return static_cast<AspectRatioType>(rareNonInheritedData->m_aspectRatioType); }
index ef757e7..ea40207 100644 (file)
@@ -169,7 +169,7 @@ void RenderSVGImage::paintForeground(PaintInfo& paintInfo)
 
     imageElement().preserveAspectRatio().transformRect(destRect, srcRect);
 
-    paintInfo.context().drawImage(*image, ColorSpaceDeviceRGB, destRect, srcRect);
+    paintInfo.context().drawImage(*image, destRect, srcRect);
 }
 
 void RenderSVGImage::invalidateBufferedForeground()
index 1d013ad..294cb46 100644 (file)
@@ -71,7 +71,7 @@ static void useStrokeStyleToFill(GraphicsContext& context)
     else if (Pattern* pattern = context.strokePattern())
         context.setFillPattern(*pattern);
     else
-        context.setFillColor(context.strokeColor(), context.strokeColorSpace());
+        context.setFillColor(context.strokeColor());
 }
 
 void RenderSVGPath::strokeShape(GraphicsContext& context) const
index 45d229e..2b7c3f8 100644 (file)
@@ -271,7 +271,7 @@ void RenderSVGResourceFilter::postApplyResource(RenderElement& renderer, Graphic
             context->concatCTM(filterData->shearFreeAbsoluteTransform.inverse());
 
             context->scale(FloatSize(1 / filterData->filter->filterResolution().width(), 1 / filterData->filter->filterResolution().height()));
-            context->drawImageBuffer(*resultImage, renderer.style().colorSpace(), lastEffect->absolutePaintRect());
+            context->drawImageBuffer(*resultImage, lastEffect->absolutePaintRect());
             context->scale(filterData->filter->filterResolution());
 
             context->concatCTM(filterData->shearFreeAbsoluteTransform);
index fb88fc8..4b20da5 100644 (file)
@@ -42,7 +42,6 @@ bool RenderSVGResourceSolidColor::applyResource(RenderElement& renderer, const R
     ASSERT(resourceMode != ApplyToDefaultMode);
 
     const SVGRenderStyle& svgStyle = style.svgStyle();
-    ColorSpace colorSpace = style.colorSpace();
 
     bool isRenderingMask = renderer.view().frameView().paintBehavior() & PaintBehaviorRenderingSVGMask;
 
@@ -51,7 +50,7 @@ bool RenderSVGResourceSolidColor::applyResource(RenderElement& renderer, const R
             context->setAlpha(svgStyle.fillOpacity());
         else
             context->setAlpha(1);
-        context->setFillColor(m_color, colorSpace);
+        context->setFillColor(m_color);
         if (!isRenderingMask)
             context->setFillRule(svgStyle.fillRule());
 
@@ -61,7 +60,7 @@ bool RenderSVGResourceSolidColor::applyResource(RenderElement& renderer, const R
         // When rendering the mask for a RenderSVGResourceClipper, the stroke code path is never hit.
         ASSERT(!isRenderingMask);
         context->setAlpha(svgStyle.strokeOpacity());
-        context->setStrokeColor(m_color, colorSpace);
+        context->setStrokeColor(m_color);
 
         SVGRenderSupport::applyStrokeStyleToContext(context, style, renderer);
 
index 69f2960..6e5df30 100644 (file)
@@ -225,8 +225,8 @@ void SVGInlineTextBox::paintSelectionBackground(PaintInfo& paintInfo)
         if (!fragmentTransform.isIdentity())
             paintInfo.context().concatCTM(fragmentTransform);
 
-        paintInfo.context().setFillColor(backgroundColor, style.colorSpace());
-        paintInfo.context().fillRect(selectionRectForTextFragment(fragment, fragmentStartPosition, fragmentEndPosition, &style), backgroundColor, style.colorSpace());
+        paintInfo.context().setFillColor(backgroundColor);
+        paintInfo.context().fillRect(selectionRectForTextFragment(fragment, fragmentStartPosition, fragmentEndPosition, &style), backgroundColor);
 
         m_paintingResourceMode = ApplyToDefaultMode;
     }
index d02ee50..6c99055 100644 (file)
@@ -128,7 +128,7 @@ void SVGRenderingContext::prepareToRenderSVGContent(RenderElement& renderer, Pai
         }
 
         if (shadow) {
-            m_paintInfo->context().setShadow(IntSize(roundToInt(shadow->x()), roundToInt(shadow->y())), shadow->radius(), shadow->color(), style.colorSpace());
+            m_paintInfo->context().setShadow(IntSize(roundToInt(shadow->x()), roundToInt(shadow->y())), shadow->radius(), shadow->color());
             m_paintInfo->context().beginTransparencyLayer(1);
             m_renderingFlags |= EndShadowLayer;
         }
@@ -361,7 +361,7 @@ bool SVGRenderingContext::bufferForeground(std::unique_ptr<ImageBuffer>& imageBu
             return false;
     }
 
-    m_paintInfo->context().drawImageBuffer(*imageBuffer, ColorSpaceDeviceRGB, boundingBox);
+    m_paintInfo->context().drawImageBuffer(*imageBuffer, boundingBox);
     return true;
 }
 
index de8a22b..c6b4958 100644 (file)
@@ -97,7 +97,7 @@ void SVGAnimatedColorAnimator::calculateAnimatedValue(float percentage, unsigned
     float alpha = animatedColor.alpha();
     m_animationElement->animateAdditiveNumber(percentage, repeatCount, fromColor.alpha(), toColor.alpha(), toAtEndOfDurationColor.alpha(), alpha);
 
-    animatedColor = { { roundAndClampColorChannel(red), roundAndClampColorChannel(green), roundAndClampColorChannel(blue), roundAndClampColorChannel(alpha) }, ColorSpaceSRGB };
+    animatedColor = { roundAndClampColorChannel(red), roundAndClampColorChannel(green), roundAndClampColorChannel(blue), roundAndClampColorChannel(alpha) };
 }
 
 float SVGAnimatedColorAnimator::calculateDistance(const String& fromString, const String& toString)
index 284304f..055ae0f 100644 (file)
@@ -139,7 +139,7 @@ IntSize SVGImage::containerSize() const
 }
 
 void SVGImage::drawForContainer(GraphicsContext& context, const FloatSize containerSize, float zoom, const FloatRect& dstRect,
-    const FloatRect& srcRect, ColorSpace colorSpace, CompositeOperator compositeOp, BlendMode blendMode)
+    const FloatRect& srcRect, CompositeOperator compositeOp, BlendMode blendMode)
 {
     if (!m_page)
         return;
@@ -161,7 +161,7 @@ void SVGImage::drawForContainer(GraphicsContext& context, const FloatSize contai
     adjustedSrcSize.scale(roundedContainerSize.width() / containerSize.width(), roundedContainerSize.height() / containerSize.height());
     scaledSrc.setSize(adjustedSrcSize);
 
-    draw(context, dstRect, scaledSrc, colorSpace, compositeOp, blendMode, ImageOrientationDescription());
+    draw(context, dstRect, scaledSrc, compositeOp, blendMode, ImageOrientationDescription());
 
     setImageObserver(observer);
 }
@@ -179,7 +179,7 @@ PassNativeImagePtr SVGImage::nativeImageForCurrentFrame()
     if (!buffer) // failed to allocate image
         return 0;
 
-    draw(buffer->context(), rect(), rect(), ColorSpaceDeviceRGB, CompositeSourceOver, BlendModeNormal, ImageOrientationDescription());
+    draw(buffer->context(), rect(), rect(), CompositeSourceOver, BlendModeNormal, ImageOrientationDescription());
 
     // FIXME: WK(Bug 113657): We should use DontCopyBackingStore here.
     return buffer->copyImage(CopyBackingStore)->nativeImageForCurrentFrame();
@@ -187,7 +187,7 @@ PassNativeImagePtr SVGImage::nativeImageForCurrentFrame()
 #endif
 
 void SVGImage::drawPatternForContainer(GraphicsContext& context, const FloatSize& containerSize, float zoom, const FloatRect& srcRect,
-    const AffineTransform& patternTransform, const FloatPoint& phase, const FloatSize& spacing, ColorSpace colorSpace, CompositeOperator compositeOp, const FloatRect& dstRect, BlendMode blendMode)
+    const AffineTransform& patternTransform, const FloatPoint& phase, const FloatSize& spacing, CompositeOperator compositeOp, const FloatRect& dstRect, BlendMode blendMode)
 {
     FloatRect zoomedContainerRect = FloatRect(FloatPoint(), containerSize);
     zoomedContainerRect.scale(zoom);
@@ -204,7 +204,7 @@ void SVGImage::drawPatternForContainer(GraphicsContext& context, const FloatSize
     std::unique_ptr<ImageBuffer> buffer = ImageBuffer::createCompatibleBuffer(expandedIntSize(imageBufferSize.size()), 1, ColorSpaceSRGB, context, true);
     if (!buffer) // Failed to allocate buffer.
         return;
-    drawForContainer(buffer->context(), containerSize, zoom, imageBufferSize, zoomedContainerRect, ColorSpaceDeviceRGB, CompositeSourceOver, BlendModeNormal);
+    drawForContainer(buffer->context(), containerSize, zoom, imageBufferSize, zoomedContainerRect, CompositeSourceOver, BlendModeNormal);
     if (context.drawLuminanceMask())
         buffer->convertToLuminanceMask();
 
@@ -219,10 +219,10 @@ void SVGImage::drawPatternForContainer(GraphicsContext& context, const FloatSize
     unscaledPatternTransform.scale(1 / imageBufferScale.width(), 1 / imageBufferScale.height());
 
     context.setDrawLuminanceMask(false);
-    image->drawPattern(context, scaledSrcRect, unscaledPatternTransform, phase, spacing, colorSpace, compositeOp, dstRect, blendMode);
+    image->drawPattern(context, scaledSrcRect, unscaledPatternTransform, phase, spacing, compositeOp, dstRect, blendMode);
 }
 
-void SVGImage::draw(GraphicsContext& context, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace, CompositeOperator compositeOp, BlendMode blendMode, ImageOrientationDescription)
+void SVGImage::draw(GraphicsContext& context, const FloatRect& dstRect, const FloatRect& srcRect, CompositeOperator compositeOp, BlendMode blendMode, ImageOrientationDescription)
 {
     if (!m_page)
         return;
index 1aba92a..7980314 100644 (file)
@@ -93,9 +93,9 @@ private:
     virtual void dump(TextStream&) const override;
 
     SVGImage(ImageObserver&, const URL&);
-    virtual void draw(GraphicsContext&, const FloatRect& fromRect, const FloatRect& toRect, ColorSpace styleColorSpace, CompositeOperator, BlendMode, ImageOrientationDescription) override;
-    void drawForContainer(GraphicsContext&, const FloatSize, float, const FloatRect&, const FloatRect&, ColorSpace, CompositeOperator, BlendMode);
-    void drawPatternForContainer(GraphicsContext&, const FloatSize& containerSize, float zoom, const FloatRect& srcRect, const AffineTransform&, const FloatPoint& phase, const FloatSize& spacing, ColorSpace,
+    virtual void draw(GraphicsContext&, const FloatRect& fromRect, const FloatRect& toRect, CompositeOperator, BlendMode, ImageOrientationDescription) override;
+    void drawForContainer(GraphicsContext&, const FloatSize, float, const FloatRect&, const FloatRect&, CompositeOperator, BlendMode);
+    void drawPatternForContainer(GraphicsContext&, const FloatSize& containerSize, float zoom, const FloatRect& srcRect, const AffineTransform&, const FloatPoint& phase, const FloatSize& spacing,
         CompositeOperator, const FloatRect&, BlendMode);
 
     SVGSVGElement* rootElement() const;
index 5a38351..4e161e3 100644 (file)
@@ -35,15 +35,15 @@ FloatSize SVGImageForContainer::size() const
 }
 
 void SVGImageForContainer::draw(GraphicsContext& context, const FloatRect& dstRect,
-    const FloatRect& srcRect, ColorSpace colorSpace, CompositeOperator compositeOp, BlendMode blendMode, ImageOrientationDescription)
+    const FloatRect& srcRect, CompositeOperator compositeOp, BlendMode blendMode, ImageOrientationDescription)
 {
-    m_image->drawForContainer(context, m_containerSize, m_zoom, dstRect, srcRect, colorSpace, compositeOp, blendMode);
+    m_image->drawForContainer(context, m_containerSize, m_zoom, dstRect, srcRect, compositeOp, blendMode);
 }
 
 void SVGImageForContainer::drawPattern(GraphicsContext& context, const FloatRect& srcRect, const AffineTransform& patternTransform,
-    const FloatPoint& phase, const FloatSize& spacing, ColorSpace colorSpace, CompositeOperator compositeOp, const FloatRect& dstRect, BlendMode blendMode)
+    const FloatPoint& phase, const FloatSize& spacing, CompositeOperator compositeOp, const FloatRect& dstRect, BlendMode blendMode)
 {
-