Bug 27844

Summary: SVG Filter and linearRGB, sRGB platform support
Product: WebKit Reporter: Dirk Schulze <krit>
Component: SVGAssignee: Dirk Schulze <krit>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, ariya.hidayat, dglazkov, jeffschiller, oliver
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: OS X 10.5   
Bug Depends on:    
Bug Blocks: 68469, 6033, 26389    
Attachments:
Description Flags
linearRGB, sRGB support for platforms
oliver: review+
linearRGB, sRGB support for platforms (without code duplication)
oliver: review+
linearRGB, sRGB support for platforms (without code duplication) none

Description Dirk Schulze 2009-07-30 11:34:23 PDT
We need at least support for linearRGB and sRGB on platforms to change the color space on SVG Filters.
Comment 1 Dirk Schulze 2009-07-30 11:45:52 PDT
Created attachment 33796 [details]
linearRGB, sRGB support for platforms

This is an inital patch to add support of linearRGB as well as sRGB. It uses the native version of color space transformations from platforms if available.
Comment 2 Eric Seidel (no email) 2009-07-31 15:15:10 PDT
Comment on attachment 33796 [details]
linearRGB, sRGB support for platforms

I'm not sure this is the right colorspace abstraction.  it seems very specific to images, where it should probably be based off of another colorspace or Color class in platform.  See bug 20558.
Comment 3 Oliver Hunt 2009-07-31 16:14:25 PDT
Comment on attachment 33796 [details]
linearRGB, sRGB support for platforms

> +void ImageBuffer::transformColorSpace(ImageColorSpace srcColorSpace, ImageColorSpace dstColorSpace)
> +{
...
> +    if (dstColorSpace == LinearRGB) {
> +        if (m_linearRgbLUT.isEmpty()) {
...
> +        lookUpTable = m_linearRgbLUT;
> +    }
> +    if (dstColorSpace == DeviceRGB) {
...
> +    }
should be 'else if' here

> +        case LinearRGB:
> +			colorSpace = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGBLinear);
indenting :D

I share eric's concern about the placement of the colour matching logic -- logically it should be in GraphicsContext, but i don't think it's feasible to do the required logic to ensure that behaviour is correct outside of the underlying graphics library so this placement seems the only place it can really go for now.
Comment 4 Adam Barth 2009-07-31 22:07:09 PDT
Assigning to Dirk for landing.
Comment 5 Dirk Schulze 2009-08-03 12:02:41 PDT
Created attachment 33994 [details]
linearRGB, sRGB support for platforms (without code duplication)

same code as above, moved the calculation of the lut's into a new file ImageBuffer.cpp
Comment 6 Oliver Hunt 2009-08-03 12:09:32 PDT
Comment on attachment 33994 [details]
linearRGB, sRGB support for platforms (without code duplication)

r=me fix the tabs
Comment 7 Dirk Schulze 2009-08-03 12:16:37 PDT
Created attachment 33996 [details]
linearRGB, sRGB support for platforms (without code duplication)

(no tabs)
Comment 8 Dirk Schulze 2009-08-04 11:08:39 PDT
I'll upload the patch as soon as possible. run-webkit-test is not working for me at the moment and I don't want to upload untested (by layouttests) patches to the tree.
Comment 9 Dirk Schulze 2009-08-08 13:03:24 PDT
landed in r46956.
Comment 10 Dimitri Glazkov (Google) 2009-08-08 18:32:15 PDT
Chromium build fix landed as http://trac.webkit.org/changeset/46961.