[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

krit at webkit.org krit at webkit.org
Wed Dec 22 14:47:30 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 2f1d53526dc8c9e99cc2e82bda5a15f996496c1a
Author: krit at webkit.org <krit at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Oct 20 13:09:50 2010 +0000

    2010-10-20  Dirk Schulze  <krit at webkit.org>
    
            Reviewed by Nikolas Zimmermann.
    
            Merge ColorSpace and ImageColorSpace enums
            https://bugs.webkit.org/show_bug.cgi?id=47922
    
            Renamed ColorSpace enum entries DeviceColorSpace and sRGBColorSpace to ColorSpaceDeviceRGB and ColorSpaceSRGB
            to follow webkit style rules.
    
            * src/WebFontImpl.cpp:
            (WebKit::WebFontImpl::drawText):
            * src/WebFrameImpl.cpp:
            (WebKit::WebFrameImpl::paintWithContext):
            * src/WebViewImpl.cpp:
            (WebKit::WebViewImpl::doPixelReadbackToCanvas):
            * tests/TransparencyWinTest.cpp:
            (WebCore::TEST):
    2010-10-20  Dirk Schulze  <krit at webkit.org>
    
            Reviewed by Nikolas Zimmermann.
    
            Merge ColorSpace and ImageColorSpace enums
            https://bugs.webkit.org/show_bug.cgi?id=47922
    
            Renamed ColorSpace enum entries DeviceColorSpace and sRGBColorSpace to ColorSpaceDeviceRGB and ColorSpaceSRGB
            to follow webkit style rules.
    
            * FullscreenVideoController.cpp:
            (HUDButton::draw):
            (HUDSlider::draw):
            (FullscreenVideoController::draw):
            * WebCoreSupport/WebDragClient.cpp:
            (WebDragClient::createDragImageForLink):
            * WebKitGraphics.cpp:
            (WebDrawText):
    2010-10-20  Dirk Schulze  <krit at webkit.org>
    
            Reviewed by Nikolas Zimmermann.
    
            Merge ColorSpace and ImageColorSpace enums
            https://bugs.webkit.org/show_bug.cgi?id=47922
    
            Renamed ColorSpace enum entries DeviceColorSpace and sRGBColorSpace to ColorSpaceDeviceRGB and ColorSpaceSRGB
            to follow webkit style rules.
    
            * Misc/WebKitNSStringExtras.mm:
            (-[NSString _web_drawAtPoint:font:textColor:allowingFontSmoothing:]):
    2010-10-20  Dirk Schulze  <krit at webkit.org>
    
            Reviewed by Nikolas Zimmermann.
    
            Merge ColorSpace and ImageColorSpace enums
            https://bugs.webkit.org/show_bug.cgi?id=47922
    
            Merging these two enums makes it easier to implement color-interpolation as well as
            color-interpolation-filter for SVG.
            Added ColorSpaceLinearRGB to the ColorSpace enum and changed ImageColorSpace to ColorSpace in all related
            files. Renamed enum entries DeviceColorSpace and sRGBColorSpace to ColorSpaceDeviceRGB and ColorSpaceSRGB
            to follow webkit style rules.
            Removed gray scale support in ImageBuffer since it is not used anymore on WebKit.
    
            * css/CSSPrimitiveValueMappings.h:
            (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
            (WebCore::CSSPrimitiveValue::operator ColorSpace):
            * css/CSSStyleSelector.cpp:
            (WebCore::CSSStyleSelector::applyProperty):
            * editing/SelectionController.cpp:
            (WebCore::SelectionController::paintCaret):
            * html/HTMLCanvasElement.cpp:
            (WebCore::HTMLCanvasElement::paint):
            * html/canvas/CanvasRenderingContext2D.cpp:
            (WebCore::CanvasRenderingContext2D::setAllAttributesToDefault):
            (WebCore::CanvasRenderingContext2D::setShadow):
            (WebCore::CanvasRenderingContext2D::applyShadow):
            (WebCore::CanvasRenderingContext2D::drawImage):
            (WebCore::CanvasRenderingContext2D::drawImageFromRect):
            (WebCore::CanvasRenderingContext2D::drawTextInternal):
            * html/canvas/CanvasStyle.cpp:
            (WebCore::CanvasStyle::applyStrokeColor):
            (WebCore::CanvasStyle::applyFillColor):
            * inspector/InspectorController.cpp:
            (WebCore::drawOutlinedQuad):
            (WebCore::InspectorController::drawElementTitle):
            * mathml/RenderMathMLBlock.cpp:
            (WebCore::RenderMathMLBlock::paint):
            * mathml/RenderMathMLFraction.cpp:
            (WebCore::RenderMathMLFraction::paint):
            * mathml/RenderMathMLRoot.cpp:
            (WebCore::RenderMathMLRoot::paint):
            * mathml/RenderMathMLSquareRoot.cpp:
            (WebCore::RenderMathMLSquareRoot::paint):
            * page/FrameView.cpp:
            (WebCore::FrameView::paintContents):
            * page/PrintContext.cpp:
            (WebCore::PrintContext::spoolAllPagesWithBoundaries):
            * platform/ScrollView.cpp:
            (WebCore::ScrollView::wheelEvent):
            * platform/ScrollbarTheme.h:
            (WebCore::ScrollbarTheme::paintScrollCorner):
            * platform/ScrollbarThemeComposite.cpp:
            (WebCore::ScrollbarThemeComposite::paintScrollCorner):
            * platform/chromium/PopupMenuChromium.cpp:
            (WebCore::PopupContainer::paintBorder):
            (WebCore::PopupListBox::paint):
            (WebCore::PopupListBox::paintRow):
            * platform/chromium/ScrollbarThemeChromium.cpp:
            (WebCore::ScrollbarThemeChromium::paintTickmarks):
            * platform/chromium/ScrollbarThemeChromiumMac.mm:
            (WebCore::ScrollbarThemeChromiumMac::paint):
            * platform/graphics/ColorSpace.h:
            * platform/graphics/GraphicsContext.cpp:
            (WebCore::GraphicsContext::setStrokePattern):
            (WebCore::GraphicsContext::setFillPattern):
            (WebCore::GraphicsContext::setStrokeGradient):
            (WebCore::GraphicsContext::setFillGradient):
            * platform/graphics/GraphicsContextPrivate.h:
            (WebCore::GraphicsContextState::GraphicsContextState):
            * platform/graphics/ImageBuffer.cpp:
            (WebCore::ImageBuffer::transformColorSpace):
            * platform/graphics/ImageBuffer.h:
            (WebCore::ImageBuffer::create):
            * platform/graphics/cairo/ImageBufferCairo.cpp:
            (WebCore::ImageBuffer::ImageBuffer):
            * platform/graphics/cg/ColorCG.cpp:
            (WebCore::cachedCGColorSpace):
            (WebCore::cachedCGColor):
            * platform/graphics/cg/GraphicsContextCG.cpp:
            (WebCore::linearRGBColorSpaceRef):
            * platform/graphics/cg/GraphicsContextCG.h:
            * platform/graphics/cg/ImageBufferCG.cpp:
            (WebCore::ImageBuffer::ImageBuffer):
            (WebCore::cgImage):
            (WebCore::ImageBuffer::draw):
            * platform/graphics/cg/ImageBufferData.h:
            * platform/graphics/cg/ImageCG.cpp:
            (WebCore::imageWithColorSpace):
            * platform/graphics/chromium/GLES2Canvas.cpp:
            (WebCore::GLES2Canvas::clearRect):
            (WebCore::GLES2Canvas::fillRect):
            * platform/graphics/chromium/TransparencyWin.cpp:
            (WebCore::TransparencyWin::setupLayerForWhiteLayer):
            * platform/graphics/filters/FEColorMatrix.cpp:
            (WebCore::FEColorMatrix::apply):
            * platform/graphics/filters/FEComposite.cpp:
            (WebCore::FEComposite::apply):
            * platform/graphics/filters/FEFlood.cpp:
            (WebCore::FEFlood::apply):
            * platform/graphics/filters/FEMerge.cpp:
            (WebCore::FEMerge::apply):
            * platform/graphics/filters/FEOffset.cpp:
            (WebCore::FEOffset::apply):
            * platform/graphics/filters/FETile.cpp:
            (WebCore::FETile::apply):
            * platform/graphics/filters/FilterEffect.cpp:
            (WebCore::FilterEffect::effectContext):
            * platform/graphics/filters/SourceAlpha.cpp:
            (WebCore::SourceAlpha::apply):
            * platform/graphics/filters/SourceGraphic.cpp:
            (WebCore::SourceGraphic::apply):
            * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
            (WebCore::MediaPlayerPrivateGStreamer::paint):
            * platform/graphics/gtk/FontGtk.cpp:
            (WebCore::Font::drawComplexText):
            * platform/graphics/mac/GraphicsContextMac.mm:
            (WebCore::GraphicsContext::drawFocusRing):
            * platform/graphics/mac/GraphicsLayerCA.mm:
            (WebCore::setLayerBorderColor):
            (WebCore::setLayerBackgroundColor):
            * platform/graphics/qt/GraphicsContextQt.cpp:
            (WebCore::GraphicsContext::GraphicsContext):
            * platform/graphics/qt/ImageBufferQt.cpp:
            (WebCore::ImageBuffer::ImageBuffer):
            (WebCore::ImageBuffer::draw):
            * platform/graphics/skia/ImageBufferSkia.cpp:
            (WebCore::ImageBuffer::ImageBuffer):
            * platform/graphics/skia/PlatformContextSkia.cpp:
            (WebCore::PlatformContextSkia::uploadSoftwareToHardware):
            * platform/graphics/win/FontCGWin.cpp:
            (WebCore::Font::drawGlyphs):
            * platform/graphics/win/GraphicsContextCGWin.cpp:
            (WebCore::GraphicsContext::GraphicsContext):
            (WebCore::GraphicsContext::drawFocusRing):
            * platform/graphics/win/GraphicsLayerCACF.cpp:
            (WebCore::setLayerBorderColor):
            (WebCore::setLayerBackgroundColor):
            * platform/graphics/win/ImageCGWin.cpp:
            (WebCore::BitmapImage::getHBITMAPOfSize):
            * platform/graphics/win/ImageCairoWin.cpp:
            (WebCore::BitmapImage::getHBITMAPOfSize):
            (WebCore::BitmapImage::drawFrameMatchingSourceSize):
            * platform/graphics/win/WebLayer.cpp:
            (WebCore::WebLayer::drawInContext):
            * platform/graphics/wince/GraphicsContextWinCE.cpp:
            (WebCore::GraphicsContext::clearRect):
            (WebCore::GraphicsContext::fillRect):
            * platform/graphics/wince/ImageWinCE.cpp:
            (WebCore::BitmapImage::getHBITMAPOfSize):
            * platform/graphics/wx/GraphicsContextWx.cpp:
            (WebCore::GraphicsContext::GraphicsContext):
            * platform/gtk/RenderThemeGtk.cpp:
            (WebCore::RenderThemeGtk::paintSearchFieldResultsDecoration):
            (WebCore::RenderThemeGtk::paintSearchFieldCancelButton):
            (WebCore::paintMediaButton):
            (WebCore::RenderThemeGtk::paintMediaSliderTrack):
            (WebCore::RenderThemeGtk::paintMediaSliderThumb):
            * platform/mac/ScrollbarThemeMac.mm:
            (WebCore::ScrollbarThemeMac::paint):
            * platform/win/PopupMenuWin.cpp:
            (WebCore::PopupMenuWin::paint):
            * platform/win/WebCoreTextRenderer.cpp:
            (WebCore::doDrawTextAtPoint):
            * platform/wx/wxcode/mac/carbon/non-kerned-drawing.cpp:
            (WebCore::drawTextWithSpacing):
            * plugins/PluginView.cpp:
            (WebCore::PluginView::paintMissingPluginIcon):
            * rendering/RenderLayer.cpp:
            (WebCore::RenderLayer::beginTransparencyLayers):
            (WebCore::RenderLayer::paintResizer):
            * rendering/RenderListMarker.cpp:
            (WebCore::RenderListMarker::paint):
            * rendering/RenderMediaControlsChromium.cpp:
            (WebCore::paintMediaButton):
            (WebCore::paintMediaSlider):
            (WebCore::paintMediaVolumeSlider):
            (WebCore::paintMediaTimelineContainer):
            * rendering/RenderSVGImage.cpp:
            (WebCore::RenderSVGImage::paint):
            * rendering/RenderSVGResourceClipper.cpp:
            (WebCore::RenderSVGResourceClipper::applyClippingToContext):
            * rendering/RenderSVGResourceFilter.cpp:
            (WebCore::RenderSVGResourceFilter::applyResource):
            (WebCore::RenderSVGResourceFilter::postApplyResource):
            * rendering/RenderSVGResourceGradient.cpp:
            (WebCore::createMaskAndSwapContextForTextGradient):
            * rendering/RenderSVGResourceMasker.cpp:
            (WebCore::RenderSVGResourceMasker::applyResource):
            (WebCore::RenderSVGResourceMasker::drawContentIntoMaskImage):
            * rendering/RenderSVGResourcePattern.cpp:
            (WebCore::RenderSVGResourcePattern::createTileImage):
            * rendering/RenderSVGResourceSolidColor.cpp:
            (WebCore::RenderSVGResourceSolidColor::applyResource):
            * rendering/RenderScrollbarTheme.cpp:
            (WebCore::RenderScrollbarTheme::paintScrollCorner):
            * rendering/RenderThemeMac.mm:
            (WebCore::RenderThemeMac::paintProgressBar):
            (WebCore::RenderThemeMac::paintMenuListButton):
            * rendering/RenderThemeSafari.cpp:
            (WebCore::RenderThemeSafari::paintMenuListButton):
            * rendering/RenderThemeWinCE.cpp:
            (WebCore::RenderThemeWinCE::paintSearchFieldCancelButton):
            (WebCore::RenderThemeWinCE::paintSliderTrack):
            (WebCore::RenderThemeWinCE::paintSliderThumb):
            * rendering/SVGImageBufferTools.cpp:
            (WebCore::SVGImageBufferTools::createImageBuffer):
            * rendering/SVGImageBufferTools.h:
            * rendering/style/StyleRareInheritedData.cpp:
            (WebCore::StyleRareInheritedData::StyleRareInheritedData):
            * svg/SVGFEImageElement.cpp:
            (WebCore::SVGFEImageElement::build):
            * svg/graphics/SVGImage.cpp:
            (WebCore::SVGImage::nativeImageForCurrentFrame):
            * svg/graphics/filters/SVGFEImage.cpp:
            (WebCore::FEImage::apply):
    2010-10-20  Dirk Schulze  <krit at webkit.org>
    
            Reviewed by Nikolas Zimmermann.
    
            Merge ColorSpace and ImageColorSpace enums
            https://bugs.webkit.org/show_bug.cgi?id=47922
    
            Renamed ColorSpace enum entries DeviceColorSpace and sRGBColorSpace to ColorSpaceDeviceRGB and ColorSpaceSRGB
            to follow webkit style rules.
    
            * UIProcess/FindIndicator.cpp:
            (WebKit::FindIndicator::draw):
            * WebProcess/WebPage/FindPageOverlay.cpp:
            (WebKit::FindPageOverlay::drawRect):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@70143 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index d2bdefc..ecbb1e9 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,5 +1,222 @@
 2010-10-20  Dirk Schulze  <krit at webkit.org>
 
+        Reviewed by Nikolas Zimmermann.
+
+        Merge ColorSpace and ImageColorSpace enums
+        https://bugs.webkit.org/show_bug.cgi?id=47922
+
+        Merging these two enums makes it easier to implement color-interpolation as well as
+        color-interpolation-filter for SVG.
+        Added ColorSpaceLinearRGB to the ColorSpace enum and changed ImageColorSpace to ColorSpace in all related
+        files. Renamed enum entries DeviceColorSpace and sRGBColorSpace to ColorSpaceDeviceRGB and ColorSpaceSRGB
+        to follow webkit style rules.
+        Removed gray scale support in ImageBuffer since it is not used anymore on WebKit.
+
+        * css/CSSPrimitiveValueMappings.h:
+        (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
+        (WebCore::CSSPrimitiveValue::operator ColorSpace):
+        * css/CSSStyleSelector.cpp:
+        (WebCore::CSSStyleSelector::applyProperty):
+        * editing/SelectionController.cpp:
+        (WebCore::SelectionController::paintCaret):
+        * html/HTMLCanvasElement.cpp:
+        (WebCore::HTMLCanvasElement::paint):
+        * html/canvas/CanvasRenderingContext2D.cpp:
+        (WebCore::CanvasRenderingContext2D::setAllAttributesToDefault):
+        (WebCore::CanvasRenderingContext2D::setShadow):
+        (WebCore::CanvasRenderingContext2D::applyShadow):
+        (WebCore::CanvasRenderingContext2D::drawImage):
+        (WebCore::CanvasRenderingContext2D::drawImageFromRect):
+        (WebCore::CanvasRenderingContext2D::drawTextInternal):
+        * html/canvas/CanvasStyle.cpp:
+        (WebCore::CanvasStyle::applyStrokeColor):
+        (WebCore::CanvasStyle::applyFillColor):
+        * inspector/InspectorController.cpp:
+        (WebCore::drawOutlinedQuad):
+        (WebCore::InspectorController::drawElementTitle):
+        * mathml/RenderMathMLBlock.cpp:
+        (WebCore::RenderMathMLBlock::paint):
+        * mathml/RenderMathMLFraction.cpp:
+        (WebCore::RenderMathMLFraction::paint):
+        * mathml/RenderMathMLRoot.cpp:
+        (WebCore::RenderMathMLRoot::paint):
+        * mathml/RenderMathMLSquareRoot.cpp:
+        (WebCore::RenderMathMLSquareRoot::paint):
+        * page/FrameView.cpp:
+        (WebCore::FrameView::paintContents):
+        * page/PrintContext.cpp:
+        (WebCore::PrintContext::spoolAllPagesWithBoundaries):
+        * platform/ScrollView.cpp:
+        (WebCore::ScrollView::wheelEvent):
+        * platform/ScrollbarTheme.h:
+        (WebCore::ScrollbarTheme::paintScrollCorner):
+        * platform/ScrollbarThemeComposite.cpp:
+        (WebCore::ScrollbarThemeComposite::paintScrollCorner):
+        * platform/chromium/PopupMenuChromium.cpp:
+        (WebCore::PopupContainer::paintBorder):
+        (WebCore::PopupListBox::paint):
+        (WebCore::PopupListBox::paintRow):
+        * platform/chromium/ScrollbarThemeChromium.cpp:
+        (WebCore::ScrollbarThemeChromium::paintTickmarks):
+        * platform/chromium/ScrollbarThemeChromiumMac.mm:
+        (WebCore::ScrollbarThemeChromiumMac::paint):
+        * platform/graphics/ColorSpace.h:
+        * platform/graphics/GraphicsContext.cpp:
+        (WebCore::GraphicsContext::setStrokePattern):
+        (WebCore::GraphicsContext::setFillPattern):
+        (WebCore::GraphicsContext::setStrokeGradient):
+        (WebCore::GraphicsContext::setFillGradient):
+        * platform/graphics/GraphicsContextPrivate.h:
+        (WebCore::GraphicsContextState::GraphicsContextState):
+        * platform/graphics/ImageBuffer.cpp:
+        (WebCore::ImageBuffer::transformColorSpace):
+        * platform/graphics/ImageBuffer.h:
+        (WebCore::ImageBuffer::create):
+        * platform/graphics/cairo/ImageBufferCairo.cpp:
+        (WebCore::ImageBuffer::ImageBuffer):
+        * platform/graphics/cg/ColorCG.cpp:
+        (WebCore::cachedCGColorSpace):
+        (WebCore::cachedCGColor):
+        * platform/graphics/cg/GraphicsContextCG.cpp:
+        (WebCore::linearRGBColorSpaceRef):
+        * platform/graphics/cg/GraphicsContextCG.h:
+        * platform/graphics/cg/ImageBufferCG.cpp:
+        (WebCore::ImageBuffer::ImageBuffer):
+        (WebCore::cgImage):
+        (WebCore::ImageBuffer::draw):
+        * platform/graphics/cg/ImageBufferData.h:
+        * platform/graphics/cg/ImageCG.cpp:
+        (WebCore::imageWithColorSpace):
+        * platform/graphics/chromium/GLES2Canvas.cpp:
+        (WebCore::GLES2Canvas::clearRect):
+        (WebCore::GLES2Canvas::fillRect):
+        * platform/graphics/chromium/TransparencyWin.cpp:
+        (WebCore::TransparencyWin::setupLayerForWhiteLayer):
+        * platform/graphics/filters/FEColorMatrix.cpp:
+        (WebCore::FEColorMatrix::apply):
+        * platform/graphics/filters/FEComposite.cpp:
+        (WebCore::FEComposite::apply):
+        * platform/graphics/filters/FEFlood.cpp:
+        (WebCore::FEFlood::apply):
+        * platform/graphics/filters/FEMerge.cpp:
+        (WebCore::FEMerge::apply):
+        * platform/graphics/filters/FEOffset.cpp:
+        (WebCore::FEOffset::apply):
+        * platform/graphics/filters/FETile.cpp:
+        (WebCore::FETile::apply):
+        * platform/graphics/filters/FilterEffect.cpp:
+        (WebCore::FilterEffect::effectContext):
+        * platform/graphics/filters/SourceAlpha.cpp:
+        (WebCore::SourceAlpha::apply):
+        * platform/graphics/filters/SourceGraphic.cpp:
+        (WebCore::SourceGraphic::apply):
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+        (WebCore::MediaPlayerPrivateGStreamer::paint):
+        * platform/graphics/gtk/FontGtk.cpp:
+        (WebCore::Font::drawComplexText):
+        * platform/graphics/mac/GraphicsContextMac.mm:
+        (WebCore::GraphicsContext::drawFocusRing):
+        * platform/graphics/mac/GraphicsLayerCA.mm:
+        (WebCore::setLayerBorderColor):
+        (WebCore::setLayerBackgroundColor):
+        * platform/graphics/qt/GraphicsContextQt.cpp:
+        (WebCore::GraphicsContext::GraphicsContext):
+        * platform/graphics/qt/ImageBufferQt.cpp:
+        (WebCore::ImageBuffer::ImageBuffer):
+        (WebCore::ImageBuffer::draw):
+        * platform/graphics/skia/ImageBufferSkia.cpp:
+        (WebCore::ImageBuffer::ImageBuffer):
+        * platform/graphics/skia/PlatformContextSkia.cpp:
+        (WebCore::PlatformContextSkia::uploadSoftwareToHardware):
+        * platform/graphics/win/FontCGWin.cpp:
+        (WebCore::Font::drawGlyphs):
+        * platform/graphics/win/GraphicsContextCGWin.cpp:
+        (WebCore::GraphicsContext::GraphicsContext):
+        (WebCore::GraphicsContext::drawFocusRing):
+        * platform/graphics/win/GraphicsLayerCACF.cpp:
+        (WebCore::setLayerBorderColor):
+        (WebCore::setLayerBackgroundColor):
+        * platform/graphics/win/ImageCGWin.cpp:
+        (WebCore::BitmapImage::getHBITMAPOfSize):
+        * platform/graphics/win/ImageCairoWin.cpp:
+        (WebCore::BitmapImage::getHBITMAPOfSize):
+        (WebCore::BitmapImage::drawFrameMatchingSourceSize):
+        * platform/graphics/win/WebLayer.cpp:
+        (WebCore::WebLayer::drawInContext):
+        * platform/graphics/wince/GraphicsContextWinCE.cpp:
+        (WebCore::GraphicsContext::clearRect):
+        (WebCore::GraphicsContext::fillRect):
+        * platform/graphics/wince/ImageWinCE.cpp:
+        (WebCore::BitmapImage::getHBITMAPOfSize):
+        * platform/graphics/wx/GraphicsContextWx.cpp:
+        (WebCore::GraphicsContext::GraphicsContext):
+        * platform/gtk/RenderThemeGtk.cpp:
+        (WebCore::RenderThemeGtk::paintSearchFieldResultsDecoration):
+        (WebCore::RenderThemeGtk::paintSearchFieldCancelButton):
+        (WebCore::paintMediaButton):
+        (WebCore::RenderThemeGtk::paintMediaSliderTrack):
+        (WebCore::RenderThemeGtk::paintMediaSliderThumb):
+        * platform/mac/ScrollbarThemeMac.mm:
+        (WebCore::ScrollbarThemeMac::paint):
+        * platform/win/PopupMenuWin.cpp:
+        (WebCore::PopupMenuWin::paint):
+        * platform/win/WebCoreTextRenderer.cpp:
+        (WebCore::doDrawTextAtPoint):
+        * platform/wx/wxcode/mac/carbon/non-kerned-drawing.cpp:
+        (WebCore::drawTextWithSpacing):
+        * plugins/PluginView.cpp:
+        (WebCore::PluginView::paintMissingPluginIcon):
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::beginTransparencyLayers):
+        (WebCore::RenderLayer::paintResizer):
+        * rendering/RenderListMarker.cpp:
+        (WebCore::RenderListMarker::paint):
+        * rendering/RenderMediaControlsChromium.cpp:
+        (WebCore::paintMediaButton):
+        (WebCore::paintMediaSlider):
+        (WebCore::paintMediaVolumeSlider):
+        (WebCore::paintMediaTimelineContainer):
+        * rendering/RenderSVGImage.cpp:
+        (WebCore::RenderSVGImage::paint):
+        * rendering/RenderSVGResourceClipper.cpp:
+        (WebCore::RenderSVGResourceClipper::applyClippingToContext):
+        * rendering/RenderSVGResourceFilter.cpp:
+        (WebCore::RenderSVGResourceFilter::applyResource):
+        (WebCore::RenderSVGResourceFilter::postApplyResource):
+        * rendering/RenderSVGResourceGradient.cpp:
+        (WebCore::createMaskAndSwapContextForTextGradient):
+        * rendering/RenderSVGResourceMasker.cpp:
+        (WebCore::RenderSVGResourceMasker::applyResource):
+        (WebCore::RenderSVGResourceMasker::drawContentIntoMaskImage):
+        * rendering/RenderSVGResourcePattern.cpp:
+        (WebCore::RenderSVGResourcePattern::createTileImage):
+        * rendering/RenderSVGResourceSolidColor.cpp:
+        (WebCore::RenderSVGResourceSolidColor::applyResource):
+        * rendering/RenderScrollbarTheme.cpp:
+        (WebCore::RenderScrollbarTheme::paintScrollCorner):
+        * rendering/RenderThemeMac.mm:
+        (WebCore::RenderThemeMac::paintProgressBar):
+        (WebCore::RenderThemeMac::paintMenuListButton):
+        * rendering/RenderThemeSafari.cpp:
+        (WebCore::RenderThemeSafari::paintMenuListButton):
+        * rendering/RenderThemeWinCE.cpp:
+        (WebCore::RenderThemeWinCE::paintSearchFieldCancelButton):
+        (WebCore::RenderThemeWinCE::paintSliderTrack):
+        (WebCore::RenderThemeWinCE::paintSliderThumb):
+        * rendering/SVGImageBufferTools.cpp:
+        (WebCore::SVGImageBufferTools::createImageBuffer):
+        * rendering/SVGImageBufferTools.h:
+        * rendering/style/StyleRareInheritedData.cpp:
+        (WebCore::StyleRareInheritedData::StyleRareInheritedData):
+        * svg/SVGFEImageElement.cpp:
+        (WebCore::SVGFEImageElement::build):
+        * svg/graphics/SVGImage.cpp:
+        (WebCore::SVGImage::nativeImageForCurrentFrame):
+        * svg/graphics/filters/SVGFEImage.cpp:
+        (WebCore::FEImage::apply):
+
+2010-10-20  Dirk Schulze  <krit at webkit.org>
+
         Reviewed by Andreas Kling.
 
         Remove left over code after moving Cairo port to ShadowContext
diff --git a/WebCore/css/CSSPrimitiveValueMappings.h b/WebCore/css/CSSPrimitiveValueMappings.h
index 61ba45b..a57a882 100644
--- a/WebCore/css/CSSPrimitiveValueMappings.h
+++ b/WebCore/css/CSSPrimitiveValueMappings.h
@@ -2189,25 +2189,30 @@ template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ColorSpace space)
     , m_hasCachedCSSText(false)
 {
     switch (space) {
-        case DeviceColorSpace:
-            m_value.ident = CSSValueDefault;
-            break;
-        case sRGBColorSpace:
-            m_value.ident = CSSValueSrgb;
-            break;
+    case ColorSpaceDeviceRGB:
+        m_value.ident = CSSValueDefault;
+        break;
+    case ColorSpaceSRGB:
+        m_value.ident = CSSValueSrgb;
+        break;
+    case ColorSpaceLinearRGB:
+        // CSS color correction does not support linearRGB yet.
+        ASSERT_NOT_REACHED();
+        m_value.ident = CSSValueDefault;
+        break;
     }
 }
 
 template<> inline CSSPrimitiveValue::operator ColorSpace() const
 {
     switch (m_value.ident) {
-        case CSSValueDefault:
-            return DeviceColorSpace;
-        case CSSValueSrgb:
-            return sRGBColorSpace;
-        default:
-            ASSERT_NOT_REACHED();
-            return DeviceColorSpace;
+    case CSSValueDefault:
+        return ColorSpaceDeviceRGB;
+    case CSSValueSrgb:
+        return ColorSpaceSRGB;
+    default:
+        ASSERT_NOT_REACHED();
+        return ColorSpaceDeviceRGB;
     }
 }
 
diff --git a/WebCore/css/CSSStyleSelector.cpp b/WebCore/css/CSSStyleSelector.cpp
index 1c5b368..a47aaf3 100644
--- a/WebCore/css/CSSStyleSelector.cpp
+++ b/WebCore/css/CSSStyleSelector.cpp
@@ -5582,7 +5582,7 @@ void CSSStyleSelector::applyProperty(int id, CSSValue *value)
         if (isInherit) 
             m_style->setColorSpace(m_parentStyle->colorSpace());
         else if (isInitial)
-            m_style->setColorSpace(DeviceColorSpace);
+            m_style->setColorSpace(ColorSpaceDeviceRGB);
         else {
             if (!primitiveValue)
                 return;
diff --git a/WebCore/editing/SelectionController.cpp b/WebCore/editing/SelectionController.cpp
index cbcf306..6f25c86 100644
--- a/WebCore/editing/SelectionController.cpp
+++ b/WebCore/editing/SelectionController.cpp
@@ -1085,7 +1085,7 @@ void SelectionController::paintCaret(GraphicsContext* context, int tx, int ty, c
         return;
 
     Color caretColor = Color::black;
-    ColorSpace colorSpace = DeviceColorSpace;
+    ColorSpace colorSpace = ColorSpaceDeviceRGB;
     Element* element = rootEditableElement();
     if (element && element->renderer()) {
         caretColor = element->renderer()->style()->visitedDependentColor(CSSPropertyColor);
diff --git a/WebCore/html/HTMLCanvasElement.cpp b/WebCore/html/HTMLCanvasElement.cpp
index 634fe13..fea70d1 100644
--- a/WebCore/html/HTMLCanvasElement.cpp
+++ b/WebCore/html/HTMLCanvasElement.cpp
@@ -260,9 +260,9 @@ void HTMLCanvasElement::paint(GraphicsContext* context, const IntRect& r)
         ImageBuffer* imageBuffer = buffer();
         if (imageBuffer) {
             if (imageBuffer->drawsUsingCopy())
-                context->drawImage(copiedImage(), DeviceColorSpace, r);
+                context->drawImage(copiedImage(), ColorSpaceDeviceRGB, r);
             else
-                context->drawImageBuffer(imageBuffer, DeviceColorSpace, r);
+                context->drawImageBuffer(imageBuffer, ColorSpaceDeviceRGB, r);
         }
     }
 }
diff --git a/WebCore/html/canvas/CanvasRenderingContext2D.cpp b/WebCore/html/canvas/CanvasRenderingContext2D.cpp
index 9cffd92..b1d7b23 100644
--- a/WebCore/html/canvas/CanvasRenderingContext2D.cpp
+++ b/WebCore/html/canvas/CanvasRenderingContext2D.cpp
@@ -231,7 +231,7 @@ void CanvasRenderingContext2D::setAllAttributesToDefault()
     if (!context)
         return;
 
-    context->setShadow(FloatSize(), 0, Color::transparent, DeviceColorSpace);
+    context->setShadow(FloatSize(), 0, Color::transparent, ColorSpaceDeviceRGB);
     context->setAlpha(1);
     context->setCompositeOperation(CompositeSourceOver);
 }
@@ -1012,7 +1012,7 @@ void CanvasRenderingContext2D::setShadow(float width, float height, float blur,
     if (!c)
         return;
 
-    c->setShadow(IntSize(width, -height), state().m_shadowBlur, state().m_shadowColor, DeviceColorSpace);
+    c->setShadow(IntSize(width, -height), state().m_shadowBlur, state().m_shadowColor, ColorSpaceDeviceRGB);
 }
 
 void CanvasRenderingContext2D::setShadow(float width, float height, float blur, const String& color, float alpha)
@@ -1030,7 +1030,7 @@ void CanvasRenderingContext2D::setShadow(float width, float height, float blur,
     if (!c)
         return;
 
-    c->setShadow(IntSize(width, -height), state().m_shadowBlur, state().m_shadowColor, DeviceColorSpace);
+    c->setShadow(IntSize(width, -height), state().m_shadowBlur, state().m_shadowColor, ColorSpaceDeviceRGB);
 }
 
 void CanvasRenderingContext2D::setShadow(float width, float height, float blur, float grayLevel, float alpha)
@@ -1043,7 +1043,7 @@ void CanvasRenderingContext2D::setShadow(float width, float height, float blur,
     if (!c)
         return;
 
-    c->setShadow(IntSize(width, -height), state().m_shadowBlur, state().m_shadowColor, DeviceColorSpace);
+    c->setShadow(IntSize(width, -height), state().m_shadowBlur, state().m_shadowColor, ColorSpaceDeviceRGB);
 }
 
 void CanvasRenderingContext2D::setShadow(float width, float height, float blur, float r, float g, float b, float a)
@@ -1056,7 +1056,7 @@ void CanvasRenderingContext2D::setShadow(float width, float height, float blur,
     if (!c)
         return;
 
-    c->setShadow(IntSize(width, -height), state().m_shadowBlur, state().m_shadowColor, DeviceColorSpace);
+    c->setShadow(IntSize(width, -height), state().m_shadowBlur, state().m_shadowColor, ColorSpaceDeviceRGB);
 }
 
 void CanvasRenderingContext2D::setShadow(float width, float height, float blur, float c, float m, float y, float k, float a)
@@ -1076,7 +1076,7 @@ void CanvasRenderingContext2D::setShadow(float width, float height, float blur,
     CGContextSetShadowWithColor(dc->platformContext(), adjustedShadowSize(width, -height), blur, shadowColor);
     CGColorRelease(shadowColor);
 #else
-    dc->setShadow(IntSize(width, -height), blur, state().m_shadowColor, DeviceColorSpace);
+    dc->setShadow(IntSize(width, -height), blur, state().m_shadowColor, ColorSpaceDeviceRGB);
 #endif
 }
 
@@ -1096,7 +1096,7 @@ void CanvasRenderingContext2D::applyShadow()
 
     float width = state().m_shadowOffset.width();
     float height = state().m_shadowOffset.height();
-    c->setShadow(FloatSize(width, -height), state().m_shadowBlur, state().m_shadowColor, DeviceColorSpace);
+    c->setShadow(FloatSize(width, -height), state().m_shadowBlur, state().m_shadowColor, ColorSpaceDeviceRGB);
 }
 
 static IntSize size(HTMLImageElement* image)
