Bug 4463

Summary: SVG transparency applied twice
Product: WebKit Reporter: Tobias Lidskog <tobiaslidskog>
Component: SVGAssignee: Tobias Lidskog <tobiaslidskog>
Status: RESOLVED FIXED    
Severity: Major    
Priority: P2    
Version: 420+   
Hardware: Mac   
OS: OS X 10.4   
Attachments:
Description Flags
fix opacity handling
eric: review+
before patch
none
after patch
none
reference png none

Description Tobias Lidskog 2005-08-16 17:49:40 PDT
Opacity values on groups gets applied twice while drawing (as seen in the masking-opacity-01-b.svg 
test). In KRenderingPaintServerSolidQuartz::draw CGContextSetAlpha() is called in applyStyleToContext(), 
after that the same alpha is used in CGColorCreateCopyWithAlpha().
Comment 1 Tobias Lidskog 2005-08-16 17:50:37 PDT
I'll try and come up with a good solution to this.
Comment 2 Tobias Lidskog 2005-08-17 16:12:15 PDT
Created attachment 3444 [details]
fix opacity handling

Group opacity was being applied twice for fills and strokes. Also remove
opacity() method on KRenderingPaintServerSolid that wasn't useful. Colors in
svg are always rgb only, opacity is specified separately.
Comment 3 Tobias Lidskog 2005-08-17 16:13:34 PDT
Created attachment 3445 [details]
before patch

rendering of masking-opacity-01-b before patch
Comment 4 Tobias Lidskog 2005-08-17 16:14:08 PDT
Created attachment 3446 [details]
after patch

rendering of masking-opacity-01-b after patch
Comment 5 Tobias Lidskog 2005-08-17 16:14:40 PDT
Created attachment 3447 [details]
reference png

reference rendering from w3c
Comment 6 Eric Seidel (no email) 2005-08-22 02:32:41 PDT
Comment on attachment 3444 [details]
fix opacity handling

Looks good.