Commit 2f1d5352 authored by krit@webkit.org's avatar krit@webkit.org
Browse files

2010-10-20 Dirk Schulze <krit@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@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@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@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@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
parent a097888f
2010-10-20 Dirk Schulze <krit@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@webkit.org>
 
Reviewed by Andreas Kling.
......@@ -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;
}
}
......
......@@ -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;
......
......@@ -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);
......
......@@ -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);
}
}
}
......
......@@ -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());
}
......
......@@ -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;
}
......
......@@ -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()));
}
......
......@@ -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));
......
......@@ -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));
......
......@@ -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());
......
......@@ -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());
......
......@@ -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;
......
......@@ -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();
......
......@@ -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)
......
......@@ -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; }
......
......@@ -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);
}
}
......@@ -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();