@@ -1198,7 +1198,7 @@ void CanvasRenderingContext2D::drawImage(HTMLImageElement* image, const FloatRec
 
     FloatRect sourceRect = c->roundToDevicePixels(normalizedSrcRect);
     FloatRect destRect = c->roundToDevicePixels(normalizedDstRect);
-    c->drawImage(cachedImage->image(), DeviceColorSpace, destRect, sourceRect, state().m_globalComposite);
+    c->drawImage(cachedImage->image(), ColorSpaceDeviceRGB, destRect, sourceRect, state().m_globalComposite);
     didDraw(destRect);
 }
 
@@ -1280,7 +1280,7 @@ void CanvasRenderingContext2D::drawImage(HTMLCanvasElement* sourceCanvas, const
     sourceCanvas->makeRenderingResultsAvailable();
 #endif
 
-    c->drawImageBuffer(buffer, DeviceColorSpace, destRect, sourceRect, state().m_globalComposite);
+    c->drawImageBuffer(buffer, ColorSpaceDeviceRGB, destRect, sourceRect, state().m_globalComposite);
     didDraw(destRect);
 }
 
@@ -1383,7 +1383,7 @@ void CanvasRenderingContext2D::drawImageFromRect(HTMLImageElement* image,
         op = CompositeSourceOver;
 
     FloatRect destRect = FloatRect(dx, dy, dw, dh);
-    c->drawImage(cachedImage->image(), DeviceColorSpace, destRect, FloatRect(sx, sy, sw, sh), op);
+    c->drawImage(cachedImage->image(), ColorSpaceDeviceRGB, destRect, FloatRect(sx, sy, sw, sh), op);
     didDraw(destRect);
 }
 
