WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
32346
SVG property -webkit-shadow should apply shadow on the result after compositing
https://bugs.webkit.org/show_bug.cgi?id=32346
Summary
SVG property -webkit-shadow should apply shadow on the result after compositing
Beth Dakin
Reported
2009-12-09 14:21:33 PST
* STEPS TO REPRODUCE 1. create an svg shape with stroke (preferably, thick stroke) and solid fill 2. apply -webkit-shadow on the <svg> container * RESULTS Currently, the shadows are applied seperately to the stroke and fill *EXPECTED RESULTS The shadow should apply to the composite of the stroke and fill <
rdar://problem/7389404
>
Attachments
Patch
(14.14 KB, patch)
2009-12-09 14:33 PST
,
Beth Dakin
no flags
Details
Formatted Diff
Diff
New patch
(14.36 KB, patch)
2009-12-09 19:16 PST
,
Beth Dakin
oliver
: review+
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Beth Dakin
Comment 1
2009-12-09 14:33:42 PST
Created
attachment 44563
[details]
Patch Patch!
mitz
Comment 2
2009-12-09 17:07:19 PST
Comment on
attachment 44563
[details]
Patch I wonder if this can’t be done more efficiently: 1) Clip to the bounding box (perhaps adjusted to encompass the shadow?) before beginning the transparency layer, to get the layer to have the optimal size (like we do for opacity) 2) If we have both opacity and a shadow, use a single transparency layer for both (perhaps requires multiplying the shadow’s alpha by the opacity?)
Beth Dakin
Comment 3
2009-12-09 19:16:09 PST
Created
attachment 44589
[details]
New patch Here's a new patch that addresses Dan's comments. I clipped the transparency layer to the size of the shadow, but I was not able to use a single transparency layer for both opacity and shadows. When I tried to use a single layer, the color of the shadow (which *was* at the correct alpha level) was visible behind the partially-transparent fill color. This seems wrong since it is not the behavior of box-shadow.
WebKit Review Bot
Comment 4
2009-12-09 19:20:59 PST
style-queue ran check-webkit-style on
attachment 44589
[details]
without any errors.
Beth Dakin
Comment 5
2009-12-09 22:08:12 PST
Fixed with
r51936
.
Dirk Schulze
Comment 6
2009-12-11 03:08:55 PST
***
Bug 30930
has been marked as a duplicate of this bug. ***
Dirk Schulze
Comment 7
2009-12-11 04:05:02 PST
Just noticed, that this patch does not fix the shadow problem on Gtk.
Beth Dakin
Comment 8
2009-12-11 11:46:03 PST
In the CG, transparency layers specifically apply to shadows. The CG documentation says: "After the transparency layer is ended, the result is composited into the context using the global alpha and shadow state of the context. " My guess is that the same is not true for the GTK-equivalent. We may need a fancier solution there.
Dirk Schulze
Comment 9
2009-12-11 12:47:24 PST
(In reply to
comment #8
)
> In the CG, transparency layers specifically apply to shadows. The CG > documentation says: > > "After the transparency layer is ended, the result is composited into the > context using the global alpha and shadow state of the context. " > > My guess is that the same is not true for the GTK-equivalent. We may need a > fancier solution there.
On Gtk we draw the shadow just a moment before we have a drawing operation (fillPath, strokePath, drawPath, drawImage, drawLine, ...) independent of the transparency layer. A partly fix would be to solve
bug 6564
and use drawPath to draw the stroke and fill at once. This won't fix shadows on stroked/filled texts and stroked images on SVG. I think Qt has the same problem and I don't know how the shadow system of Skia works.
Dirk Schulze
Comment 10
2009-12-15 08:59:15 PST
T(In reply to
comment #3
)
> Created an attachment (id=44589) [details] > New patch
The patch is responsible for a regression on svg/filters/shadow-on-rect-with-filter.svg.
Beth Dakin
Comment 11
2009-12-15 14:57:48 PST
Oh no! I see it now. The test fails in the pixel test only. Looks like the bounding box is clipping away far too much here. opacity has the same problem actually; in other words, if you replace the shadow style in that test case with "opacity: 0.5," we clip too much in the same way. This deserves a new bug report, especially since it is not unique to this patch or shadows. Filing one now.
Beth Dakin
Comment 12
2009-12-15 15:02:15 PST
Filed
https://bugs.webkit.org/show_bug.cgi?id=32584
Eric Seidel (no email)
Comment 13
2009-12-28 22:42:11 PST
Attachment 44589
[details]
was posted by a committer and has review+, assigning to Beth Dakin for commit.
Eric Seidel (no email)
Comment 14
2009-12-28 23:32:23 PST
Looks like this was already landed as
r51936
.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug