Changeset 96470 in webkit
- Timestamp:
- Oct 2, 2011 12:15:08 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r96469 r96470 1 2011-10-02 Dirk Schulze <krit@webkit.org> 2 3 SVG Mask should take 'color-interpolation' into account to determine the color space of the mask image 4 https://bugs.webkit.org/show_bug.cgi?id=69076 5 6 Reviewed by Simon Fraser. 7 8 Added a new test case to check the behavior of SVG Masks on different values for the 'color-interpolation' property. 9 Since the default color space of the mask image changes from linearRGB to sRGB, a test needed an update. 10 11 * platform/mac/svg/custom/grayscale-gradient-mask-2-expected.png: Added. 12 * platform/mac/svg/custom/grayscale-gradient-mask-2-expected.txt: Added. 13 * platform/mac/svg/custom/grayscale-gradient-mask-expected.png: 14 * platform/mac/svg/custom/grayscale-gradient-mask-expected.txt: 15 * svg/custom/grayscale-gradient-mask-2.svg: Added. 16 1 17 2011-10-01 Adam Barth <abarth@webkit.org> 2 18 -
trunk/Source/WebCore/ChangeLog
r96467 r96470 1 2011-10-02 Dirk Schulze <krit@webkit.org> 2 3 SVG Mask should take 'color-interpolation' into account to determine the color space of the mask image 4 https://bugs.webkit.org/show_bug.cgi?id=69076 5 6 Reviewed by Simon Fraser. 7 8 SVG Masks should take 'color-interpolation' into account to determine the color space of the mask image. 9 The behavior was changed in SVG 1.1 SE. The color space of the mask image gets defined by the computed value of the 10 'color-interpolation' property. This will switch the default color space from linearRGB to sRGB for mask images and 11 is a performance improvement for platforms without native support for linearRGB color space. The 12 color space transformation can be avoided. 13 14 Test: svg/custom/grayscale-gradient-mask-2.svg 15 16 * rendering/svg/RenderSVGResourceMasker.cpp: 17 (WebCore::RenderSVGResourceMasker::applyResource): 18 (WebCore::RenderSVGResourceMasker::drawContentIntoMaskImage): 19 * rendering/svg/RenderSVGResourceMasker.h: 20 1 21 2011-10-01 Vangelis Kokkevis <vangelis@chromium.org> 2 22 -
trunk/Source/WebCore/rendering/svg/RenderSVGResourceMasker.cpp
r96155 r96470 107 107 return false; 108 108 109 if (!SVGImageBufferTools::createImageBuffer(absoluteTargetRect, clampedAbsoluteTargetRect, maskerData->maskImage, ColorSpaceLinearRGB)) 109 ASSERT(style()); 110 const SVGRenderStyle* svgStyle = style()->svgStyle(); 111 ASSERT(svgStyle); 112 ColorSpace colorSpace = svgStyle->colorInterpolation() == CI_LINEARRGB ? ColorSpaceLinearRGB : ColorSpaceDeviceRGB; 113 if (!SVGImageBufferTools::createImageBuffer(absoluteTargetRect, clampedAbsoluteTargetRect, maskerData->maskImage, colorSpace)) 110 114 return false; 111 115 … … 118 122 maskImageContext->concatCTM(absoluteTransform); 119 123 120 drawContentIntoMaskImage(maskerData, maskElement, object);124 drawContentIntoMaskImage(maskerData, colorSpace, maskElement, object); 121 125 } 122 126 … … 128 132 } 129 133 130 void RenderSVGResourceMasker::drawContentIntoMaskImage(MaskerData* maskerData, const SVGMaskElement* maskElement, RenderObject* object)134 void RenderSVGResourceMasker::drawContentIntoMaskImage(MaskerData* maskerData, ColorSpace colorSpace, const SVGMaskElement* maskElement, RenderObject* object) 131 135 { 132 136 GraphicsContext* maskImageContext = maskerData->maskImage->context(); … … 156 160 157 161 #if !USE(CG) 158 maskerData->maskImage->transformColorSpace(ColorSpaceDeviceRGB, ColorSpaceLinearRGB); 162 maskerData->maskImage->transformColorSpace(ColorSpaceDeviceRGB, colorSpace); 163 #else 164 UNUSED_PARAM(colorSpace); 159 165 #endif 160 166 -
trunk/Source/WebCore/rendering/svg/RenderSVGResourceMasker.h
r95901 r96470 58 58 59 59 private: 60 void drawContentIntoMaskImage(MaskerData*, const SVGMaskElement*, RenderObject*);60 void drawContentIntoMaskImage(MaskerData*, ColorSpace, const SVGMaskElement*, RenderObject*); 61 61 void calculateMaskContentRepaintRect(); 62 62
Note: See TracChangeset
for help on using the changeset viewer.