@@ -1830,9 +1830,9 @@ void CanvasRenderingContext2D::drawTextInternal(const String& text, float x, flo
         GraphicsContext* maskImageContext = maskImage->context();
 
         if (fill)
-            maskImageContext->setFillColor(Color::black, DeviceColorSpace);
+            maskImageContext->setFillColor(Color::black, ColorSpaceDeviceRGB);
         else {
-            maskImageContext->setStrokeColor(Color::black, DeviceColorSpace);
+            maskImageContext->setStrokeColor(Color::black, ColorSpaceDeviceRGB);
             maskImageContext->setStrokeThickness(c->strokeThickness());
         }
 
diff --git a/WebCore/html/canvas/CanvasStyle.cpp b/WebCore/html/canvas/CanvasStyle.cpp
index 068733f..a4e87e3 100644
--- a/WebCore/html/canvas/CanvasStyle.cpp
+++ b/WebCore/html/canvas/CanvasStyle.cpp
@@ -229,7 +229,7 @@ void CanvasStyle::applyStrokeColor(GraphicsContext* context)
         return;
     switch (m_type) {
     case RGBA:
-        context->setStrokeColor(m_rgba, DeviceColorSpace);
+        context->setStrokeColor(m_rgba, ColorSpaceDeviceRGB);
         break;
     case CMYKA: {
         // FIXME: Do this through platform-independent GraphicsContext API.
@@ -243,7 +243,7 @@ void CanvasStyle::applyStrokeColor(GraphicsContext* context)
         currentPen.setColor(clr);
         context->platformContext()->setPen(currentPen);
 #else
-        context->setStrokeColor(m_rgba, DeviceColorSpace);
+        context->setStrokeColor(m_rgba, ColorSpaceDeviceRGB);
 #endif
         break;
     }
@@ -266,7 +266,7 @@ void CanvasStyle::applyFillColor(GraphicsContext* context)
         return;
     switch (m_type) {
     case RGBA:
-        context->setFillColor(m_rgba, DeviceColorSpace);
+        context->setFillColor(m_rgba, ColorSpaceDeviceRGB);
         break;
     case CMYKA: {
         // FIXME: Do this through platform-independent GraphicsContext API.
@@ -280,7 +280,7 @@ void CanvasStyle::applyFillColor(GraphicsContext* context)
         currentBrush.setColor(clr);
         context->platformContext()->setBrush(currentBrush);
 #else
-        context->setFillColor(m_rgba, DeviceColorSpace);
+        context->setFillColor(m_rgba, ColorSpaceDeviceRGB);
 #endif
         break;
     }
diff --git a/WebCore/inspector/InspectorController.cpp b/WebCore/inspector/InspectorController.cpp
index 8472aa2..f99d487 100644
--- a/WebCore/inspector/InspectorController.cpp
+++ b/WebCore/inspector/InspectorController.cpp
@@ -1838,7 +1838,7 @@ static void drawOutlinedQuad(GraphicsContext& context, const FloatQuad& quad, co
 
         context.addPath(quadPath);
         context.setStrokeThickness(outlineThickness);
-        context.setStrokeColor(outlineColor, DeviceColorSpace);
+        context.setStrokeColor(outlineColor, ColorSpaceDeviceRGB);
         context.strokePath();
 
         context.restore();
@@ -1846,7 +1846,7 @@ static void drawOutlinedQuad(GraphicsContext& context, const FloatQuad& quad, co
 
     // Now do the fill
     context.addPath(quadPath);
-    context.setFillColor(fillColor, DeviceColorSpace);
+    context.setFillColor(fillColor, ColorSpaceDeviceRGB);
     context.fillPath();
 }
 
@@ -2028,11 +2028,11 @@ void InspectorController::drawElementTitle(GraphicsContext& context, const IntRe
     if (titleRect.bottom() > overlayRect.bottom())
         dy += overlayRect.bottom() - titleRect.bottom() - borderWidthPx;
     titleRect.move(dx, dy);
-    context.setStrokeColor(tooltipBorderColor, DeviceColorSpace);
+    context.setStrokeColor(tooltipBorderColor, ColorSpaceDeviceRGB);
     context.setStrokeThickness(borderWidthPx);
-    context.setFillColor(tooltipBackgroundColor, DeviceColorSpace);
+    context.setFillColor(tooltipBackgroundColor, ColorSpaceDeviceRGB);
     context.drawRect(titleRect);
-    context.setFillColor(tooltipFontColor, DeviceColorSpace);
+    context.setFillColor(tooltipFontColor, ColorSpaceDeviceRGB);
     context.drawText(font, nodeTitleRun, IntPoint(titleRect.x() + rectInflatePx, titleRect.y() + font.height()));
 }
 
diff --git a/WebCore/mathml/RenderMathMLBlock.cpp b/WebCore/mathml/RenderMathMLBlock.cpp
index ef94893..c625b1d 100644
--- a/WebCore/mathml/RenderMathMLBlock.cpp
+++ b/WebCore/mathml/RenderMathMLBlock.cpp
@@ -89,7 +89,7 @@ void RenderMathMLBlock::paint(PaintInfo& info, int tx, int ty)
     
     info.context->setStrokeThickness(1.0f);
     info.context->setStrokeStyle(SolidStroke);
-    info.context->setStrokeColor(Color(0, 0, 255), sRGBColorSpace);
+    info.context->setStrokeColor(Color(0, 0, 255), ColorSpaceSRGB);
     
     info.context->drawLine(IntPoint(tx, ty), IntPoint(tx + offsetWidth(), ty));
     info.context->drawLine(IntPoint(tx + offsetWidth(), ty), IntPoint(tx + offsetWidth(), ty + offsetHeight()));
@@ -98,13 +98,13 @@ void RenderMathMLBlock::paint(PaintInfo& info, int tx, int ty)
     
     int topStart = paddingTop();
     
-    info.context->setStrokeColor(Color(0, 255, 0), sRGBColorSpace);
+    info.context->setStrokeColor(Color(0, 255, 0), ColorSpaceSRGB);
     
     info.context->drawLine(IntPoint(tx, ty + topStart), IntPoint(tx + offsetWidth(), ty + topStart));
     
     int baseline = baselinePosition(true);
     
-    info.context->setStrokeColor(Color(255, 0, 0), sRGBColorSpace);
+    info.context->setStrokeColor(Color(255, 0, 0), ColorSpaceSRGB);
     
     info.context->drawLine(IntPoint(tx, ty + baseline), IntPoint(tx + offsetWidth(), ty + baseline));
     
diff --git a/WebCore/mathml/RenderMathMLFraction.cpp b/WebCore/mathml/RenderMathMLFraction.cpp
index 7d48e62..92c8101 100644
--- a/WebCore/mathml/RenderMathMLFraction.cpp
+++ b/WebCore/mathml/RenderMathMLFraction.cpp
@@ -167,7 +167,7 @@ void RenderMathMLFraction::paint(PaintInfo& info, int tx, int ty)
     
     info.context->setStrokeThickness(static_cast<float>(m_lineThickness));
     info.context->setStrokeStyle(SolidStroke);
-    info.context->setStrokeColor(style()->visitedDependentColor(CSSPropertyColor), sRGBColorSpace);
+    info.context->setStrokeColor(style()->visitedDependentColor(CSSPropertyColor), ColorSpaceSRGB);
     
     info.context->drawLine(IntPoint(tx, ty), IntPoint(tx + offsetWidth(), ty));
     
diff --git a/WebCore/mathml/RenderMathMLRoot.cpp b/WebCore/mathml/RenderMathMLRoot.cpp
index 99b5dc6..ab15c80 100644
--- a/WebCore/mathml/RenderMathMLRoot.cpp
+++ b/WebCore/mathml/RenderMathMLRoot.cpp
@@ -151,7 +151,7 @@ void RenderMathMLRoot::paint(PaintInfo& info, int tx, int ty)
     
     info.context->setStrokeThickness(gRadicalLineThickness * style()->fontSize());
     info.context->setStrokeStyle(SolidStroke);
-    info.context->setStrokeColor(style()->visitedDependentColor(CSSPropertyColor), DeviceColorSpace);
+    info.context->setStrokeColor(style()->visitedDependentColor(CSSPropertyColor), ColorSpaceDeviceRGB);
     info.context->setLineJoin(MiterJoin);
     info.context->setMiterLimit(style()->fontSize());
     
diff --git a/WebCore/mathml/RenderMathMLSquareRoot.cpp b/WebCore/mathml/RenderMathMLSquareRoot.cpp
index d2e7049..862d8a4 100644
--- a/WebCore/mathml/RenderMathMLSquareRoot.cpp
+++ b/WebCore/mathml/RenderMathMLSquareRoot.cpp
@@ -117,7 +117,7 @@ void RenderMathMLSquareRoot::paint(PaintInfo& info, int tx, int ty)
     
     info.context->setStrokeThickness(gRadicalLineThickness * style()->fontSize());
     info.context->setStrokeStyle(SolidStroke);
-    info.context->setStrokeColor(style()->visitedDependentColor(CSSPropertyColor), DeviceColorSpace);
+    info.context->setStrokeColor(style()->visitedDependentColor(CSSPropertyColor), ColorSpaceDeviceRGB);
     info.context->setLineJoin(MiterJoin);
     info.context->setMiterLimit(style()->fontSize());
     
diff --git a/WebCore/page/FrameView.cpp b/WebCore/page/FrameView.cpp
index 676c864..0c063e0 100644
--- a/WebCore/page/FrameView.cpp
+++ b/WebCore/page/FrameView.cpp
@@ -1959,7 +1959,7 @@ void FrameView::paintContents(GraphicsContext* p, const IntRect& rect)
         fillWithRed = true;
     
     if (fillWithRed)
-        p->fillRect(rect, Color(0xFF, 0, 0), DeviceColorSpace);
+        p->fillRect(rect, Color(0xFF, 0, 0), ColorSpaceDeviceRGB);
 #endif
 
     bool isTopLevelPainter = !sCurrentPaintTimeStamp;
diff --git a/WebCore/page/PrintContext.cpp b/WebCore/page/PrintContext.cpp
index d99c8fe..7acca96 100644
--- a/WebCore/page/PrintContext.cpp
+++ b/WebCore/page/PrintContext.cpp
@@ -271,7 +271,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), DeviceColorSpace);
+    graphicsContext.setFillColor(Color(255, 255, 255), ColorSpaceDeviceRGB);
     graphicsContext.fillRect(FloatRect(0, 0, pageWidth, totalHeight));
 
     graphicsContext.save();
@@ -283,8 +283,8 @@ void PrintContext::spoolAllPagesWithBoundaries(Frame* frame, GraphicsContext& gr
         // Draw a line for a page boundary if this isn't the first page.
         if (pageIndex > 0) {
             graphicsContext.save();
-            graphicsContext.setStrokeColor(Color(0, 0, 255), DeviceColorSpace);
-            graphicsContext.setFillColor(Color(0, 0, 255), DeviceColorSpace);
+            graphicsContext.setStrokeColor(Color(0, 0, 255), ColorSpaceDeviceRGB);
+            graphicsContext.setFillColor(Color(0, 0, 255), ColorSpaceDeviceRGB);
             graphicsContext.drawLine(IntPoint(0, currentHeight),
                                      IntPoint(pageWidth, currentHeight));
             graphicsContext.restore();
diff --git a/WebCore/platform/ScrollView.cpp b/WebCore/platform/ScrollView.cpp
index 66dcb8a..f5174d3 100644
--- a/WebCore/platform/ScrollView.cpp
+++ b/WebCore/platform/ScrollView.cpp
@@ -804,7 +804,7 @@ void ScrollView::paintScrollbars(GraphicsContext* context, const IntRect& rect)
 void ScrollView::paintPanScrollIcon(GraphicsContext* context)
 {
     static Image* panScrollIcon = Image::loadPlatformResource("panIcon").releaseRef();
-    context->drawImage(panScrollIcon, DeviceColorSpace, m_panScrollIconPoint);
+    context->drawImage(panScrollIcon, ColorSpaceDeviceRGB, m_panScrollIconPoint);
 }
 
 void ScrollView::paint(GraphicsContext* context, const IntRect& rect)
diff --git a/WebCore/platform/ScrollbarTheme.h b/WebCore/platform/ScrollbarTheme.h
index c5c2094..0efaf7a 100644
--- a/WebCore/platform/ScrollbarTheme.h
+++ b/WebCore/platform/ScrollbarTheme.h
@@ -73,7 +73,7 @@ public:
 
     virtual void invalidatePart(Scrollbar*, ScrollbarPart) {}
 
-    virtual void paintScrollCorner(ScrollView*, GraphicsContext* context, const IntRect& cornerRect) { context->fillRect(cornerRect, Color::white, DeviceColorSpace); }
+    virtual void paintScrollCorner(ScrollView*, GraphicsContext* context, const IntRect& cornerRect) { context->fillRect(cornerRect, Color::white, ColorSpaceDeviceRGB); }
 
     virtual bool shouldCenterOnThumb(Scrollbar*, const PlatformMouseEvent&) { return false; }
     virtual bool shouldSnapBackToDragOrigin(Scrollbar*, const PlatformMouseEvent&) { return false; }
diff --git a/WebCore/platform/ScrollbarThemeComposite.cpp b/WebCore/platform/ScrollbarThemeComposite.cpp
index fdac14d..bf00ebb 100644
--- a/WebCore/platform/ScrollbarThemeComposite.cpp
+++ b/WebCore/platform/ScrollbarThemeComposite.cpp
@@ -298,7 +298,7 @@ void ScrollbarThemeComposite::paintScrollCorner(ScrollView* view, GraphicsContex
     Page* page = frameView->frame() ? frameView->frame()->page() : 0;
     if (page && page->settings()->shouldPaintCustomScrollbars() && page->chrome()->client()->paintCustomScrollCorner(context, cornerRect))
         return;
-    context->fillRect(cornerRect, Color::white, DeviceColorSpace);
+    context->fillRect(cornerRect, Color::white, ColorSpaceDeviceRGB);
 }
 
 }
diff --git a/WebCore/platform/chromium/PopupMenuChromium.cpp b/WebCore/platform/chromium/PopupMenuChromium.cpp
index 9c73a9c..3c807ba 100644
--- a/WebCore/platform/chromium/PopupMenuChromium.cpp
+++ b/WebCore/platform/chromium/PopupMenuChromium.cpp
@@ -513,7 +513,7 @@ void PopupContainer::paintBorder(GraphicsContext* gc, const IntRect& rect)
     Color borderColor(127, 157, 185);
 
     gc->setStrokeStyle(NoStroke);
-    gc->setFillColor(borderColor, DeviceColorSpace);
+    gc->setFillColor(borderColor, ColorSpaceDeviceRGB);
 
     int tx = x();
     int ty = y();
@@ -857,7 +857,7 @@ void PopupListBox::paint(GraphicsContext* gc, const IntRect& rect)
 
     // Special case for an empty popup.
     if (numItems() == 0)
-        gc->fillRect(r, Color::white, DeviceColorSpace);
+        gc->fillRect(r, Color::white, ColorSpaceDeviceRGB);
 
     gc->restore();
 
@@ -894,23 +894,23 @@ void PopupListBox::paintRow(GraphicsContext* gc, const IntRect& rect, int rowInd
     // If we have a transparent background, make sure it has a color to blend
     // against.
     if (backColor.hasAlpha())
-        gc->fillRect(rowRect, Color::white, DeviceColorSpace);
+        gc->fillRect(rowRect, Color::white, ColorSpaceDeviceRGB);
 
-    gc->fillRect(rowRect, backColor, DeviceColorSpace);
+    gc->fillRect(rowRect, backColor, ColorSpaceDeviceRGB);
     
     if (m_popupClient->itemIsSeparator(rowIndex)) {
         IntRect separatorRect(
             rowRect.x() + separatorPadding,
             rowRect.y() + (rowRect.height() - separatorHeight) / 2,
             rowRect.width() - 2 * separatorPadding, separatorHeight);
-        gc->fillRect(separatorRect, textColor, DeviceColorSpace);
+        gc->fillRect(separatorRect, textColor, ColorSpaceDeviceRGB);
         return;
     }
     
     if (!style.isVisible())
         return;
 
-    gc->setFillColor(textColor, DeviceColorSpace);
+    gc->setFillColor(textColor, ColorSpaceDeviceRGB);
 
     Font itemFont = getRowFont(rowIndex);
     // FIXME: http://crbug.com/19872 We should get the padding of individual option
@@ -973,7 +973,7 @@ void PopupListBox::paintRow(GraphicsContext* gc, const IntRect& rect, int rowInd
         remainingWidth -= (imageRect.width() + kLabelToIconPadding);
         imageRect.setX(rowRect.width() - rightPadding - imageRect.width());
         imageRect.setY(rowRect.y() + (rowRect.height() - imageRect.height()) / 2);
-        gc->drawImage(image.get(), DeviceColorSpace, imageRect);
+        gc->drawImage(image.get(), ColorSpaceDeviceRGB, imageRect);
     }
 
     // Draw the the label if applicable.
@@ -985,7 +985,7 @@ void PopupListBox::paintRow(GraphicsContext* gc, const IntRect& rect, int rowInd
     else
         textX = remainingWidth - itemFont.width(labelTextRun);
 
-    gc->setFillColor(labelColor, DeviceColorSpace);
+    gc->setFillColor(labelColor, ColorSpaceDeviceRGB);
     gc->drawBidiText(itemFont, labelTextRun, IntPoint(textX, textY));
 }
 
diff --git a/WebCore/platform/chromium/ScrollbarThemeChromium.cpp b/WebCore/platform/chromium/ScrollbarThemeChromium.cpp
index cf3ca6f..234d0ee 100644
--- a/WebCore/platform/chromium/ScrollbarThemeChromium.cpp
+++ b/WebCore/platform/chromium/ScrollbarThemeChromium.cpp
@@ -131,7 +131,7 @@ void ScrollbarThemeChromium::paintTickmarks(GraphicsContext* context, Scrollbar*
         const int yPos = rect.topLeft().y() + (rect.height() * percent);
 
         IntPoint tick(scrollbar->x(), yPos);
-        context->drawImage(dash.get(), DeviceColorSpace, tick);
+        context->drawImage(dash.get(), ColorSpaceDeviceRGB, tick);
     }
 
     context->restore();
diff --git a/WebCore/platform/chromium/ScrollbarThemeChromiumMac.mm b/WebCore/platform/chromium/ScrollbarThemeChromiumMac.mm
index bafc96e..b47e998 100644
--- a/WebCore/platform/chromium/ScrollbarThemeChromiumMac.mm
+++ b/WebCore/platform/chromium/ScrollbarThemeChromiumMac.mm
@@ -417,8 +417,8 @@ bool ScrollbarThemeChromiumMac::paint(Scrollbar* scrollbar, GraphicsContext* con
     if (scrollbar->orientation() == VerticalScrollbar && tickmarks.size()) {
         drawingContext->save();
         drawingContext->setShouldAntialias(false);
-        drawingContext->setStrokeColor(Color(0xCC, 0xAA, 0x00, 0xFF), DeviceColorSpace);
-        drawingContext->setFillColor(Color(0xFF, 0xDD, 0x00, 0xFF), DeviceColorSpace);
+        drawingContext->setStrokeColor(Color(0xCC, 0xAA, 0x00, 0xFF), ColorSpaceDeviceRGB);
+        drawingContext->setFillColor(Color(0xFF, 0xDD, 0x00, 0xFF), ColorSpaceDeviceRGB);
 
         IntRect thumbArea = trackRect(scrollbar, false);
         if (!canDrawDirectly) {
@@ -453,7 +453,7 @@ bool ScrollbarThemeChromiumMac::paint(Scrollbar* scrollbar, GraphicsContext* con
     }
 
     if (!canDrawDirectly)
-        context->drawImageBuffer(imageBuffer.get(), DeviceColorSpace, scrollbar->frameRect().location());
+        context->drawImageBuffer(imageBuffer.get(), ColorSpaceDeviceRGB, scrollbar->frameRect().location());
 
     return true;
 }
diff --git a/WebCore/platform/graphics/ColorSpace.h b/WebCore/platform/graphics/ColorSpace.h
index 1bad58c..7622c47 100644
--- a/WebCore/platform/graphics/ColorSpace.h
+++ b/WebCore/platform/graphics/ColorSpace.h
@@ -28,7 +28,11 @@
 
 namespace WebCore {
 
-    enum ColorSpace { DeviceColorSpace, sRGBColorSpace };
+enum ColorSpace {
+    ColorSpaceDeviceRGB,
+    ColorSpaceSRGB,
+    ColorSpaceLinearRGB
+};
     
 } // namespace WebCore
 
diff --git a/WebCore/platform/graphics/GraphicsContext.cpp b/WebCore/platform/graphics/GraphicsContext.cpp
index 859f38a..b2ed8b5 100644
--- a/WebCore/platform/graphics/GraphicsContext.cpp
+++ b/WebCore/platform/graphics/GraphicsContext.cpp
@@ -219,7 +219,7 @@ void GraphicsContext::setStrokePattern(PassRefPtr<Pattern> pattern)
 {
     ASSERT(pattern);
     if (!pattern) {
-        setStrokeColor(Color::black, DeviceColorSpace);
+        setStrokeColor(Color::black, ColorSpaceDeviceRGB);
         return;
     }
     m_common->state.strokeGradient.clear();
@@ -231,7 +231,7 @@ void GraphicsContext::setFillPattern(PassRefPtr<Pattern> pattern)
 {
     ASSERT(pattern);
     if (!pattern) {
-        setFillColor(Color::black, DeviceColorSpace);
+        setFillColor(Color::black, ColorSpaceDeviceRGB);
         return;
     }
     m_common->state.fillGradient.clear();
@@ -243,7 +243,7 @@ void GraphicsContext::setStrokeGradient(PassRefPtr<Gradient> gradient)
 {
     ASSERT(gradient);
     if (!gradient) {
-        setStrokeColor(Color::black, DeviceColorSpace);
+        setStrokeColor(Color::black, ColorSpaceDeviceRGB);
         return;
     }
     m_common->state.strokeGradient = gradient;
@@ -255,7 +255,7 @@ void GraphicsContext::setFillGradient(PassRefPtr<Gradient> gradient)
 {
     ASSERT(gradient);
     if (!gradient) {
-        setFillColor(Color::black, DeviceColorSpace);
+        setFillColor(Color::black, ColorSpaceDeviceRGB);
         return;
     }
     m_common->state.fillGradient = gradient;
diff --git a/WebCore/platform/graphics/GraphicsContextPrivate.h b/WebCore/platform/graphics/GraphicsContextPrivate.h
index 903c7e3..985cad9 100644
--- a/WebCore/platform/graphics/GraphicsContextPrivate.h
+++ b/WebCore/platform/graphics/GraphicsContextPrivate.h
@@ -39,10 +39,10 @@ namespace WebCore {
             , strokeStyle(SolidStroke)
             , strokeThickness(0)
             , strokeColor(Color::black)
-            , strokeColorSpace(DeviceColorSpace)
+            , strokeColorSpace(ColorSpaceDeviceRGB)
             , fillRule(RULE_NONZERO)
             , fillColor(Color::black)
-            , fillColorSpace(DeviceColorSpace)
+            , fillColorSpace(ColorSpaceDeviceRGB)
             , shouldAntialias(true)
             , paintingDisabled(false)
             , shadowBlur(0)
diff --git a/WebCore/platform/graphics/ImageBuffer.cpp b/WebCore/platform/graphics/ImageBuffer.cpp
index 71b8189..4a76be4 100644
--- a/WebCore/platform/graphics/ImageBuffer.cpp
+++ b/WebCore/platform/graphics/ImageBuffer.cpp
@@ -32,17 +32,17 @@
 
 namespace WebCore {
 
-void ImageBuffer::transformColorSpace(ImageColorSpace srcColorSpace, ImageColorSpace dstColorSpace)
+void ImageBuffer::transformColorSpace(ColorSpace srcColorSpace, ColorSpace dstColorSpace)
 {
     if (srcColorSpace == dstColorSpace)
         return;
 
     // only sRGB <-> linearRGB are supported at the moment
-    if ((srcColorSpace != LinearRGB && srcColorSpace != DeviceRGB) || 
-        (dstColorSpace != LinearRGB && dstColorSpace != DeviceRGB))
+    if ((srcColorSpace != ColorSpaceLinearRGB && srcColorSpace != ColorSpaceDeviceRGB) 
+        || (dstColorSpace != ColorSpaceLinearRGB && dstColorSpace != ColorSpaceDeviceRGB))
         return;
 
-    if (dstColorSpace == LinearRGB) {
+    if (dstColorSpace == ColorSpaceLinearRGB) {
         if (m_linearRgbLUT.isEmpty()) {
             for (unsigned i = 0; i < 256; i++) {
                 float color = i  / 255.0f;
@@ -53,7 +53,7 @@ void ImageBuffer::transformColorSpace(ImageColorSpace srcColorSpace, ImageColorS
             }
         }
         platformTransformColorSpace(m_linearRgbLUT);
-    } else if (dstColorSpace == DeviceRGB) {
+    } else if (dstColorSpace == ColorSpaceDeviceRGB) {
         if (m_deviceRgbLUT.isEmpty()) {
             for (unsigned i = 0; i < 256; i++) {
                 float color = i / 255.0f;
diff --git a/WebCore/platform/graphics/ImageBuffer.h b/WebCore/platform/graphics/ImageBuffer.h
index 3c0508e..822a0ff 100644
--- a/WebCore/platform/graphics/ImageBuffer.h
+++ b/WebCore/platform/graphics/ImageBuffer.h
@@ -29,6 +29,7 @@
 #define ImageBuffer_h
 
 #include "AffineTransform.h"
+#include "ColorSpace.h"
 #include "FloatRect.h"
 #include "Image.h"
 #include "IntSize.h"
@@ -44,13 +45,6 @@ namespace WebCore {
     class ImageData;
     class IntPoint;
     class IntRect;
-    
-    enum ImageColorSpace {
-        Unknown,
-        DeviceRGB, // like sRGB
-        GrayScale,
-        LinearRGB
-    };
 
     enum Multiply {
         Premultiplied,
@@ -60,7 +54,7 @@ namespace WebCore {
     class ImageBuffer : public Noncopyable {
     public:
         // Will return a null pointer on allocation failure.
-        static PassOwnPtr<ImageBuffer> create(const IntSize& size, ImageColorSpace colorSpace = DeviceRGB)
+        static PassOwnPtr<ImageBuffer> create(const IntSize& size, ColorSpace colorSpace = ColorSpaceDeviceRGB)
         {
             bool success = false;
             OwnPtr<ImageBuffer> buf(new ImageBuffer(size, colorSpace, success));
@@ -89,7 +83,7 @@ namespace WebCore {
         String toDataURL(const String& mimeType, const double* quality = 0) const;
 #if !PLATFORM(CG)
         AffineTransform baseTransform() const { return AffineTransform(); }
-        void transformColorSpace(ImageColorSpace srcColorSpace, ImageColorSpace dstColorSpace);
+        void transformColorSpace(ColorSpace srcColorSpace, ColorSpace dstColorSpace);
         void platformTransformColorSpace(const Vector<int>&);
 #else
         AffineTransform baseTransform() const { return AffineTransform(1, 0, 0, -1, 0, m_size.height()); }
@@ -119,7 +113,7 @@ namespace WebCore {
 
         // This constructor will place its success into the given out-variable
         // so that create() knows when it should return failure.
-        ImageBuffer(const IntSize&, ImageColorSpace colorSpace, bool& success);
+        ImageBuffer(const IntSize&, ColorSpace colorSpace, bool& success);
     };
 
 } // namespace WebCore
diff --git a/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp b/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp
index 976dcb4..d452c3a 100644
--- a/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp
+++ b/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp
@@ -69,7 +69,7 @@ ImageBufferData::ImageBufferData(const IntSize& size)
 {
 }
 
-ImageBuffer::ImageBuffer(const IntSize& size, ImageColorSpace imageColorSpace, bool& success)
+ImageBuffer::ImageBuffer(const IntSize& size, ColorSpace, bool& success)
     : m_data(size)
     , m_size(size)
 {
diff --git a/WebCore/platform/graphics/cg/ColorCG.cpp b/WebCore/platform/graphics/cg/ColorCG.cpp
index 9c8bac6..c9b05da 100644
--- a/WebCore/platform/graphics/cg/ColorCG.cpp
+++ b/WebCore/platform/graphics/cg/ColorCG.cpp
@@ -73,10 +73,12 @@ Color::Color(CGColorRef color)
 static inline CGColorSpaceRef cachedCGColorSpace(ColorSpace colorSpace)
 {
     switch (colorSpace) {
-    case DeviceColorSpace:
+    case ColorSpaceDeviceRGB:
         return deviceRGBColorSpaceRef();
-    case sRGBColorSpace:
+    case ColorSpaceSRGB:
         return sRGBColorSpaceRef();
+    case ColorSpaceLinearRGB:
+        return linearRGBColorSpaceRef();
     }
     ASSERT_NOT_REACHED();
     return deviceRGBColorSpaceRef();
@@ -131,13 +133,15 @@ template<ColorSpace colorSpace> static CGColorRef cachedCGColor(const Color& col
 CGColorRef cachedCGColor(const Color& color, ColorSpace colorSpace)
 {
     switch (colorSpace) {
-    case DeviceColorSpace:
-        return cachedCGColor<DeviceColorSpace>(color);
-    case sRGBColorSpace:
-        return cachedCGColor<sRGBColorSpace>(color);
+    case ColorSpaceDeviceRGB:
+        return cachedCGColor<ColorSpaceDeviceRGB>(color);
+    case ColorSpaceSRGB:
+        return cachedCGColor<ColorSpaceSRGB>(color);
+    case ColorSpaceLinearRGB:
+        return cachedCGColor<ColorSpaceLinearRGB>(color);
     }
     ASSERT_NOT_REACHED();
-    return cachedCGColor(color, DeviceColorSpace);
+    return cachedCGColor(color, ColorSpaceDeviceRGB);
 }
 
 }
diff --git a/WebCore/platform/graphics/cg/GraphicsContextCG.cpp b/WebCore/platform/graphics/cg/GraphicsContextCG.cpp
index a7aa764..9e0a2f5 100644
--- a/WebCore/platform/graphics/cg/GraphicsContextCG.cpp
+++ b/WebCore/platform/graphics/cg/GraphicsContextCG.cpp
@@ -96,6 +96,17 @@ CGColorSpaceRef sRGBColorSpaceRef()
 #endif
 }
 
+CGColorSpaceRef linearRGBColorSpaceRef()
+{
+    // FIXME: Windows should be able to use kCGColorSpaceGenericRGBLinear, this is tracked by http://webkit.org/b/31363.
+#if PLATFORM(WIN) || defined(BUILDING_ON_TIGER)
+    return deviceRGBColorSpaceRef();
+#else
+    static CGColorSpaceRef linearRGBSpace = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGBLinear);
+    return linearRGBSpace;
+#endif
+}
+
 GraphicsContext::GraphicsContext(CGContextRef cgContext)
     : m_common(createGraphicsContextPrivate())
     , m_data(new GraphicsContextPlatformPrivate(cgContext))
diff --git a/WebCore/platform/graphics/cg/GraphicsContextCG.h b/WebCore/platform/graphics/cg/GraphicsContextCG.h
index b36cbf3..5de95ef 100644
--- a/WebCore/platform/graphics/cg/GraphicsContextCG.h
+++ b/WebCore/platform/graphics/cg/GraphicsContextCG.h
@@ -34,6 +34,7 @@ namespace WebCore {
 
 CGColorSpaceRef deviceRGBColorSpaceRef();
 CGColorSpaceRef sRGBColorSpaceRef();
+CGColorSpaceRef linearRGBColorSpaceRef();
 
 }
 
diff --git a/WebCore/platform/graphics/cg/ImageBufferCG.cpp b/WebCore/platform/graphics/cg/ImageBufferCG.cpp
index ab66cbb..640692a 100644
--- a/WebCore/platform/graphics/cg/ImageBufferCG.cpp
+++ b/WebCore/platform/graphics/cg/ImageBufferCG.cpp
@@ -31,6 +31,7 @@
 #include "Base64.h"
 #include "BitmapImage.h"
 #include "GraphicsContext.h"
+#include "GraphicsContextCG.h"
 #include "ImageData.h"
 #include "MIMETypeRegistry.h"
 #include <ApplicationServices/ApplicationServices.h>
@@ -55,7 +56,7 @@ ImageBufferData::ImageBufferData(const IntSize&)
 {
 }
 
-ImageBuffer::ImageBuffer(const IntSize& size, ImageColorSpace imageColorSpace, bool& success)
+ImageBuffer::ImageBuffer(const IntSize& size, ColorSpace imageColorSpace, bool& success)
     : m_data(size)
     , m_size(size)
 {
@@ -64,12 +65,11 @@ ImageBuffer::ImageBuffer(const IntSize& size, ImageColorSpace imageColorSpace, b
         return;
 
     unsigned bytesPerRow = size.width();
-    if (imageColorSpace != GrayScale) {
-        // Protect against overflow
-        if (bytesPerRow > 0x3FFFFFFF)
-            return;
-        bytesPerRow *= 4;
-    }
+
+    // Protect against overflow
+    if (bytesPerRow > 0x3FFFFFFF)
+        return;
+    bytesPerRow *= 4;
     m_data.m_bytesPerRow = bytesPerRow;
 
     size_t dataSize = size.height() * bytesPerRow;
@@ -79,27 +79,20 @@ ImageBuffer::ImageBuffer(const IntSize& size, ImageColorSpace imageColorSpace, b
     ASSERT((reinterpret_cast<size_t>(m_data.m_data) & 2) == 0);
 
     switch(imageColorSpace) {
-        case DeviceRGB:
-            m_data.m_colorSpace.adoptCF(CGColorSpaceCreateDeviceRGB());
-            break;
-        case GrayScale:
-            m_data.m_colorSpace.adoptCF(CGColorSpaceCreateDeviceGray());
-            break;
-#if ((PLATFORM(MAC) || PLATFORM(CHROMIUM)) && !defined(BUILDING_ON_TIGER))
-        case LinearRGB:
-            m_data.m_colorSpace.adoptCF(CGColorSpaceCreateWithName(kCGColorSpaceGenericRGBLinear));
-            break;
-            
-#endif
-        default:
-            m_data.m_colorSpace.adoptCF(CGColorSpaceCreateDeviceRGB());
-            break;
+    case ColorSpaceDeviceRGB:
+        m_data.m_colorSpace = deviceRGBColorSpaceRef();
+        break;
+    case ColorSpaceSRGB:
+        m_data.m_colorSpace = sRGBColorSpaceRef();
+        break;
+    case ColorSpaceLinearRGB:
+        m_data.m_colorSpace = linearRGBColorSpaceRef();
+        break;
     }
 
-    m_data.m_grayScale = imageColorSpace == GrayScale;
-    m_data.m_bitmapInfo = m_data.m_grayScale ? kCGImageAlphaNone : kCGImageAlphaPremultipliedLast;
+    m_data.m_bitmapInfo = kCGImageAlphaPremultipliedLast;
     RetainPtr<CGContextRef> cgContext(AdoptCF, CGBitmapContextCreate(m_data.m_data, size.width(), size.height(), 8, bytesPerRow,
-                                                                     m_data.m_colorSpace.get(), m_data.m_bitmapInfo));
+                                                                     m_data.m_colorSpace, m_data.m_bitmapInfo));
     if (!cgContext)
         return;
 
@@ -134,8 +127,8 @@ PassRefPtr<Image> ImageBuffer::copyImage() const
 
 static CGImageRef cgImage(const IntSize& size, const ImageBufferData& data)
 {
-    return CGImageCreate(size.width(), size.height(), 8, data.m_grayScale ? 8 : 32, data.m_bytesPerRow,
-                         data.m_colorSpace.get(), data.m_bitmapInfo, data.m_dataProvider.get(), 0, true, kCGRenderingIntentDefault);
+    return CGImageCreate(size.width(), size.height(), 8, 32, data.m_bytesPerRow,
+                         data.m_colorSpace, data.m_bitmapInfo, data.m_dataProvider.get(), 0, true, kCGRenderingIntentDefault);
 }
 
 void ImageBuffer::draw(GraphicsContext* destContext, ColorSpace styleColorSpace, const FloatRect& destRect, const FloatRect& srcRect,
@@ -144,7 +137,7 @@ void ImageBuffer::draw(GraphicsContext* destContext, ColorSpace styleColorSpace,
     if (destContext == context()) {
         // We're drawing into our own buffer.  In order for this to work, we need to copy the source buffer first.
         RefPtr<Image> copy = copyImage();
-        destContext->drawImage(copy.get(), DeviceColorSpace, destRect, srcRect, op, useLowQualityScale);
+        destContext->drawImage(copy.get(), ColorSpaceDeviceRGB, destRect, srcRect, op, useLowQualityScale);
     } else {
         RefPtr<Image> imageForRendering = BitmapImage::create(cgImage(m_size, m_data));
         destContext->drawImage(imageForRendering.get(), styleColorSpace, destRect, srcRect, op, useLowQualityScale);
diff --git a/WebCore/platform/graphics/cg/ImageBufferData.h b/WebCore/platform/graphics/cg/ImageBufferData.h
index 2f9d854..456c934 100644
--- a/WebCore/platform/graphics/cg/ImageBufferData.h
+++ b/WebCore/platform/graphics/cg/ImageBufferData.h
@@ -46,9 +46,8 @@ public:
     
     RetainPtr<CGDataProviderRef> m_dataProvider;
     CGBitmapInfo m_bitmapInfo;
-    bool m_grayScale;
     unsigned m_bytesPerRow;
-    RetainPtr<CGColorSpaceRef> m_colorSpace;
+    CGColorSpaceRef m_colorSpace;
 };
 
 }  // namespace WebCore
diff --git a/WebCore/platform/graphics/cg/ImageCG.cpp b/WebCore/platform/graphics/cg/ImageCG.cpp
index 87a1807..c7ed0c8 100644
--- a/WebCore/platform/graphics/cg/ImageCG.cpp
+++ b/WebCore/platform/graphics/cg/ImageCG.cpp
@@ -138,10 +138,12 @@ static RetainPtr<CGImageRef> imageWithColorSpace(CGImageRef originalImage, Color
         return originalImage;
 
     switch (colorSpace) {
-    case DeviceColorSpace:
+    case ColorSpaceDeviceRGB:
         return originalImage;
-    case sRGBColorSpace:
+    case ColorSpaceSRGB:
         return RetainPtr<CGImageRef>(AdoptCF, CGImageCreateCopyWithColorSpace(originalImage, sRGBColorSpaceRef()));
+    case ColorSpaceLinearRGB:
+        return RetainPtr<CGImageRef>(AdoptCF, CGImageCreateCopyWithColorSpace(originalImage, linearRGBColorSpaceRef()));
     }
 
     ASSERT_NOT_REACHED();
diff --git a/WebCore/platform/graphics/chromium/GLES2Canvas.cpp b/WebCore/platform/graphics/chromium/GLES2Canvas.cpp
index 46aecf4..697cf5e 100644
--- a/WebCore/platform/graphics/chromium/GLES2Canvas.cpp
+++ b/WebCore/platform/graphics/chromium/GLES2Canvas.cpp
@@ -97,7 +97,7 @@ void GLES2Canvas::clearRect(const FloatRect& rect)
     } else {
         save();
         setCompositeOperation(CompositeClear);
-        fillRect(rect, Color(RGBA32(0)), DeviceColorSpace);
+        fillRect(rect, Color(RGBA32(0)), ColorSpaceDeviceRGB);
         restore();
     }
 }
@@ -120,7 +120,7 @@ void GLES2Canvas::fillRect(const FloatRect& rect, const Color& color, ColorSpace
 
 void GLES2Canvas::fillRect(const FloatRect& rect)
 {
-    fillRect(rect, m_state->m_fillColor, DeviceColorSpace);
+    fillRect(rect, m_state->m_fillColor, ColorSpaceDeviceRGB);
 }
 
 void GLES2Canvas::setFillColor(const Color& color, ColorSpace colorSpace)
diff --git a/WebCore/platform/graphics/chromium/TransparencyWin.cpp b/WebCore/platform/graphics/chromium/TransparencyWin.cpp
index 47cc894..4dc2157 100644
--- a/WebCore/platform/graphics/chromium/TransparencyWin.cpp
+++ b/WebCore/platform/graphics/chromium/TransparencyWin.cpp
@@ -275,7 +275,7 @@ void TransparencyWin::setupLayerForWhiteLayer()
     if (!m_validLayer)
         return;
 
-    m_drawContext->fillRect(IntRect(IntPoint(0, 0), m_layerSize), Color::white, DeviceColorSpace);
+    m_drawContext->fillRect(IntRect(IntPoint(0, 0), m_layerSize), Color::white, ColorSpaceDeviceRGB);
     // Layer rect represents the part of the original layer.
 }
 
diff --git a/WebCore/platform/graphics/filters/FEColorMatrix.cpp b/WebCore/platform/graphics/filters/FEColorMatrix.cpp
index 06e2c49..b41d5ad 100644
--- a/WebCore/platform/graphics/filters/FEColorMatrix.cpp
+++ b/WebCore/platform/graphics/filters/FEColorMatrix.cpp
@@ -164,7 +164,7 @@ void FEColorMatrix::apply(Filter* filter)
     if (!filterContext)
         return;
 
-    filterContext->drawImageBuffer(in->resultImage(), DeviceColorSpace, drawingRegionOfInputImage(in->absolutePaintRect()));
+    filterContext->drawImageBuffer(in->resultImage(), ColorSpaceDeviceRGB, drawingRegionOfInputImage(in->absolutePaintRect()));
 
     IntRect imageRect(IntPoint(), resultImage()->size());
     PassRefPtr<ImageData> imageData(resultImage()->getUnmultipliedImageData(imageRect));
diff --git a/WebCore/platform/graphics/filters/FEComposite.cpp b/WebCore/platform/graphics/filters/FEComposite.cpp
index 70a212e..2326966 100644
--- a/WebCore/platform/graphics/filters/FEComposite.cpp
+++ b/WebCore/platform/graphics/filters/FEComposite.cpp
@@ -151,26 +151,26 @@ void FEComposite::apply(Filter* filter)
     FloatRect srcRect = FloatRect(0, 0, -1, -1);
     switch (m_type) {
     case FECOMPOSITE_OPERATOR_OVER:
-        filterContext->drawImageBuffer(in2->resultImage(), DeviceColorSpace, drawingRegionOfInputImage(in2->absolutePaintRect()));
-        filterContext->drawImageBuffer(in->resultImage(), DeviceColorSpace, drawingRegionOfInputImage(in->absolutePaintRect()));
+        filterContext->drawImageBuffer(in2->resultImage(), ColorSpaceDeviceRGB, drawingRegionOfInputImage(in2->absolutePaintRect()));
+        filterContext->drawImageBuffer(in->resultImage(), ColorSpaceDeviceRGB, drawingRegionOfInputImage(in->absolutePaintRect()));
         break;
     case FECOMPOSITE_OPERATOR_IN:
         filterContext->save();
         filterContext->clipToImageBuffer(in2->resultImage(), drawingRegionOfInputImage(in2->absolutePaintRect()));
-        filterContext->drawImageBuffer(in->resultImage(), DeviceColorSpace, drawingRegionOfInputImage(in->absolutePaintRect()));
+        filterContext->drawImageBuffer(in->resultImage(), ColorSpaceDeviceRGB, drawingRegionOfInputImage(in->absolutePaintRect()));
         filterContext->restore();
         break;
     case FECOMPOSITE_OPERATOR_OUT:
-        filterContext->drawImageBuffer(in->resultImage(), DeviceColorSpace, drawingRegionOfInputImage(in->absolutePaintRect()));
-        filterContext->drawImageBuffer(in2->resultImage(), DeviceColorSpace, drawingRegionOfInputImage(in2->absolutePaintRect()), srcRect, CompositeDestinationOut);
+        filterContext->drawImageBuffer(in->resultImage(), ColorSpaceDeviceRGB, drawingRegionOfInputImage(in->absolutePaintRect()));
+        filterContext->drawImageBuffer(in2->resultImage(), ColorSpaceDeviceRGB, drawingRegionOfInputImage(in2->absolutePaintRect()), srcRect, CompositeDestinationOut);
         break;
     case FECOMPOSITE_OPERATOR_ATOP:
-        filterContext->drawImageBuffer(in2->resultImage(), DeviceColorSpace, drawingRegionOfInputImage(in2->absolutePaintRect()));
-        filterContext->drawImageBuffer(in->resultImage(), DeviceColorSpace, drawingRegionOfInputImage(in->absolutePaintRect()), srcRect, CompositeSourceAtop);
+        filterContext->drawImageBuffer(in2->resultImage(), ColorSpaceDeviceRGB, drawingRegionOfInputImage(in2->absolutePaintRect()));
+        filterContext->drawImageBuffer(in->resultImage(), ColorSpaceDeviceRGB, drawingRegionOfInputImage(in->absolutePaintRect()), srcRect, CompositeSourceAtop);
         break;
     case FECOMPOSITE_OPERATOR_XOR:
-        filterContext->drawImageBuffer(in2->resultImage(), DeviceColorSpace, drawingRegionOfInputImage(in2->absolutePaintRect()));
-        filterContext->drawImageBuffer(in->resultImage(), DeviceColorSpace, drawingRegionOfInputImage(in->absolutePaintRect()), srcRect, CompositeXOR);
+        filterContext->drawImageBuffer(in2->resultImage(), ColorSpaceDeviceRGB, drawingRegionOfInputImage(in2->absolutePaintRect()));
+        filterContext->drawImageBuffer(in->resultImage(), ColorSpaceDeviceRGB, drawingRegionOfInputImage(in->absolutePaintRect()), srcRect, CompositeXOR);
         break;
     case FECOMPOSITE_OPERATOR_ARITHMETIC: {
         IntRect effectADrawingRect = requestedRegionOfInputImageData(in->absolutePaintRect());
diff --git a/WebCore/platform/graphics/filters/FEFlood.cpp b/WebCore/platform/graphics/filters/FEFlood.cpp
index 4b56a5c..b51a422 100644
--- a/WebCore/platform/graphics/filters/FEFlood.cpp
+++ b/WebCore/platform/graphics/filters/FEFlood.cpp
@@ -69,7 +69,7 @@ void FEFlood::apply(Filter* filter)
         return;
 
     Color color = colorWithOverrideAlpha(floodColor().rgb(), floodOpacity());
-    filterContext->fillRect(FloatRect(FloatPoint(), absolutePaintRect().size()), color, DeviceColorSpace);
+    filterContext->fillRect(FloatRect(FloatPoint(), absolutePaintRect().size()), color, ColorSpaceDeviceRGB);
 }
 
 void FEFlood::dump()
diff --git a/WebCore/platform/graphics/filters/FEMerge.cpp b/WebCore/platform/graphics/filters/FEMerge.cpp
index d9332de..b136af3 100644
--- a/WebCore/platform/graphics/filters/FEMerge.cpp
+++ b/WebCore/platform/graphics/filters/FEMerge.cpp
@@ -56,7 +56,7 @@ void FEMerge::apply(Filter* filter)
 
     for (unsigned i = 0; i < size; ++i) {
         FilterEffect* in = inputEffect(i);
-        filterContext->drawImageBuffer(in->resultImage(), DeviceColorSpace, drawingRegionOfInputImage(in->absolutePaintRect()));
+        filterContext->drawImageBuffer(in->resultImage(), ColorSpaceDeviceRGB, drawingRegionOfInputImage(in->absolutePaintRect()));
     }
 }
 
diff --git a/WebCore/platform/graphics/filters/FEOffset.cpp b/WebCore/platform/graphics/filters/FEOffset.cpp
index 1014364..6ca56aa 100644
--- a/WebCore/platform/graphics/filters/FEOffset.cpp
+++ b/WebCore/platform/graphics/filters/FEOffset.cpp
@@ -86,7 +86,7 @@ void FEOffset::apply(Filter* filter)
 
     FloatRect drawingRegion = drawingRegionOfInputImage(in->absolutePaintRect());
     drawingRegion.move(filter->applyHorizontalScale(m_dx), filter->applyVerticalScale(m_dy));
-    filterContext->drawImageBuffer(in->resultImage(), DeviceColorSpace, drawingRegion);
+    filterContext->drawImageBuffer(in->resultImage(), ColorSpaceDeviceRGB, drawingRegion);
 }
 
 void FEOffset::dump()
diff --git a/WebCore/platform/graphics/filters/FETile.cpp b/WebCore/platform/graphics/filters/FETile.cpp
index 598fe9e..a695d3b 100644
--- a/WebCore/platform/graphics/filters/FETile.cpp
+++ b/WebCore/platform/graphics/filters/FETile.cpp
@@ -75,12 +75,12 @@ void FETile::apply(Filter* filter)
     }
 
     OwnPtr<ImageBuffer> tileImage;
-    if (!SVGImageBufferTools::createImageBuffer(tileRect, tileRect, tileImage, DeviceRGB))
+    if (!SVGImageBufferTools::createImageBuffer(tileRect, tileRect, tileImage, ColorSpaceDeviceRGB))
         return;
 
     GraphicsContext* tileImageContext = tileImage->context();
     tileImageContext->translate(-inMaxEffectLocation.x(), -inMaxEffectLocation.y());
-    tileImageContext->drawImageBuffer(in->resultImage(), DeviceColorSpace, in->absolutePaintRect().location());
+    tileImageContext->drawImageBuffer(in->resultImage(), ColorSpaceDeviceRGB, in->absolutePaintRect().location());
 
     RefPtr<Pattern> pattern = Pattern::create(tileImage->copyImage(), true, true);
 
diff --git a/WebCore/platform/graphics/filters/FilterEffect.cpp b/WebCore/platform/graphics/filters/FilterEffect.cpp
index b6c7e18..121b921 100644
--- a/WebCore/platform/graphics/filters/FilterEffect.cpp
+++ b/WebCore/platform/graphics/filters/FilterEffect.cpp
@@ -92,7 +92,7 @@ GraphicsContext* FilterEffect::effectContext(Filter* filter)
     determineAbsolutePaintRect(filter);
     if (m_absolutePaintRect.isEmpty())
         return 0;
-    m_effectBuffer = ImageBuffer::create(m_absolutePaintRect.size(), LinearRGB);
+    m_effectBuffer = ImageBuffer::create(m_absolutePaintRect.size(), ColorSpaceLinearRGB);
     if (!m_effectBuffer)
         return 0;
     return m_effectBuffer->context();
diff --git a/WebCore/platform/graphics/filters/SourceAlpha.cpp b/WebCore/platform/graphics/filters/SourceAlpha.cpp
index 15caf5a..7dc56d9 100644
--- a/WebCore/platform/graphics/filters/SourceAlpha.cpp
+++ b/WebCore/platform/graphics/filters/SourceAlpha.cpp
@@ -60,7 +60,7 @@ void SourceAlpha::apply(Filter* filter)
     FloatRect imageRect(FloatPoint(), absolutePaintRect().size());
     filterContext->save();
     filterContext->clipToImageBuffer(filter->sourceImage(), imageRect);
-    filterContext->fillRect(imageRect, Color::black, DeviceColorSpace);
+    filterContext->fillRect(imageRect, Color::black, ColorSpaceDeviceRGB);
     filterContext->restore();
 }
 
diff --git a/WebCore/platform/graphics/filters/SourceGraphic.cpp b/WebCore/platform/graphics/filters/SourceGraphic.cpp
index 5e5dc34..fbb711a 100644
--- a/WebCore/platform/graphics/filters/SourceGraphic.cpp
+++ b/WebCore/platform/graphics/filters/SourceGraphic.cpp
@@ -54,7 +54,7 @@ void SourceGraphic::apply(Filter* filter)
     if (!filterContext || !filter->sourceImage())
         return;
 
-    filterContext->drawImageBuffer(filter->sourceImage(), DeviceColorSpace, IntPoint());
+    filterContext->drawImageBuffer(filter->sourceImage(), ColorSpaceDeviceRGB, IntPoint());
 }
 
 void SourceGraphic::dump()
diff --git a/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp b/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
index da9255b..7012c9f 100644
--- a/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
+++ b/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
@@ -1212,7 +1212,7 @@ void MediaPlayerPrivateGStreamer::paint(GraphicsContext* context, const IntRect&
     if (!gstImage)
         return;
 
-    context->drawImage(reinterpret_cast<Image*>(gstImage->image().get()), sRGBColorSpace,
+    context->drawImage(reinterpret_cast<Image*>(gstImage->image().get()), ColorSpaceSRGB,
                        rect, CompositeCopy, false);
 }
 
diff --git a/WebCore/platform/graphics/gtk/FontGtk.cpp b/WebCore/platform/graphics/gtk/FontGtk.cpp
index fd0e062..328ec4a 100644
--- a/WebCore/platform/graphics/gtk/FontGtk.cpp
+++ b/WebCore/platform/graphics/gtk/FontGtk.cpp
@@ -270,7 +270,7 @@ void Font::drawComplexText(GraphicsContext* context, const TextRun& run, const F
 
     // Re-enable the platform shadow we disabled earlier
     if (hasShadow)
-        context->setShadow(shadowOffset, shadowBlur, shadowColor, DeviceColorSpace);
+        context->setShadow(shadowOffset, shadowBlur, shadowColor, ColorSpaceDeviceRGB);
 
     // Pango sometimes leaves behind paths we don't want
     cairo_new_path(cr);
diff --git a/WebCore/platform/graphics/mac/GraphicsContextMac.mm b/WebCore/platform/graphics/mac/GraphicsContextMac.mm
index dd765bf..aa754f2 100644
--- a/WebCore/platform/graphics/mac/GraphicsContextMac.mm
+++ b/WebCore/platform/graphics/mac/GraphicsContextMac.mm
@@ -64,7 +64,7 @@ void GraphicsContext::drawFocusRing(const Vector<Path>& paths, int width, int of
     
     int radius = (width - 1) / 2;
     offset += radius;
-    CGColorRef colorRef = color.isValid() ? cachedCGColor(color, DeviceColorSpace) : 0;
+    CGColorRef colorRef = color.isValid() ? cachedCGColor(color, ColorSpaceDeviceRGB) : 0;
 
     RetainPtr<CGMutablePathRef> focusRingPath(AdoptCF, CGPathCreateMutable());
     unsigned pathCount = paths.size();
@@ -81,7 +81,7 @@ void GraphicsContext::drawFocusRing(const Vector<IntRect>& rects, int width, int
 
     int radius = (width - 1) / 2;
     offset += radius;
-    CGColorRef colorRef = color.isValid() ? cachedCGColor(color, DeviceColorSpace) : 0;
+    CGColorRef colorRef = color.isValid() ? cachedCGColor(color, ColorSpaceDeviceRGB) : 0;
 
     RetainPtr<CGMutablePathRef> focusRingPath(AdoptCF, CGPathCreateMutable());
     unsigned rectCount = rects.size();
diff --git a/WebCore/platform/graphics/mac/GraphicsLayerCA.mm b/WebCore/platform/graphics/mac/GraphicsLayerCA.mm
index fea2968..c4128ef 100644
--- a/WebCore/platform/graphics/mac/GraphicsLayerCA.mm
+++ b/WebCore/platform/graphics/mac/GraphicsLayerCA.mm
@@ -265,7 +265,7 @@ static CAMediaTimingFunction* getCAMediaTimingFunction(const TimingFunction* tim
 
 static void setLayerBorderColor(PlatformLayer* layer, const Color& color)
 {
-    [layer setBorderColor:cachedCGColor(color, DeviceColorSpace)];
+    [layer setBorderColor:cachedCGColor(color, ColorSpaceDeviceRGB)];
 }
 
 static void clearBorderColor(PlatformLayer* layer)
@@ -275,7 +275,7 @@ static void clearBorderColor(PlatformLayer* layer)
 
 static void setLayerBackgroundColor(PlatformLayer* layer, const Color& color)
 {
-    [layer setBackgroundColor:cachedCGColor(color, DeviceColorSpace)];
+    [layer setBackgroundColor:cachedCGColor(color, ColorSpaceDeviceRGB)];
 }
 
 static void clearLayerBackgroundColor(PlatformLayer* layer)
diff --git a/WebCore/platform/graphics/qt/GraphicsContextQt.cpp b/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
index a385e4a..8b34f51 100644
--- a/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
+++ b/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
@@ -255,8 +255,8 @@ GraphicsContext::GraphicsContext(PlatformGraphicsContext* context)
     setPaintingDisabled(!context);
     if (context) {
         // Make sure the context starts in sync with our state.
-        setPlatformFillColor(fillColor(), DeviceColorSpace);
-        setPlatformStrokeColor(strokeColor(), DeviceColorSpace);
+        setPlatformFillColor(fillColor(), ColorSpaceDeviceRGB);
+        setPlatformStrokeColor(strokeColor(), ColorSpaceDeviceRGB);
 
         // Make sure we start with the correct join mode.
         setLineJoin(MiterJoin);
diff --git a/WebCore/platform/graphics/qt/ImageBufferQt.cpp b/WebCore/platform/graphics/qt/ImageBufferQt.cpp
index 4ec6966..0cdc894 100644
--- a/WebCore/platform/graphics/qt/ImageBufferQt.cpp
+++ b/WebCore/platform/graphics/qt/ImageBufferQt.cpp
@@ -80,7 +80,7 @@ ImageBufferData::ImageBufferData(const IntSize& size)
     m_image = StillImage::createForRendering(&m_pixmap);
 }
 
-ImageBuffer::ImageBuffer(const IntSize& size, ImageColorSpace, bool& success)
+ImageBuffer::ImageBuffer(const IntSize& size, ColorSpace, bool& success)
     : m_data(size)
     , m_size(size)
 {
@@ -118,7 +118,7 @@ void ImageBuffer::draw(GraphicsContext* destContext, ColorSpace styleColorSpace,
     if (destContext == context()) {
         // We're drawing into our own buffer.  In order for this to work, we need to copy the source buffer first.
         RefPtr<Image> copy = copyImage();
-        destContext->drawImage(copy.get(), DeviceColorSpace, destRect, srcRect, op, useLowQualityScale);
+        destContext->drawImage(copy.get(), ColorSpaceDeviceRGB, destRect, srcRect, op, useLowQualityScale);
     } else
         destContext->drawImage(m_data.m_image.get(), styleColorSpace, destRect, srcRect, op, useLowQualityScale);
 }
diff --git a/WebCore/platform/graphics/skia/ImageBufferSkia.cpp b/WebCore/platform/graphics/skia/ImageBufferSkia.cpp
index be60340..143d667 100644
--- a/WebCore/platform/graphics/skia/ImageBufferSkia.cpp
+++ b/WebCore/platform/graphics/skia/ImageBufferSkia.cpp
@@ -60,7 +60,7 @@ ImageBufferData::ImageBufferData(const IntSize& size)
 {
 }
 
-ImageBuffer::ImageBuffer(const IntSize& size, ImageColorSpace imageColorSpace, bool& success)
+ImageBuffer::ImageBuffer(const IntSize& size, ColorSpace, bool& success)
     : m_data(size)
     , m_size(size)
 {
diff --git a/WebCore/platform/graphics/skia/PlatformContextSkia.cpp b/WebCore/platform/graphics/skia/PlatformContextSkia.cpp
index fee8e7e..3f9e4c1 100644
--- a/WebCore/platform/graphics/skia/PlatformContextSkia.cpp
+++ b/WebCore/platform/graphics/skia/PlatformContextSkia.cpp
@@ -826,7 +826,7 @@ void PlatformContextSkia::uploadSoftwareToHardware(CompositeOperator op) const
 
     m_uploadTexture->updateSubRect(bitmap.getPixels(), m_softwareDirtyRect);
     AffineTransform identity;
-    gpuCanvas()->drawTexturedRect(m_uploadTexture.get(), m_softwareDirtyRect, m_softwareDirtyRect, identity, 1.0, DeviceColorSpace, op);
+    gpuCanvas()->drawTexturedRect(m_uploadTexture.get(), m_softwareDirtyRect, m_softwareDirtyRect, identity, 1.0, ColorSpaceDeviceRGB, op);
     // Clear out the region of the software canvas we just uploaded.
     m_canvas->save();
     m_canvas->resetMatrix();
diff --git a/WebCore/platform/graphics/win/FontCGWin.cpp b/WebCore/platform/graphics/win/FontCGWin.cpp
index c6437f2..2f1fb41 100644
--- a/WebCore/platform/graphics/win/FontCGWin.cpp
+++ b/WebCore/platform/graphics/win/FontCGWin.cpp
@@ -360,14 +360,14 @@ void Font::drawGlyphs(GraphicsContext* graphicsContext, const SimpleFontData* fo
         graphicsContext->clearShadow();
         Color fillColor = graphicsContext->fillColor();
         Color shadowFillColor(shadowColor.red(), shadowColor.green(), shadowColor.blue(), shadowColor.alpha() * fillColor.alpha() / 255);
-        graphicsContext->setFillColor(shadowFillColor, DeviceColorSpace);
+        graphicsContext->setFillColor(shadowFillColor, ColorSpaceDeviceRGB);
         CGContextSetTextPosition(cgContext, point.x() + translation.width() + shadowOffset.width(), point.y() + translation.height() + shadowOffset.height());
         CGContextShowGlyphsWithAdvances(cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs);
         if (font->syntheticBoldOffset()) {
             CGContextSetTextPosition(cgContext, point.x() + translation.width() + shadowOffset.width() + font->syntheticBoldOffset(), point.y() + translation.height() + shadowOffset.height());
             CGContextShowGlyphsWithAdvances(cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs);
         }
-        graphicsContext->setFillColor(fillColor, DeviceColorSpace);
+        graphicsContext->setFillColor(fillColor, ColorSpaceDeviceRGB);
     }
 
     CGContextSetTextPosition(cgContext, point.x() + translation.width(), point.y() + translation.height());
@@ -378,7 +378,7 @@ void Font::drawGlyphs(GraphicsContext* graphicsContext, const SimpleFontData* fo
     }
 
     if (hasSimpleShadow)
-        graphicsContext->setShadow(shadowOffset, shadowBlur, shadowColor, DeviceColorSpace);
+        graphicsContext->setShadow(shadowOffset, shadowBlur, shadowColor, ColorSpaceDeviceRGB);
 
     wkRestoreFontSmoothingStyle(cgContext, oldFontSmoothingStyle);
 }
diff --git a/WebCore/platform/graphics/win/GraphicsContextCGWin.cpp b/WebCore/platform/graphics/win/GraphicsContextCGWin.cpp
index 7d90890..c9288e5 100644
--- a/WebCore/platform/graphics/win/GraphicsContextCGWin.cpp
+++ b/WebCore/platform/graphics/win/GraphicsContextCGWin.cpp
@@ -70,8 +70,8 @@ GraphicsContext::GraphicsContext(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(), DeviceColorSpace);
-        setPlatformStrokeColor(strokeColor(), DeviceColorSpace);
+        setPlatformFillColor(fillColor(), ColorSpaceDeviceRGB);
+        setPlatformStrokeColor(strokeColor(), ColorSpaceDeviceRGB);
     }
 }
 
@@ -138,7 +138,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, DeviceColorSpace) : 0;
+    CGColorRef colorRef = color.isValid() ? cachedCGColor(color, ColorSpaceDeviceRGB) : 0;
 
     CGMutablePathRef focusRingPath = CGPathCreateMutable();
     unsigned rectCount = rects.size();
diff --git a/WebCore/platform/graphics/win/GraphicsLayerCACF.cpp b/WebCore/platform/graphics/win/GraphicsLayerCACF.cpp
index dcec0c8..f7674db 100644
--- a/WebCore/platform/graphics/win/GraphicsLayerCACF.cpp
+++ b/WebCore/platform/graphics/win/GraphicsLayerCACF.cpp
@@ -99,7 +99,7 @@ TransformationMatrix CAToTransform3D(const CATransform3D& fromT3D)
 
 static void setLayerBorderColor(WKCACFLayer* layer, const Color& color)
 {
-    layer->setBorderColor(cachedCGColor(color, DeviceColorSpace));
+    layer->setBorderColor(cachedCGColor(color, ColorSpaceDeviceRGB));
 }
 
 static void clearBorderColor(WKCACFLayer* layer)
@@ -109,7 +109,7 @@ static void clearBorderColor(WKCACFLayer* layer)
 
 static void setLayerBackgroundColor(WKCACFLayer* layer, const Color& color)
 {
-    layer->setBackgroundColor(cachedCGColor(color, DeviceColorSpace));
+    layer->setBackgroundColor(cachedCGColor(color, ColorSpaceDeviceRGB));
 }
 
 static void clearLayerBackgroundColor(WKCACFLayer* layer)
diff --git a/WebCore/platform/graphics/win/ImageCGWin.cpp b/WebCore/platform/graphics/win/ImageCGWin.cpp
index a0fbba7..e65b859 100644
--- a/WebCore/platform/graphics/win/ImageCGWin.cpp
+++ b/WebCore/platform/graphics/win/ImageCGWin.cpp
@@ -78,9 +78,9 @@ bool BitmapImage::getHBITMAPOfSize(HBITMAP bmp, LPSIZE size)
 
     IntSize imageSize = BitmapImage::size();
     if (size)
-        drawFrameMatchingSourceSize(&gc, FloatRect(0.0f, 0.0f, bmpInfo.bmWidth, bmpInfo.bmHeight), IntSize(*size), DeviceColorSpace, CompositeCopy);
+        drawFrameMatchingSourceSize(&gc, FloatRect(0.0f, 0.0f, bmpInfo.bmWidth, bmpInfo.bmHeight), IntSize(*size), ColorSpaceDeviceRGB, CompositeCopy);
     else
-        draw(&gc, FloatRect(0.0f, 0.0f, bmpInfo.bmWidth, bmpInfo.bmHeight), FloatRect(0.0f, 0.0f, imageSize.width(), imageSize.height()), DeviceColorSpace, CompositeCopy);
+        draw(&gc, FloatRect(0.0f, 0.0f, bmpInfo.bmWidth, bmpInfo.bmHeight), FloatRect(0.0f, 0.0f, imageSize.width(), imageSize.height()), ColorSpaceDeviceRGB, CompositeCopy);
 
     // Do cleanup
     CGContextRelease(cgContext);
diff --git a/WebCore/platform/graphics/win/ImageCairoWin.cpp b/WebCore/platform/graphics/win/ImageCairoWin.cpp
index e3c5ea0..70b132e 100644
--- a/WebCore/platform/graphics/win/ImageCairoWin.cpp
+++ b/WebCore/platform/graphics/win/ImageCairoWin.cpp
@@ -82,9 +82,9 @@ bool BitmapImage::getHBITMAPOfSize(HBITMAP bmp, LPSIZE size)
 
     IntSize imageSize = BitmapImage::size();
     if (size)
-        drawFrameMatchingSourceSize(&gc, FloatRect(0.0f, 0.0f, bmpInfo.bmWidth, bmpInfo.bmHeight), IntSize(*size), DeviceColorSpace, CompositeCopy);
+        drawFrameMatchingSourceSize(&gc, FloatRect(0.0f, 0.0f, bmpInfo.bmWidth, bmpInfo.bmHeight), IntSize(*size), ColorSpaceDeviceRGB, CompositeCopy);
     else
-        draw(&gc, FloatRect(0.0f, 0.0f, bmpInfo.bmWidth, bmpInfo.bmHeight), FloatRect(0.0f, 0.0f, imageSize.width(), imageSize.height()), DeviceColorSpace, CompositeCopy);
+        draw(&gc, FloatRect(0.0f, 0.0f, bmpInfo.bmWidth, bmpInfo.bmHeight), FloatRect(0.0f, 0.0f, imageSize.width(), imageSize.height()), ColorSpaceDeviceRGB, CompositeCopy);
 
     // Do cleanup
     cairo_destroy(targetRef);
@@ -100,7 +100,7 @@ void BitmapImage::drawFrameMatchingSourceSize(GraphicsContext* ctxt, const Float
         if (cairo_image_surface_get_height(image) == static_cast<size_t>(srcSize.height()) && cairo_image_surface_get_width(image) == 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()), DeviceColorSpace, compositeOp);
+            draw(ctxt, dstRect, FloatRect(0.0f, 0.0f, srcSize.width(), srcSize.height()), ColorSpaceDeviceRGB, compositeOp);
             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
     IntSize imageSize = BitmapImage::size();
-    draw(ctxt, dstRect, FloatRect(0.0f, 0.0f, imageSize.width(), imageSize.height()), DeviceColorSpace, compositeOp);
+    draw(ctxt, dstRect, FloatRect(0.0f, 0.0f, imageSize.width(), imageSize.height()), ColorSpaceDeviceRGB, compositeOp);
 }
 
 } // namespace WebCore
diff --git a/WebCore/platform/graphics/win/WebLayer.cpp b/WebCore/platform/graphics/win/WebLayer.cpp
index 807a607..ecda294 100644
--- a/WebCore/platform/graphics/win/WebLayer.cpp
+++ b/WebCore/platform/graphics/win/WebLayer.cpp
@@ -129,7 +129,7 @@ void WebLayer::drawInContext(PlatformGraphicsContext* context)
         font.update(0);
 
         GraphicsContext cg(context);
-        cg.setFillColor(Color::black, DeviceColorSpace);
+        cg.setFillColor(Color::black, ColorSpaceDeviceRGB);
         cg.drawText(font, TextRun(text), IntPoint(aBounds.origin.x + 5, aBounds.origin.y + 17));
 
         CGContextRestoreGState(context);        
diff --git a/WebCore/platform/graphics/wince/GraphicsContextWinCE.cpp b/WebCore/platform/graphics/wince/GraphicsContextWinCE.cpp
index e9a59a3..a0c10fc 100644
--- a/WebCore/platform/graphics/wince/GraphicsContextWinCE.cpp
+++ b/WebCore/platform/graphics/wince/GraphicsContextWinCE.cpp
@@ -1081,7 +1081,7 @@ void GraphicsContext::clearRect(const FloatRect& rect)
         return;
     } 
 
-    fillRect(rect, Color(Color::white), DeviceColorSpace);
+    fillRect(rect, Color(Color::white), ColorSpaceDeviceRGB);
 }
 
 void GraphicsContext::strokeRect(const FloatRect& rect, float width)
@@ -1436,7 +1436,7 @@ void GraphicsContext::fillRect(const FloatRect& r, const Gradient* gradient)
     if (numStops == 1) {
         const Gradient::ColorStop& stop = stops.first();
         Color color(stop.red, stop.green, stop.blue, stop.alpha);
-        fillRect(r, color, DeviceColorSpace);
+        fillRect(r, color, ColorSpaceDeviceRGB);
         return;
     } 
     
@@ -1526,7 +1526,7 @@ void GraphicsContext::fillRect(const FloatRect& rect)
     if (m_common->state.fillGradient)
         fillRect(rect, m_common->state.fillGradient.get());
     else
-        fillRect(rect, fillColor(), DeviceColorSpace);
+        fillRect(rect, fillColor(), ColorSpaceDeviceRGB);
 
     restorePlatformState();
 }
diff --git a/WebCore/platform/graphics/wince/ImageWinCE.cpp b/WebCore/platform/graphics/wince/ImageWinCE.cpp
index 61ec954..53b9b68 100644
--- a/WebCore/platform/graphics/wince/ImageWinCE.cpp
+++ b/WebCore/platform/graphics/wince/ImageWinCE.cpp
@@ -82,9 +82,9 @@ bool BitmapImage::getHBITMAPOfSize(HBITMAP bmp, LPSIZE size)
 
         IntSize imageSize = BitmapImage::size();
         if (size)
-            drawFrameMatchingSourceSize(&gc, FloatRect(0, 0, bmpInfo.bmWidth, bmpInfo.bmHeight), IntSize(*size), DeviceColorSpace, CompositeCopy);
+            drawFrameMatchingSourceSize(&gc, FloatRect(0, 0, bmpInfo.bmWidth, bmpInfo.bmHeight), IntSize(*size), ColorSpaceDeviceRGB, CompositeCopy);
         else
-            draw(&gc, FloatRect(0, 0, bmpInfo.bmWidth, bmpInfo.bmHeight), FloatRect(0, 0, imageSize.width(), imageSize.height()), DeviceColorSpace, CompositeCopy);
+            draw(&gc, FloatRect(0, 0, bmpInfo.bmWidth, bmpInfo.bmHeight), FloatRect(0, 0, imageSize.width(), imageSize.height()), ColorSpaceDeviceRGB, CompositeCopy);
     }
 
     SelectObject(hdc.get(), hOldBmp);
diff --git a/WebCore/platform/graphics/wx/GraphicsContextWx.cpp b/WebCore/platform/graphics/wx/GraphicsContextWx.cpp
index a39404a..30daa67 100644
--- a/WebCore/platform/graphics/wx/GraphicsContextWx.cpp
+++ b/WebCore/platform/graphics/wx/GraphicsContextWx.cpp
@@ -120,8 +120,8 @@ GraphicsContext::GraphicsContext(PlatformGraphicsContext* context)
     setPaintingDisabled(!context);
     if (context) {
         // Make sure the context starts in sync with our state.
-        setPlatformFillColor(fillColor(), DeviceColorSpace);
-        setPlatformStrokeColor(strokeColor(), DeviceColorSpace);
+        setPlatformFillColor(fillColor(), ColorSpaceDeviceRGB);
+        setPlatformStrokeColor(strokeColor(), ColorSpaceDeviceRGB);
     }
 #if USE(WXGC)
     m_data->context = (wxGCDC*)context;
diff --git a/WebCore/platform/gtk/RenderThemeGtk.cpp b/WebCore/platform/gtk/RenderThemeGtk.cpp
index b40be5b..b2e3fd2 100644
--- a/WebCore/platform/gtk/RenderThemeGtk.cpp
+++ b/WebCore/platform/gtk/RenderThemeGtk.cpp
@@ -523,7 +523,7 @@ bool RenderThemeGtk::paintSearchFieldResultsDecoration(RenderObject* object, con
 {
     static Image* searchImage = Image::loadPlatformThemeIcon(GTK_STOCK_FIND, rect.width()).releaseRef();
     IntRect centeredRect(centerRectVerticallyInParentInputElement(object, rect));
-    i.context->drawImage(searchImage, DeviceColorSpace, centeredRect);
+    i.context->drawImage(searchImage, ColorSpaceDeviceRGB, centeredRect);
     return false;
 }
 
@@ -543,7 +543,7 @@ bool RenderThemeGtk::paintSearchFieldCancelButton(RenderObject* object, const Pa
     // TODO: Brightening up the image on hover is desirable here, I believe.
     static Image* cancelImage = Image::loadPlatformThemeIcon(GTK_STOCK_CLEAR, rect.width()).releaseRef();
     IntRect centeredRect(centerRectVerticallyInParentInputElement(object, rect));
-    i.context->drawImage(cancelImage, DeviceColorSpace, centeredRect);
+    i.context->drawImage(cancelImage, ColorSpaceDeviceRGB, centeredRect);
     return false;
 }
 
@@ -805,8 +805,8 @@ String RenderThemeGtk::extraMediaControlsStyleSheet()
 
 static inline bool paintMediaButton(GraphicsContext* context, const IntRect& r, Image* image, Color panelColor, int mediaIconSize)
 {
-    context->fillRect(FloatRect(r), panelColor, DeviceColorSpace);
-    context->drawImage(image, DeviceColorSpace,
+    context->fillRect(FloatRect(r), panelColor, ColorSpaceDeviceRGB);
+    context->drawImage(image, ColorSpaceDeviceRGB,
                        IntRect(r.x() + (r.width() - mediaIconSize) / 2,
                                r.y() + (r.height() - mediaIconSize) / 2,
                                mediaIconSize, mediaIconSize));
@@ -852,9 +852,9 @@ bool RenderThemeGtk::paintMediaSliderTrack(RenderObject* o, const PaintInfo& pai
 {
     GraphicsContext* context = paintInfo.context;
 
-    context->fillRect(FloatRect(r), m_panelColor, DeviceColorSpace);
+    context->fillRect(FloatRect(r), m_panelColor, ColorSpaceDeviceRGB);
     context->fillRect(FloatRect(IntRect(r.x(), r.y() + (r.height() - m_mediaSliderHeight) / 2,
-                                        r.width(), m_mediaSliderHeight)), m_sliderColor, DeviceColorSpace);
+                                        r.width(), m_mediaSliderHeight)), m_sliderColor, ColorSpaceDeviceRGB);
 
     RenderStyle* style = o->style();
     HTMLMediaElement* mediaElement = toParentMediaElement(o);
@@ -911,7 +911,7 @@ bool RenderThemeGtk::paintMediaSliderTrack(RenderObject* o, const PaintInfo& pai
 bool RenderThemeGtk::paintMediaSliderThumb(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
 {
     // Make the thumb nicer with rounded corners.
-    paintInfo.context->fillRoundedRect(r, IntSize(3, 3), IntSize(3, 3), IntSize(3, 3), IntSize(3, 3), m_sliderThumbColor, DeviceColorSpace);
+    paintInfo.context->fillRoundedRect(r, IntSize(3, 3), IntSize(3, 3), IntSize(3, 3), IntSize(3, 3), m_sliderThumbColor, ColorSpaceDeviceRGB);
     return false;
 }
 #endif
diff --git a/WebCore/platform/mac/ScrollbarThemeMac.mm b/WebCore/platform/mac/ScrollbarThemeMac.mm
index d3dc280..ce3be1a 100644
--- a/WebCore/platform/mac/ScrollbarThemeMac.mm
+++ b/WebCore/platform/mac/ScrollbarThemeMac.mm
@@ -395,7 +395,7 @@ bool ScrollbarThemeMac::paint(Scrollbar* scrollbar, GraphicsContext* context, co
             return true;
         
         HIThemeDrawTrack(&trackInfo, 0, imageBuffer->context()->platformContext(), kHIThemeOrientationNormal);
-        context->drawImageBuffer(imageBuffer.get(), DeviceColorSpace, scrollbar->frameRect().location());
+        context->drawImageBuffer(imageBuffer.get(), ColorSpaceDeviceRGB, scrollbar->frameRect().location());
     }
 
     return true;
diff --git a/WebCore/platform/win/PopupMenuWin.cpp b/WebCore/platform/win/PopupMenuWin.cpp
index a782b03..e86aef9 100644
--- a/WebCore/platform/win/PopupMenuWin.cpp
+++ b/WebCore/platform/win/PopupMenuWin.cpp
@@ -619,11 +619,11 @@ void PopupMenuWin::paint(const IntRect& damageRect, HDC hdc)
 
         // Draw the background for this menu item
         if (itemStyle.isVisible())
-            context.fillRect(itemRect, optionBackgroundColor, DeviceColorSpace);
+            context.fillRect(itemRect, optionBackgroundColor, ColorSpaceDeviceRGB);
 
         if (client()->itemIsSeparator(index)) {
             IntRect separatorRect(itemRect.x() + separatorPadding, itemRect.y() + (itemRect.height() - separatorHeight) / 2, itemRect.width() - 2 * separatorPadding, separatorHeight);
-            context.fillRect(separatorRect, optionTextColor, DeviceColorSpace);
+            context.fillRect(separatorRect, optionTextColor, ColorSpaceDeviceRGB);
             continue;
         }
 
@@ -633,7 +633,7 @@ void PopupMenuWin::paint(const IntRect& damageRect, HDC hdc)
         const UChar* string = itemText.characters();
         TextRun textRun(string, length, false, 0, 0, itemText.defaultWritingDirection() == WTF::Unicode::RightToLeft);
 
-        context.setFillColor(optionTextColor, DeviceColorSpace);
+        context.setFillColor(optionTextColor, ColorSpaceDeviceRGB);
         
         Font itemFont = client()->menuStyle().font();
         if (client()->itemIsLabel(index)) {
diff --git a/WebCore/platform/win/WebCoreTextRenderer.cpp b/WebCore/platform/win/WebCoreTextRenderer.cpp
index f771e00..a32fa4f 100644
--- a/WebCore/platform/win/WebCoreTextRenderer.cpp
+++ b/WebCore/platform/win/WebCoreTextRenderer.cpp
@@ -49,7 +49,7 @@ static void doDrawTextAtPoint(GraphicsContext& context, const String& text, cons
 {
     TextRun run(text.characters(), text.length());
 
-    context.setFillColor(color, DeviceColorSpace);
+    context.setFillColor(color, ColorSpaceDeviceRGB);
     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, DeviceColorSpace);
+        context.setStrokeColor(color, ColorSpaceDeviceRGB);
         context.drawLineForText(underlinePoint, underlinedWidth, false);
     }
 }
diff --git a/WebCore/platform/wx/wxcode/mac/carbon/non-kerned-drawing.cpp b/WebCore/platform/wx/wxcode/mac/carbon/non-kerned-drawing.cpp
index 82259f4..56a5d07 100644
--- a/WebCore/platform/wx/wxcode/mac/carbon/non-kerned-drawing.cpp
+++ b/WebCore/platform/wx/wxcode/mac/carbon/non-kerned-drawing.cpp
@@ -48,7 +48,7 @@ void drawTextWithSpacing(GraphicsContext* graphicsContext, const SimpleFontData*
     wxGCDC* dc = static_cast<wxGCDC*>(graphicsContext->platformContext());
 
     wxFont* wxfont = font->getWxFont();
-    graphicsContext->setFillColor(graphicsContext->fillColor(), DeviceColorSpace);
+    graphicsContext->setFillColor(graphicsContext->fillColor(), ColorSpaceDeviceRGB);
 
     CGContextRef cgContext = static_cast<CGContextRef>(dc->GetGraphicsContext()->GetNativeContext());
 
diff --git a/WebCore/plugins/PluginView.cpp b/WebCore/plugins/PluginView.cpp
index 97fc419..62616bb 100644
--- a/WebCore/plugins/PluginView.cpp
+++ b/WebCore/plugins/PluginView.cpp
@@ -1252,7 +1252,7 @@ void PluginView::paintMissingPluginIcon(GraphicsContext* context, const IntRect&
 
     context->save();
     context->clip(windowClipRect());
-    context->drawImage(nullPluginImage.get(), DeviceColorSpace, imageRect.location());
+    context->drawImage(nullPluginImage.get(), ColorSpaceDeviceRGB, imageRect.location());
     context->restore();
 }
 
diff --git a/WebCore/rendering/RenderLayer.cpp b/WebCore/rendering/RenderLayer.cpp
index a3639d8..984755f 100644
--- a/WebCore/rendering/RenderLayer.cpp
+++ b/WebCore/rendering/RenderLayer.cpp
@@ -969,7 +969,7 @@ void RenderLayer::beginTransparencyLayers(GraphicsContext* p, const RenderLayer*
         p->clip(clipRect);
         p->beginTransparencyLayer(renderer()->opacity());
 #ifdef REVEAL_TRANSPARENCY_LAYERS
-        p->setFillColor(Color(0.0f, 0.0f, 0.5f, 0.2f), DeviceColorSpace);
+        p->setFillColor(Color(0.0f, 0.0f, 0.5f, 0.2f), ColorSpaceDeviceRGB);
         p->fillRect(clipRect);
 #endif
     }
@@ -2201,9 +2201,9 @@ void RenderLayer::paintResizer(GraphicsContext* context, int tx, int ty, const I
         context->clip(absRect);
         IntRect largerCorner = absRect;
         largerCorner.setSize(IntSize(largerCorner.width() + 1, largerCorner.height() + 1));
-        context->setStrokeColor(Color(makeRGB(217, 217, 217)), DeviceColorSpace);
+        context->setStrokeColor(Color(makeRGB(217, 217, 217)), ColorSpaceDeviceRGB);
         context->setStrokeThickness(1.0f);
-        context->setFillColor(Color::transparent, DeviceColorSpace);
+        context->setFillColor(Color::transparent, ColorSpaceDeviceRGB);
         context->drawRect(largerCorner);
         context->restore();
     }
diff --git a/WebCore/rendering/RenderListMarker.cpp b/WebCore/rendering/RenderListMarker.cpp
index e6250c7..ab5da61 100644
--- a/WebCore/rendering/RenderListMarker.cpp
+++ b/WebCore/rendering/RenderListMarker.cpp
@@ -1154,7 +1154,7 @@ void RenderListMarker::paint(PaintInfo& paintInfo, int tx, int ty)
             context->drawEllipse(marker);
             return;
         case Circle:
-            context->setFillColor(Color::transparent, DeviceColorSpace);
+            context->setFillColor(Color::transparent, ColorSpaceDeviceRGB);
             context->drawEllipse(marker);
             return;
         case Square:
diff --git a/WebCore/rendering/RenderMediaControlsChromium.cpp b/WebCore/rendering/RenderMediaControlsChromium.cpp
index ab650da..f938a52 100644
--- a/WebCore/rendering/RenderMediaControlsChromium.cpp
+++ b/WebCore/rendering/RenderMediaControlsChromium.cpp
@@ -63,7 +63,7 @@ static bool hasSource(const HTMLMediaElement* mediaElement)
 static bool paintMediaButton(GraphicsContext* context, const IntRect& rect, Image* image)
 {
     IntRect imageRect = image->rect();
-    context->drawImage(image, DeviceColorSpace, rect);
+    context->drawImage(image, ColorSpaceDeviceRGB, rect);
     return true;
 }
 
@@ -120,9 +120,9 @@ static bool paintMediaSlider(RenderObject* object, const PaintInfo& paintInfo, c
     context->save();
     context->setShouldAntialias(true);
     context->setStrokeStyle(SolidStroke);
-    context->setStrokeColor(style->visitedDependentColor(CSSPropertyBorderLeftColor), DeviceColorSpace);
+    context->setStrokeColor(style->visitedDependentColor(CSSPropertyBorderLeftColor), ColorSpaceDeviceRGB);
     context->setStrokeThickness(style->borderLeftWidth());
-    context->setFillColor(style->visitedDependentColor(CSSPropertyBackgroundColor), DeviceColorSpace);
+    context->setFillColor(style->visitedDependentColor(CSSPropertyBackgroundColor), ColorSpaceDeviceRGB);
     context->drawRect(rect);
     context->restore();
 
@@ -189,13 +189,13 @@ static bool paintMediaVolumeSlider(RenderObject* object, const PaintInfo& paintI
     GraphicsContext* context = paintInfo.context;
     Color originalColor = context->strokeColor();
     if (originalColor != Color::white)
-        context->setStrokeColor(Color::white, DeviceColorSpace);
+        context->setStrokeColor(Color::white, ColorSpaceDeviceRGB);
 
     int x = rect.x() + rect.width() / 2;
     context->drawLine(IntPoint(x, rect.y()),  IntPoint(x, rect.y() + rect.height()));
 
     if (originalColor != Color::white)
-        context->setStrokeColor(originalColor, DeviceColorSpace);
+        context->setStrokeColor(originalColor, ColorSpaceDeviceRGB);
     return true;
 }
 
@@ -224,17 +224,17 @@ static bool paintMediaTimelineContainer(RenderObject* object, const PaintInfo& p
 
         // Draw the left border using CSS defined width and color.
         context->setStrokeThickness(object->style()->borderLeftWidth());
-        context->setStrokeColor(object->style()->visitedDependentColor(CSSPropertyBorderLeftColor).rgb(), DeviceColorSpace);
+        context->setStrokeColor(object->style()->visitedDependentColor(CSSPropertyBorderLeftColor).rgb(), ColorSpaceDeviceRGB);
         context->drawLine(IntPoint(rect.x() + 1, rect.y()),
                           IntPoint(rect.x() + 1, rect.y() + rect.height()));
 
         // Draw the right border using CSS defined width and color.
         context->setStrokeThickness(object->style()->borderRightWidth());
-        context->setStrokeColor(object->style()->visitedDependentColor(CSSPropertyBorderRightColor).rgb(), DeviceColorSpace);
+        context->setStrokeColor(object->style()->visitedDependentColor(CSSPropertyBorderRightColor).rgb(), ColorSpaceDeviceRGB);
         context->drawLine(IntPoint(rect.x() + rect.width() - 1, rect.y()),
                           IntPoint(rect.x() + rect.width() - 1, rect.y() + rect.height()));
 
-        context->setStrokeColor(originalColor, DeviceColorSpace);
+        context->setStrokeColor(originalColor, ColorSpaceDeviceRGB);
         context->setStrokeThickness(originalThickness);
         context->setStrokeStyle(originalStyle);
     }
diff --git a/WebCore/rendering/RenderSVGImage.cpp b/WebCore/rendering/RenderSVGImage.cpp
index 85eb3fa..a569759 100644
--- a/WebCore/rendering/RenderSVGImage.cpp
+++ b/WebCore/rendering/RenderSVGImage.cpp
@@ -129,7 +129,7 @@ void RenderSVGImage::paint(PaintInfo& paintInfo, int, int)
                 if (imageElement->preserveAspectRatio().align() != SVGPreserveAspectRatio::SVG_PRESERVEASPECTRATIO_NONE)
                     imageElement->preserveAspectRatio().transformRect(destRect, srcRect);
 
-                childPaintInfo.context->drawImage(image, DeviceColorSpace, destRect, srcRect);
+                childPaintInfo.context->drawImage(image, ColorSpaceDeviceRGB, destRect, srcRect);
             }
 
             SVGRenderSupport::finishRenderSVGContent(this, childPaintInfo, savedInfo.context);
diff --git a/WebCore/rendering/RenderSVGResourceClipper.cpp b/WebCore/rendering/RenderSVGResourceClipper.cpp
index 2659d64..e7b9fbb 100644
--- a/WebCore/rendering/RenderSVGResourceClipper.cpp
+++ b/WebCore/rendering/RenderSVGResourceClipper.cpp
@@ -178,7 +178,7 @@ bool RenderSVGResourceClipper::applyClippingToContext(RenderObject* object, cons
     FloatRect clampedAbsoluteTargetRect = SVGImageBufferTools::clampedAbsoluteTargetRectForRenderer(object, absoluteTargetRect);
 
     if (shouldCreateClipData && !clampedAbsoluteTargetRect.isEmpty()) {
-        if (!SVGImageBufferTools::createImageBuffer(absoluteTargetRect, clampedAbsoluteTargetRect, clipperData->clipMaskImage, DeviceRGB))
+        if (!SVGImageBufferTools::createImageBuffer(absoluteTargetRect, clampedAbsoluteTargetRect, clipperData->clipMaskImage, ColorSpaceDeviceRGB))
             return false;
 
         GraphicsContext* maskContext = clipperData->clipMaskImage->context();
diff --git a/WebCore/rendering/RenderSVGResourceFilter.cpp b/WebCore/rendering/RenderSVGResourceFilter.cpp
index a8f785b..3203ddf 100644
--- a/WebCore/rendering/RenderSVGResourceFilter.cpp
+++ b/WebCore/rendering/RenderSVGResourceFilter.cpp
@@ -226,7 +226,7 @@ bool RenderSVGResourceFilter::applyResource(RenderObject* object, RenderStyle*,
     absoluteDrawingRegion.scale(scale.width(), scale.height());
 
     OwnPtr<ImageBuffer> sourceGraphic;
-    if (!SVGImageBufferTools::createImageBuffer(absoluteDrawingRegion, absoluteDrawingRegion, sourceGraphic, LinearRGB))
+    if (!SVGImageBufferTools::createImageBuffer(absoluteDrawingRegion, absoluteDrawingRegion, sourceGraphic, ColorSpaceLinearRGB))
         return false;
     
     GraphicsContext* sourceGraphicContext = sourceGraphic->context();
@@ -273,7 +273,7 @@ void RenderSVGResourceFilter::postApplyResource(RenderObject* object, GraphicsCo
         filterData->savedContext = 0;
 #if !PLATFORM(CG)
         if (filterData->sourceGraphicBuffer)
-            filterData->sourceGraphicBuffer->transformColorSpace(DeviceRGB, LinearRGB);
+            filterData->sourceGraphicBuffer->transformColorSpace(ColorSpaceDeviceRGB, ColorSpaceLinearRGB);
 #endif
     }
 
@@ -289,7 +289,7 @@ void RenderSVGResourceFilter::postApplyResource(RenderObject* object, GraphicsCo
 #if !PLATFORM(CG)
             ImageBuffer* resultImage = lastEffect->resultImage();
             if (resultImage)
-                resultImage->transformColorSpace(LinearRGB, DeviceRGB);
+                resultImage->transformColorSpace(ColorSpaceLinearRGB, ColorSpaceDeviceRGB);
 #endif
             filterData->builded = true;
         }
diff --git a/WebCore/rendering/RenderSVGResourceGradient.cpp b/WebCore/rendering/RenderSVGResourceGradient.cpp
index b4ecb9e..a757147 100644
--- a/WebCore/rendering/RenderSVGResourceGradient.cpp
+++ b/WebCore/rendering/RenderSVGResourceGradient.cpp
@@ -92,7 +92,7 @@ static inline bool createMaskAndSwapContextForTextGradient(GraphicsContext*& con
         return false;
 
     OwnPtr<ImageBuffer> maskImage;
-    if (!SVGImageBufferTools::createImageBuffer(absoluteTargetRect, clampedAbsoluteTargetRect, maskImage, DeviceRGB))
+    if (!SVGImageBufferTools::createImageBuffer(absoluteTargetRect, clampedAbsoluteTargetRect, maskImage, ColorSpaceDeviceRGB))
         return false;
 
     GraphicsContext* maskImageContext = maskImage->context();
diff --git a/WebCore/rendering/RenderSVGResourceMasker.cpp b/WebCore/rendering/RenderSVGResourceMasker.cpp
index 3e81929..10133b2 100644
--- a/WebCore/rendering/RenderSVGResourceMasker.cpp
+++ b/WebCore/rendering/RenderSVGResourceMasker.cpp
@@ -107,7 +107,7 @@ bool RenderSVGResourceMasker::applyResource(RenderObject* object, RenderStyle*,
         if (!maskElement)
             return false;
 
-        if (!SVGImageBufferTools::createImageBuffer(absoluteTargetRect, clampedAbsoluteTargetRect, maskerData->maskImage, LinearRGB))
+        if (!SVGImageBufferTools::createImageBuffer(absoluteTargetRect, clampedAbsoluteTargetRect, maskerData->maskImage, ColorSpaceLinearRGB))
             return false;
 
         GraphicsContext* maskImageContext = maskerData->maskImage->context();
@@ -156,7 +156,7 @@ void RenderSVGResourceMasker::drawContentIntoMaskImage(MaskerData* maskerData, c
     maskImageContext->restore();
 
 #if !PLATFORM(CG)
-    maskerData->maskImage->transformColorSpace(DeviceRGB, LinearRGB);
+    maskerData->maskImage->transformColorSpace(ColorSpaceDeviceRGB, ColorSpaceLinearRGB);
 #endif
 
     // Create the luminance mask.
diff --git a/WebCore/rendering/RenderSVGResourcePattern.cpp b/WebCore/rendering/RenderSVGResourcePattern.cpp
index 40dd4f4..d2e4563 100644
--- a/WebCore/rendering/RenderSVGResourcePattern.cpp
+++ b/WebCore/rendering/RenderSVGResourcePattern.cpp
@@ -262,7 +262,7 @@ PassOwnPtr<ImageBuffer> RenderSVGResourcePattern::createTileImage(RenderObject*
 
     OwnPtr<ImageBuffer> tileImage;
 
-    if (!SVGImageBufferTools::createImageBuffer(absoluteTileBoundaries, clampedAbsoluteTileBoundaries, tileImage, DeviceRGB))
+    if (!SVGImageBufferTools::createImageBuffer(absoluteTileBoundaries, clampedAbsoluteTileBoundaries, tileImage, ColorSpaceDeviceRGB))
         return PassOwnPtr<ImageBuffer>();
 
     GraphicsContext* tileImageContext = tileImage->context();
diff --git a/WebCore/rendering/RenderSVGResourceSolidColor.cpp b/WebCore/rendering/RenderSVGResourceSolidColor.cpp
index e8e1824..0c09652 100644
--- a/WebCore/rendering/RenderSVGResourceSolidColor.cpp
+++ b/WebCore/rendering/RenderSVGResourceSolidColor.cpp
@@ -52,7 +52,7 @@ bool RenderSVGResourceSolidColor::applyResource(RenderObject* object, RenderStyl
     ASSERT(resourceMode != ApplyToDefaultMode);
 
     const SVGRenderStyle* svgStyle = style ? style->svgStyle() : 0;
-    ColorSpace colorSpace = style ? style->colorSpace() : DeviceColorSpace;
+    ColorSpace colorSpace = style ? style->colorSpace() : ColorSpaceDeviceRGB;
 
     if (resourceMode & ApplyToFillMode) {
         context->setAlpha(svgStyle ? svgStyle->fillOpacity() : 1.0f);
diff --git a/WebCore/rendering/RenderScrollbarTheme.cpp b/WebCore/rendering/RenderScrollbarTheme.cpp
index 19143cc..e32d87a 100644
--- a/WebCore/rendering/RenderScrollbarTheme.cpp
+++ b/WebCore/rendering/RenderScrollbarTheme.cpp
@@ -109,7 +109,7 @@ IntRect RenderScrollbarTheme::constrainTrackRectToTrackPieces(Scrollbar* scrollb
 void RenderScrollbarTheme::paintScrollCorner(ScrollView*, GraphicsContext* context, const IntRect& cornerRect)
 {
     // FIXME: Implement.
-    context->fillRect(cornerRect, Color::white, DeviceColorSpace);
+    context->fillRect(cornerRect, Color::white, ColorSpaceDeviceRGB);
 }
 
 void RenderScrollbarTheme::paintScrollbarBackground(GraphicsContext* context, Scrollbar* scrollbar)
diff --git a/WebCore/rendering/RenderThemeMac.mm b/WebCore/rendering/RenderThemeMac.mm
index fd2aa8c..b632d9a 100644
--- a/WebCore/rendering/RenderThemeMac.mm
+++ b/WebCore/rendering/RenderThemeMac.mm
@@ -964,7 +964,7 @@ bool RenderThemeMac::paintProgressBar(RenderObject* renderObject, const PaintInf
         paintInfo.context->scale(FloatSize(-1, 1));
     }
     
-    paintInfo.context->drawImageBuffer(imageBuffer.get(), DeviceColorSpace, rect.location());
+    paintInfo.context->drawImageBuffer(imageBuffer.get(), ColorSpaceDeviceRGB, rect.location());
 
     paintInfo.context->restore();
     return false;
@@ -1141,11 +1141,11 @@ bool RenderThemeMac::paintMenuListButton(RenderObject* o, const PaintInfo& paint
     // Draw the separator to the left of the arrows
     paintInfo.context->setStrokeThickness(1.0f); // Deliberately ignores zoom since it looks nicer if it stays thin.
     paintInfo.context->setStrokeStyle(SolidStroke);
-    paintInfo.context->setStrokeColor(leftSeparatorColor, DeviceColorSpace);
+    paintInfo.context->setStrokeColor(leftSeparatorColor, ColorSpaceDeviceRGB);
     paintInfo.context->drawLine(IntPoint(leftEdgeOfSeparator, bounds.y()),
                                 IntPoint(leftEdgeOfSeparator, bounds.bottom()));
 
-    paintInfo.context->setStrokeColor(rightSeparatorColor, DeviceColorSpace);
+    paintInfo.context->setStrokeColor(rightSeparatorColor, ColorSpaceDeviceRGB);
     paintInfo.context->drawLine(IntPoint(leftEdgeOfSeparator + separatorSpace, bounds.y()),
                                 IntPoint(leftEdgeOfSeparator + separatorSpace, bounds.bottom()));
 
diff --git a/WebCore/rendering/RenderThemeSafari.cpp b/WebCore/rendering/RenderThemeSafari.cpp
index 07b8eb8..8d66ba7 100644
--- a/WebCore/rendering/RenderThemeSafari.cpp
+++ b/WebCore/rendering/RenderThemeSafari.cpp
@@ -830,8 +830,8 @@ bool RenderThemeSafari::paintMenuListButton(RenderObject* o, const PaintInfo& pa
 
     paintInfo.context->save();
 
-    paintInfo.context->setFillColor(o->style()->visitedDependentColor(CSSPropertyColor), DeviceColorSpace);
-    paintInfo.context->setStrokeColor(NoStroke, DeviceColorSpace);
+    paintInfo.context->setFillColor(o->style()->visitedDependentColor(CSSPropertyColor), ColorSpaceDeviceRGB);
+    paintInfo.context->setStrokeColor(NoStroke, ColorSpaceDeviceRGB);
 
     FloatPoint arrow[3];
     arrow[0] = FloatPoint(leftEdge, centerY - arrowHeight / 2.0f);
@@ -851,11 +851,11 @@ bool RenderThemeSafari::paintMenuListButton(RenderObject* o, const PaintInfo& pa
     // Draw the separator to the left of the arrows
     paintInfo.context->setStrokeThickness(1.0f);
     paintInfo.context->setStrokeStyle(SolidStroke);
-    paintInfo.context->setStrokeColor(leftSeparatorColor, DeviceColorSpace);
+    paintInfo.context->setStrokeColor(leftSeparatorColor, ColorSpaceDeviceRGB);
     paintInfo.context->drawLine(IntPoint(leftEdgeOfSeparator, bounds.y()),
                                 IntPoint(leftEdgeOfSeparator, bounds.bottom()));
 
-    paintInfo.context->setStrokeColor(rightSeparatorColor, DeviceColorSpace);
+    paintInfo.context->setStrokeColor(rightSeparatorColor, ColorSpaceDeviceRGB);
     paintInfo.context->drawLine(IntPoint(leftEdgeOfSeparator + separatorSpace, bounds.y()),
                                 IntPoint(leftEdgeOfSeparator + separatorSpace, bounds.bottom()));
 
diff --git a/WebCore/rendering/RenderThemeWinCE.cpp b/WebCore/rendering/RenderThemeWinCE.cpp
index 66cda11..27b8783 100644
--- a/WebCore/rendering/RenderThemeWinCE.cpp
+++ b/WebCore/rendering/RenderThemeWinCE.cpp
@@ -378,12 +378,12 @@ bool RenderThemeWinCE::paintSearchFieldCancelButton(RenderObject* o, const Paint
     IntRect cancelBounds(IntPoint(x, y), cancelSize);
     paintInfo.context->save();
     paintInfo.context->addRoundedRectClip(cancelBounds, cancelRadius, cancelRadius, cancelRadius, cancelRadius);
-    paintInfo.context->fillRect(cancelBounds, buttonColor, DeviceColorSpace);
+    paintInfo.context->fillRect(cancelBounds, buttonColor, ColorSpaceDeviceRGB);
 
     // Draw the 'x'
     IntSize xSize(3, 3);
     IntRect xBounds(cancelBounds.location() + IntSize(3, 3), xSize);
-    paintInfo.context->setStrokeColor(Color::white, DeviceColorSpace);
+    paintInfo.context->setStrokeColor(Color::white, ColorSpaceDeviceRGB);
     paintInfo.context->drawLine(xBounds.location(),  xBounds.location() + xBounds.size());
     paintInfo.context->drawLine(IntPoint(xBounds.right(), xBounds.y()),  IntPoint(xBounds.x(), xBounds.bottom()));
 
@@ -490,8 +490,8 @@ bool RenderThemeWinCE::paintSliderTrack(RenderObject* o, const PaintInfo& i, con
     bool rc = RenderTheme::paintSliderTrack(o, i, r);
     IntPoint left = IntPoint(r.x() + 2, (r.y() + r.bottom()) / 2);
     i.context->save();
-    i.context->setStrokeColor(Color::gray, DeviceColorSpace);
-    i.context->setFillColor(Color::gray, DeviceColorSpace);
+    i.context->setStrokeColor(Color::gray, ColorSpaceDeviceRGB);
+    i.context->setFillColor(Color::gray, ColorSpaceDeviceRGB);
     i.context->fillRect(r);
 #if ENABLE(VIDEO)
     HTMLMediaElement* mediaElement = mediaElementParent(o->node());
@@ -502,7 +502,7 @@ bool RenderThemeWinCE::paintSliderTrack(RenderObject* o, const PaintInfo& i, con
         left = right;
     }
 #endif
-    i.context->setStrokeColor(Color::black, DeviceColorSpace);
+    i.context->setStrokeColor(Color::black, ColorSpaceDeviceRGB);
     i.context->drawLine(left, IntPoint(r.right() - 2, left.y()));
     i.context->restore();
     return rc;
@@ -512,8 +512,8 @@ bool RenderThemeWinCE::paintSliderThumb(RenderObject* o, const PaintInfo& i, con
 {
     bool rc = RenderTheme::paintSliderThumb(o, i, r);
     i.context->save();
-    i.context->setStrokeColor(Color::black, DeviceColorSpace);
-    i.context->setFillColor(Color::black, DeviceColorSpace);
+    i.context->setStrokeColor(Color::black, ColorSpaceDeviceRGB);
+    i.context->setFillColor(Color::black, ColorSpaceDeviceRGB);
 #if ENABLE(VIDEO)
     HTMLMediaElement* mediaElement = mediaElementParent(o->node());
     if (mediaElement) {
diff --git a/WebCore/rendering/SVGImageBufferTools.cpp b/WebCore/rendering/SVGImageBufferTools.cpp
index 709bf10..903aa21 100644
--- a/WebCore/rendering/SVGImageBufferTools.cpp
+++ b/WebCore/rendering/SVGImageBufferTools.cpp
@@ -50,7 +50,7 @@ void SVGImageBufferTools::calculateTransformationToOutermostSVGCoordinateSystem(
     }
 }
 
-bool SVGImageBufferTools::createImageBuffer(const FloatRect& absoluteTargetRect, const FloatRect& clampedAbsoluteTargetRect, OwnPtr<ImageBuffer>& imageBuffer, ImageColorSpace colorSpace)
+bool SVGImageBufferTools::createImageBuffer(const FloatRect& absoluteTargetRect, const FloatRect& clampedAbsoluteTargetRect, OwnPtr<ImageBuffer>& imageBuffer, ColorSpace colorSpace)
 {
     IntSize imageSize(roundedImageBufferSize(clampedAbsoluteTargetRect.size()));
     IntSize unclampedImageSize(SVGImageBufferTools::roundedImageBufferSize(absoluteTargetRect.size()));
diff --git a/WebCore/rendering/SVGImageBufferTools.h b/WebCore/rendering/SVGImageBufferTools.h
index 8894aae..9bcc7a4 100644
--- a/WebCore/rendering/SVGImageBufferTools.h
+++ b/WebCore/rendering/SVGImageBufferTools.h
@@ -34,7 +34,7 @@ class RenderObject;
 
 class SVGImageBufferTools : public Noncopyable {
 public:
-    static bool createImageBuffer(const FloatRect& absoluteTargetRect, const FloatRect& clampedAbsoluteTargetRect, OwnPtr<ImageBuffer>&, ImageColorSpace);
+    static bool createImageBuffer(const FloatRect& absoluteTargetRect, const FloatRect& clampedAbsoluteTargetRect, OwnPtr<ImageBuffer>&, ColorSpace);
     static void renderSubtreeToImageBuffer(ImageBuffer*, RenderObject*, const AffineTransform&);
     static void clipToImageBuffer(GraphicsContext*, const AffineTransform& absoluteTransform, const FloatRect& clampedAbsoluteTargetRect, OwnPtr<ImageBuffer>&);
 
diff --git a/WebCore/rendering/style/StyleRareInheritedData.cpp b/WebCore/rendering/style/StyleRareInheritedData.cpp
index 326c4ee..8e34813 100644
--- a/WebCore/rendering/style/StyleRareInheritedData.cpp
+++ b/WebCore/rendering/style/StyleRareInheritedData.cpp
@@ -43,7 +43,7 @@ StyleRareInheritedData::StyleRareInheritedData()
     , textSizeAdjust(RenderStyle::initialTextSizeAdjust())
     , resize(RenderStyle::initialResize())
     , userSelect(RenderStyle::initialUserSelect())
-    , colorSpace(DeviceColorSpace)
+    , colorSpace(ColorSpaceDeviceRGB)
     , speak(SpeakNormal)
     , hyphens(HyphensManual)
 {
diff --git a/WebCore/svg/SVGFEImageElement.cpp b/WebCore/svg/SVGFEImageElement.cpp
index b9d1a3d..0ea7933 100644
--- a/WebCore/svg/SVGFEImageElement.cpp
+++ b/WebCore/svg/SVGFEImageElement.cpp
@@ -27,6 +27,7 @@
 #include "Attr.h"
 #include "CachedImage.h"
 #include "CachedResourceLoader.h"
+#include "ColorSpace.h"
 #include "Document.h"
 #include "RenderObject.h"
 #include "RenderSVGResource.h"
@@ -134,7 +135,7 @@ PassRefPtr<FilterEffect> SVGFEImageElement::build(SVGFilterBuilder*)
             return 0;
 
         IntRect targetRect = enclosingIntRect(renderer->objectBoundingBox());
-        m_targetImage = ImageBuffer::create(targetRect.size(), LinearRGB);
+        m_targetImage = ImageBuffer::create(targetRect.size(), ColorSpaceLinearRGB);
 
         AffineTransform contentTransformation;
         SVGImageBufferTools::renderSubtreeToImageBuffer(m_targetImage.get(), renderer, contentTransformation);
diff --git a/WebCore/svg/graphics/SVGImage.cpp b/WebCore/svg/graphics/SVGImage.cpp
index 2d1d592..c9804ae 100644
--- a/WebCore/svg/graphics/SVGImage.cpp
+++ b/WebCore/svg/graphics/SVGImage.cpp
@@ -224,7 +224,7 @@ NativeImagePtr SVGImage::nativeImageForCurrentFrame()
         OwnPtr<ImageBuffer> buffer = ImageBuffer::create(size());
         if (!buffer) // failed to allocate image
             return 0;
-        draw(buffer->context(), rect(), rect(), DeviceColorSpace, CompositeSourceOver);
+        draw(buffer->context(), rect(), rect(), ColorSpaceDeviceRGB, CompositeSourceOver);
         m_frameCache = buffer->copyImage();
     }
     return m_frameCache->nativeImageForCurrentFrame();
diff --git a/WebCore/svg/graphics/filters/SVGFEImage.cpp b/WebCore/svg/graphics/filters/SVGFEImage.cpp
index 757c4fa..ed90588 100644
--- a/WebCore/svg/graphics/filters/SVGFEImage.cpp
+++ b/WebCore/svg/graphics/filters/SVGFEImage.cpp
@@ -70,7 +70,7 @@ void FEImage::apply(Filter* filter)
     IntPoint paintLocation = absolutePaintRect().location();
     destRect.move(-paintLocation.x(), -paintLocation.y());
 
-    filterContext->drawImage(m_image.get(), DeviceColorSpace, destRect, srcRect);
+    filterContext->drawImage(m_image.get(), ColorSpaceDeviceRGB, destRect, srcRect);
 }
 
 void FEImage::dump()
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index 3fa8ec0..75d0ac6 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,22 @@
+2010-10-20  Dirk Schulze  <krit at webkit.org>
+
+        Reviewed by Nikolas Zimmermann.
+
+        Merge ColorSpace and ImageColorSpace enums
+        https://bugs.webkit.org/show_bug.cgi?id=47922
+
+        Renamed ColorSpace enum entries DeviceColorSpace and sRGBColorSpace to ColorSpaceDeviceRGB and ColorSpaceSRGB
+        to follow webkit style rules.
+
+        * src/WebFontImpl.cpp:
+        (WebKit::WebFontImpl::drawText):
+        * src/WebFrameImpl.cpp:
+        (WebKit::WebFrameImpl::paintWithContext):
+        * src/WebViewImpl.cpp:
+        (WebKit::WebViewImpl::doPixelReadbackToCanvas):
+        * tests/TransparencyWinTest.cpp:
+        (WebCore::TEST):
+
 2010-10-19  Andrey Kosyakov  <caseq at chromium.org>
 
         Reviewed by Pavel Feldman.
diff --git a/WebKit/chromium/src/WebFontImpl.cpp b/WebKit/chromium/src/WebFontImpl.cpp
index 38d95d4..8c61997 100644
--- a/WebKit/chromium/src/WebFontImpl.cpp
+++ b/WebKit/chromium/src/WebFontImpl.cpp
@@ -104,7 +104,7 @@ void WebFontImpl::drawText(WebCanvas* canvas, const WebTextRun& run, const WebFl
 #endif
 
     gc.save();
-    gc.setFillColor(color, DeviceColorSpace);
+    gc.setFillColor(color, ColorSpaceDeviceRGB);
     gc.clip(WebCore::FloatRect(clip));
     m_font.drawText(&gc, run, leftBaseline, from, to);
     gc.restore();
diff --git a/WebKit/chromium/src/WebFrameImpl.cpp b/WebKit/chromium/src/WebFrameImpl.cpp
index 9daf26f..b4d23c0 100644
--- a/WebKit/chromium/src/WebFrameImpl.cpp
+++ b/WebKit/chromium/src/WebFrameImpl.cpp
@@ -1888,7 +1888,7 @@ void WebFrameImpl::paintWithContext(GraphicsContext& gc, const WebRect& rect)
         frameView()->paint(&gc, dirtyRect);
         m_frame->page()->inspectorController()->drawNodeHighlight(gc);
     } else
-        gc.fillRect(dirtyRect, Color::white, DeviceColorSpace);
+        gc.fillRect(dirtyRect, Color::white, ColorSpaceDeviceRGB);
     gc.restore();
 }
 
diff --git a/WebKit/chromium/src/WebViewImpl.cpp b/WebKit/chromium/src/WebViewImpl.cpp
index 0eaaac1..aeab400 100644
--- a/WebKit/chromium/src/WebViewImpl.cpp
+++ b/WebKit/chromium/src/WebViewImpl.cpp
@@ -986,7 +986,7 @@ void WebViewImpl::doPixelReadbackToCanvas(WebCanvas* canvas, const IntRect& rect
         gc.scale(FloatSize(1.0f, -1.0f));
         // Use invertRect in next line, so that transform above inverts it back to
         // desired destination rect.
-        gc.drawImageBuffer(imageBuffer.get(), DeviceColorSpace, invertRect.location());
+        gc.drawImageBuffer(imageBuffer.get(), ColorSpaceDeviceRGB, invertRect.location());
         gc.restore();
     }
 }
diff --git a/WebKit/chromium/tests/TransparencyWinTest.cpp b/WebKit/chromium/tests/TransparencyWinTest.cpp
index b83c2a9..e77f23e 100644
--- a/WebKit/chromium/tests/TransparencyWinTest.cpp
+++ b/WebKit/chromium/tests/TransparencyWinTest.cpp
@@ -315,10 +315,10 @@ TEST(TransparencyWin, OpaqueCompositeLayerPixel)
     OwnPtr<ImageBuffer> src(ImageBuffer::create(IntSize(16, 16), DeviceRGB));
 
     FloatRect fullRect(0, 0, 16, 16);
-    src->context()->fillRect(fullRect, red, DeviceColorSpace);
+    src->context()->fillRect(fullRect, red, ColorSpaceDeviceRGB);
     src->context()->beginTransparencyLayer(0.5);
     FloatRect rightHalf(8, 0, 8, 16);
-    src->context()->fillRect(rightHalf, green, DeviceColorSpace);
+    src->context()->fillRect(rightHalf, green, ColorSpaceDeviceRGB);
 
     // Make a transparency layer inset by one pixel, and fill it inset by
     // another pixel with 50% black.
@@ -330,7 +330,7 @@ TEST(TransparencyWin, OpaqueCompositeLayerPixel)
                     IntRect(1, 1, 14, 14));
 
         FloatRect inner(2, 2, 12, 12);
-        helper.context()->fillRect(inner, Color(0x7f000000), DeviceColorSpace);
+        helper.context()->fillRect(inner, Color(0x7f000000), ColorSpaceDeviceRGB);
         // These coordinates are relative to the layer, whish is inset by 1x1
         // pixels from the top left. So we're actually clearing (2, 2) and
         // (13,13), which are the extreme corners of the black area (and which
@@ -368,7 +368,7 @@ TEST(TransparencyWin, TranslateOpaqueCompositeLayer)
     OwnPtr<ImageBuffer> src(ImageBuffer::create(IntSize(16, 16), DeviceRGB));
     Color white(0xFFFFFFFF);
     FloatRect fullRect(0, 0, 16, 16);
-    src->context()->fillRect(fullRect, white, DeviceColorSpace);
+    src->context()->fillRect(fullRect, white, ColorSpaceDeviceRGB);
 
     // Scroll down by 8 (coordinate system goes up).
     src->context()->save();
@@ -388,7 +388,7 @@ TEST(TransparencyWin, TranslateOpaqueCompositeLayer)
         // Draw a red pixel at (15, 15). This should be the at (15, 7) after
         // the transform.
         FloatRect bottomRight(15, 15, 1, 1);
-        helper.context()->fillRect(bottomRight, green, DeviceColorSpace);
+        helper.context()->fillRect(bottomRight, green, ColorSpaceDeviceRGB);
         helper.composite();
     }
 
@@ -407,7 +407,7 @@ TEST(TransparencyWin, RotateOpaqueCompositeLayer)
     // The background is white.
     Color white(0xFFFFFFFF);
     FloatRect fullRect(0, 0, 16, 16);
-    src->context()->fillRect(fullRect, white, DeviceColorSpace);
+    src->context()->fillRect(fullRect, white, ColorSpaceDeviceRGB);
 
     // Rotate the image by 90 degrees. This matrix is the same as
     // cw90.rotate(90); but avoids rounding errors. Rounding errors can cause
@@ -425,7 +425,7 @@ TEST(TransparencyWin, RotateOpaqueCompositeLayer)
     src->context()->beginTransparencyLayer(0.5);
     FloatRect blackRect(0, -9, 16, 2);
     Color black(0xFF000000);
-    src->context()->fillRect(blackRect, black, DeviceColorSpace);
+    src->context()->fillRect(blackRect, black, ColorSpaceDeviceRGB);
 
     // Now draw 50% red square.
     {
@@ -439,7 +439,7 @@ TEST(TransparencyWin, RotateOpaqueCompositeLayer)
                     IntRect(1, -15, 14, 14));
 
         // Fill with red.
-        helper.context()->fillRect(helper.drawRect(), Color(0x7f7f0000), DeviceColorSpace);
+        helper.context()->fillRect(helper.drawRect(), Color(0x7f7f0000), ColorSpaceDeviceRGB);
         clearTopLayerAlphaChannel(helper.context());
         helper.composite();
     }
@@ -486,10 +486,10 @@ TEST(TransparencyWin, TranslateScaleOpaqueCompositeLayer)
     // The background is white on top with red on bottom.
     Color white(0xFFFFFFFF);
     FloatRect topRect(0, 0, 16, 8);
-    src->context()->fillRect(topRect, white, DeviceColorSpace);
+    src->context()->fillRect(topRect, white, ColorSpaceDeviceRGB);
     Color red(0xFFFF0000);
     FloatRect bottomRect(0, 8, 16, 8);
-    src->context()->fillRect(bottomRect, red, DeviceColorSpace);
+    src->context()->fillRect(bottomRect, red, ColorSpaceDeviceRGB);
 
     src->context()->save();
 
@@ -519,7 +519,7 @@ TEST(TransparencyWin, TranslateScaleOpaqueCompositeLayer)
                     IntRect(1, -15, 14, 14));
 
         // Fill with red.
-        helper.context()->fillRect(helper.drawRect(), Color(0x7f7f0000), DeviceColorSpace);
+        helper.context()->fillRect(helper.drawRect(), Color(0x7f7f0000), ColorSpaceDeviceRGB);
         clearTopLayerAlphaChannel(helper.context());
         helper.composite();
     }
@@ -531,7 +531,7 @@ TEST(TransparencyWin, Scale)
     // Create an opaque white buffer.
     OwnPtr<ImageBuffer> src(ImageBuffer::create(IntSize(16, 16), DeviceRGB));
     FloatRect fullBuffer(0, 0, 16, 16);
-    src->context()->fillRect(fullBuffer, Color::white, DeviceColorSpace);
+    src->context()->fillRect(fullBuffer, Color::white, ColorSpaceDeviceRGB);
 
     // Scale by 2x.
     src->context()->save();
@@ -586,13 +586,13 @@ TEST(TransparencyWin, ScaleTransparency)
     // Create an opaque white buffer.
     OwnPtr<ImageBuffer> src(ImageBuffer::create(IntSize(16, 16), DeviceRGB));
     FloatRect fullBuffer(0, 0, 16, 16);
-    src->context()->fillRect(fullBuffer, Color::white, DeviceColorSpace);
+    src->context()->fillRect(fullBuffer, Color::white, ColorSpaceDeviceRGB);
 
     // Make another layer (which duplicates how WebKit will make this). We fill
     // the top half with red, and have the layer be 50% opaque.
     src->context()->beginTransparencyLayer(0.5);
     FloatRect topHalf(0, 0, 16, 8);
-    src->context()->fillRect(topHalf, Color(0xFFFF0000), DeviceColorSpace);
+    src->context()->fillRect(topHalf, Color(0xFFFF0000), ColorSpaceDeviceRGB);
 
     // Scale by 2x.
     src->context()->save();
@@ -609,7 +609,7 @@ TEST(TransparencyWin, ScaleTransparency)
                     TransparencyWin::ScaleTransform,
                     IntRect(1, 1, 6, 6));
 
-        helper.context()->fillRect(helper.drawRect(), Color(0x7f000000), DeviceColorSpace);
+        helper.context()->fillRect(helper.drawRect(), Color(0x7f000000), ColorSpaceDeviceRGB);
         clearTopLayerAlphaChannel(helper.context());
         helper.composite();
     }
@@ -658,21 +658,21 @@ TEST(TransparencyWin, Text)
         // Write several different squares to simulate ClearType. These should
         // all reduce to 2/3 coverage.
         FloatRect pixel(0, 0, 1, 1);
-        helper.context()->fillRect(pixel, 0xFFFF0000, DeviceColorSpace);
+        helper.context()->fillRect(pixel, 0xFFFF0000, ColorSpaceDeviceRGB);
         pixel.move(1.0f, 0.0f);
-        helper.context()->fillRect(pixel, 0xFF00FF00, DeviceColorSpace);
+        helper.context()->fillRect(pixel, 0xFF00FF00, ColorSpaceDeviceRGB);
         pixel.move(1.0f, 0.0f);
-        helper.context()->fillRect(pixel, 0xFF0000FF, DeviceColorSpace);
+        helper.context()->fillRect(pixel, 0xFF0000FF, ColorSpaceDeviceRGB);
         pixel.move(1.0f, 0.0f);
-        helper.context()->fillRect(pixel, 0xFF008080, DeviceColorSpace);
+        helper.context()->fillRect(pixel, 0xFF008080, ColorSpaceDeviceRGB);
         pixel.move(1.0f, 0.0f);
-        helper.context()->fillRect(pixel, 0xFF800080, DeviceColorSpace);
+        helper.context()->fillRect(pixel, 0xFF800080, ColorSpaceDeviceRGB);
         pixel.move(1.0f, 0.0f);
-        helper.context()->fillRect(pixel, 0xFF808000, DeviceColorSpace);
+        helper.context()->fillRect(pixel, 0xFF808000, ColorSpaceDeviceRGB);
 
         // Try one with 100% coverage (opaque black).
         pixel.move(1.0f, 0.0f);
-        helper.context()->fillRect(pixel, 0xFF000000, DeviceColorSpace);
+        helper.context()->fillRect(pixel, 0xFF000000, ColorSpaceDeviceRGB);
 
         // Now mess with the alpha channel.
         clearTopLayerAlphaChannel(helper.context());
diff --git a/WebKit/mac/ChangeLog b/WebKit/mac/ChangeLog
index da79307..a8ca2f2 100644
--- a/WebKit/mac/ChangeLog
+++ b/WebKit/mac/ChangeLog
@@ -1,3 +1,16 @@
+2010-10-20  Dirk Schulze  <krit at webkit.org>
+
+        Reviewed by Nikolas Zimmermann.
+
+        Merge ColorSpace and ImageColorSpace enums
+        https://bugs.webkit.org/show_bug.cgi?id=47922
+
+        Renamed ColorSpace enum entries DeviceColorSpace and sRGBColorSpace to ColorSpaceDeviceRGB and ColorSpaceSRGB
+        to follow webkit style rules.
+
+        * Misc/WebKitNSStringExtras.mm:
+        (-[NSString _web_drawAtPoint:font:textColor:allowingFontSmoothing:]):
+
 2010-10-19  Alexey Proskuryakov  <ap at apple.com>
 
         Reviewed by Anders Carlsson.
diff --git a/WebKit/mac/Misc/WebKitNSStringExtras.mm b/WebKit/mac/Misc/WebKitNSStringExtras.mm
index 8fc12bd..4785de5 100644
--- a/WebKit/mac/Misc/WebKitNSStringExtras.mm
+++ b/WebKit/mac/Misc/WebKitNSStringExtras.mm
@@ -97,7 +97,7 @@ static BOOL canUseFastRenderer(const UniChar *buffer, unsigned length)
         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), DeviceColorSpace);
+        graphicsContext.setFillColor(makeRGBA(red * 255, green * 255, blue * 255, alpha * 255), ColorSpaceDeviceRGB);
 
         webCoreFont.drawText(&graphicsContext, run, FloatPoint(point.x, (flipped ? point.y : (-1 * point.y))));
 
diff --git a/WebKit/win/ChangeLog b/WebKit/win/ChangeLog
index 2eabe89..68bc934 100644
--- a/WebKit/win/ChangeLog
+++ b/WebKit/win/ChangeLog
@@ -1,3 +1,22 @@
+2010-10-20  Dirk Schulze  <krit at webkit.org>
+
+        Reviewed by Nikolas Zimmermann.
+
+        Merge ColorSpace and ImageColorSpace enums
+        https://bugs.webkit.org/show_bug.cgi?id=47922
+
+        Renamed ColorSpace enum entries DeviceColorSpace and sRGBColorSpace to ColorSpaceDeviceRGB and ColorSpaceSRGB
+        to follow webkit style rules.
+
+        * FullscreenVideoController.cpp:
+        (HUDButton::draw):
+        (HUDSlider::draw):
+        (FullscreenVideoController::draw):
+        * WebCoreSupport/WebDragClient.cpp:
+        (WebDragClient::createDragImageForLink):
+        * WebKitGraphics.cpp:
+        (WebDrawText):
+
 2010-10-18  Pavel Podivilov  <podivilov at chromium.org>
 
         Reviewed by Timothy Hatcher.
diff --git a/WebKit/win/FullscreenVideoController.cpp b/WebKit/win/FullscreenVideoController.cpp
index 696aaa5..5f9b959 100644
--- a/WebKit/win/FullscreenVideoController.cpp
+++ b/WebKit/win/FullscreenVideoController.cpp
@@ -116,7 +116,7 @@ HUDButton::HUDButton(HUDButtonType type, const IntPoint& position)
 void HUDButton::draw(GraphicsContext& context)
 {
     Image* image = (m_showAltButton && m_buttonImageAlt) ? m_buttonImageAlt.get() : m_buttonImage.get();
-    context.drawImage(image, DeviceColorSpace, m_rect.location());
+    context.drawImage(image, ColorSpaceDeviceRGB, m_rect.location());
 }
 
 HUDSlider::HUDSlider(HUDSliderButtonShape shape, int buttonSize, const IntRect& rect)
@@ -132,11 +132,11 @@ void HUDSlider::draw(GraphicsContext& context)
 {
     // Draw gutter
     IntSize radius(m_rect.height() / 2, m_rect.height() / 2);
-    context.fillRoundedRect(m_rect, radius, radius, radius, radius, Color(sliderGutterColor), DeviceColorSpace);
+    context.fillRoundedRect(m_rect, radius, radius, radius, radius, Color(sliderGutterColor), ColorSpaceDeviceRGB);
 
     // Draw button
-    context.setStrokeColor(Color(sliderButtonColor), DeviceColorSpace);
-    context.setFillColor(Color(sliderButtonColor), DeviceColorSpace);
+    context.setStrokeColor(Color(sliderButtonColor), ColorSpaceDeviceRGB);
+    context.setFillColor(Color(sliderButtonColor), ColorSpaceDeviceRGB);
 
     if (m_buttonShape == RoundButton) {
         context.drawEllipse(IntRect(m_rect.location().x() + m_buttonPosition, m_rect.location().y() - (m_buttonSize - m_rect.height()) / 2, m_buttonSize, m_buttonSize));
@@ -489,9 +489,9 @@ void FullscreenVideoController::draw()
     IntSize innerRadius(borderRadius - borderThickness, borderRadius - borderThickness);
     IntRect innerRect(borderThickness, borderThickness, windowWidth - borderThickness * 2, windowHeight - borderThickness * 2);
 
-    context.fillRoundedRect(outerRect, outerRadius, outerRadius, outerRadius, outerRadius, Color(borderColor), DeviceColorSpace);
+    context.fillRoundedRect(outerRect, outerRadius, outerRadius, outerRadius, outerRadius, Color(borderColor), ColorSpaceDeviceRGB);
     context.setCompositeOperation(CompositeCopy);
-    context.fillRoundedRect(innerRect, innerRadius, innerRadius, innerRadius, innerRadius, Color(backgroundColor), DeviceColorSpace);
+    context.fillRoundedRect(innerRect, innerRadius, innerRadius, innerRadius, innerRadius, Color(backgroundColor), ColorSpaceDeviceRGB);
 
     // Draw the widgets
     m_playPauseButton.draw(context);
@@ -526,13 +526,13 @@ void FullscreenVideoController::draw()
     // Left string
     s = timeToString(currentTime());
     TextRun leftText(s);
-    context.setFillColor(Color(textColor), DeviceColorSpace);
+    context.setFillColor(Color(textColor), ColorSpaceDeviceRGB);
     context.drawText(font, leftText, IntPoint(windowWidth / 2 - timeSliderWidth / 2 - margin - font.width(leftText), windowHeight - margin - sliderHeight / 2 + font.height() / 4));
 
     // Right string
     s = timeToString(currentTime() - duration());
     TextRun rightText(s);
-    context.setFillColor(Color(textColor), DeviceColorSpace);
+    context.setFillColor(Color(textColor), ColorSpaceDeviceRGB);
     context.drawText(font, rightText, IntPoint(windowWidth / 2 + timeSliderWidth / 2 + margin, windowHeight - margin - sliderHeight / 2 + font.height() / 4));
 
     // Copy to the window
diff --git a/WebKit/win/WebCoreSupport/WebDragClient.cpp b/WebKit/win/WebCoreSupport/WebDragClient.cpp
index 773e392..f4d9842 100644
--- a/WebKit/win/WebCoreSupport/WebDragClient.cpp
+++ b/WebKit/win/WebCoreSupport/WebDragClient.cpp
@@ -295,7 +295,7 @@ DragImageRef WebDragClient::createDragImageForLink(KURL& url, const String& inLa
     static const Color backgroundColor(140, 140, 140);
     static const IntSize radii(DRAG_LABEL_RADIUS, DRAG_LABEL_RADIUS);
     IntRect rect(0, 0, imageSize.width(), imageSize.height());
-    context.fillRoundedRect(rect, radii, radii, radii, radii, backgroundColor, DeviceColorSpace);
+    context.fillRoundedRect(rect, radii, radii, radii, radii, backgroundColor, ColorSpaceDeviceRGB);
  
     // Draw the text
     static const Color topColor(0, 0, 0, 255); //original alpha = 0.75
diff --git a/WebKit/win/WebKitGraphics.cpp b/WebKit/win/WebKitGraphics.cpp
index e9e25ab..5343608 100644
--- a/WebKit/win/WebKitGraphics.cpp
+++ b/WebKit/win/WebKitGraphics.cpp
@@ -112,7 +112,7 @@ void WebDrawText(WebTextRenderInfo* info)
         // Set shadow setting
         if (info->structSize == sizeof(WebTextRenderInfo) &&
             (info->shadowOffset.cx || info->shadowOffset.cy || info->shadowBlur || info->shadowColor))
-            context.setShadow(FloatSize(info->shadowOffset.cx, info->shadowOffset.cy), info->shadowBlur, info->shadowColor, DeviceColorSpace);
+            context.setShadow(FloatSize(info->shadowOffset.cx, info->shadowOffset.cy), info->shadowBlur, info->shadowColor, ColorSpaceDeviceRGB);
 
         WebCoreDrawTextAtPoint(context, drawString, info->pt, makeFont(*(info->description)), info->color, info->underlinedIndex);
         context.restore();
diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index a0092d8..380568f 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,18 @@
+2010-10-20  Dirk Schulze  <krit at webkit.org>
+
+        Reviewed by Nikolas Zimmermann.
+
+        Merge ColorSpace and ImageColorSpace enums
+        https://bugs.webkit.org/show_bug.cgi?id=47922
+
+        Renamed ColorSpace enum entries DeviceColorSpace and sRGBColorSpace to ColorSpaceDeviceRGB and ColorSpaceSRGB
+        to follow webkit style rules.
+
+        * UIProcess/FindIndicator.cpp:
+        (WebKit::FindIndicator::draw):
+        * WebProcess/WebPage/FindPageOverlay.cpp:
+        (WebKit::FindPageOverlay::drawRect):
+
 2010-10-20  Nikolas Zimmermann  <nzimmermann at rim.com>
 
         Not reviewed.
diff --git a/WebKit2/UIProcess/FindIndicator.cpp b/WebKit2/UIProcess/FindIndicator.cpp
index 52f48cb..59d5546 100644
--- a/WebKit2/UIProcess/FindIndicator.cpp
+++ b/WebKit2/UIProcess/FindIndicator.cpp
@@ -148,9 +148,9 @@ void FindIndicator::draw(GraphicsContext& graphicsContext, const IntRect& dirtyR
 
         graphicsContext.save();
         FloatRect outerPathRect = inflateRect(textRect, horizontalOutsetToCenterOfLightBorder, verticalOutsetToCenterOfLightBorder);
-        graphicsContext.setShadow(FloatSize(shadowOffsetX, shadowOffsetY), shadowBlurRadius, shadowColor(), sRGBColorSpace);
+        graphicsContext.setShadow(FloatSize(shadowOffsetX, shadowOffsetY), shadowBlurRadius, shadowColor(), ColorSpaceSRGB);
         graphicsContext.addPath(pathWithRoundedRect(outerPathRect, cornerRadius));
-        graphicsContext.setFillColor(lightBorderColor(), DeviceColorSpace);
+        graphicsContext.setFillColor(lightBorderColor(), ColorSpaceDeviceRGB);
         graphicsContext.fillPath();
         graphicsContext.restore();
 
diff --git a/WebKit2/WebProcess/WebPage/FindPageOverlay.cpp b/WebKit2/WebProcess/WebPage/FindPageOverlay.cpp
index d6fee6c..6af3cad 100644
--- a/WebKit2/WebProcess/WebPage/FindPageOverlay.cpp
+++ b/WebKit2/WebProcess/WebPage/FindPageOverlay.cpp
@@ -112,12 +112,12 @@ void FindPageOverlay::drawRect(GraphicsContext& graphicsContext, const IntRect&
     graphicsContext.setCompositeOperation(CompositeCopy);
 
     // Draw the background.
-    graphicsContext.fillRect(paintRect, overlayBackgroundColor(), sRGBColorSpace);
+    graphicsContext.fillRect(paintRect, overlayBackgroundColor(), ColorSpaceSRGB);
 
     graphicsContext.save();
-    graphicsContext.setShadow(FloatSize(shadowOffsetX, shadowOffsetY), shadowBlurRadius, Color::black, sRGBColorSpace);
+    graphicsContext.setShadow(FloatSize(shadowOffsetX, shadowOffsetY), shadowBlurRadius, Color::black, ColorSpaceSRGB);
 
-    graphicsContext.setFillColor(Color::white, sRGBColorSpace);
+    graphicsContext.setFillColor(Color::white, ColorSpaceSRGB);
 
     // Draw white frames around the holes.
     for (size_t i = 0; i < rects.size(); ++i) {
@@ -130,7 +130,7 @@ void FindPageOverlay::drawRect(GraphicsContext& graphicsContext, const IntRect&
     graphicsContext.restore();
 
     graphicsContext.save();
-    graphicsContext.setFillColor(Color::transparent, sRGBColorSpace);
+    graphicsContext.setFillColor(Color::transparent, ColorSpaceSRGB);
 
     // Clear out the holes.
     for (size_t i = 0; i < rects.size(); ++i)

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list