WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
58100
1px box-shadow looks ugly
https://bugs.webkit.org/show_bug.cgi?id=58100
Summary
1px box-shadow looks ugly
Simon Fraser (smfr)
Reported
2011-04-07 17:16:31 PDT
Box-shadow with a 1px blur radius looks ugly, and rather different from a CG 1-px shadow.
Attachments
Testcase
(269 bytes, text/html)
2011-04-07 17:16 PDT
,
Simon Fraser (smfr)
no flags
Details
Patch
(24.62 KB, patch)
2011-04-28 12:45 PDT
,
Simon Fraser (smfr)
krit
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Simon Fraser (smfr)
Comment 1
2011-04-07 17:16:45 PDT
Created
attachment 88740
[details]
Testcase
Martin Robinson
Comment 2
2011-04-08 09:22:17 PDT
I wonder if this is due to the fact that ShadowBlur/ContextShadow does not yet support fractional blur radii.
Simon Fraser (smfr)
Comment 3
2011-04-27 12:02:50 PDT
I'm sure it is.
Simon Fraser (smfr)
Comment 4
2011-04-27 12:55:37 PDT
<
rdar://problem/9076329
>
Simon Fraser (smfr)
Comment 5
2011-04-27 14:06:22 PDT
The code is buggy for 1px radii. For an input of: 000 000 000 000 000 000 255 255 255 000 000 255 255 255 000 000 255 255 255 000 000 255 255 255 000 000 255 255 255 000 000 255 255 255 000 000 255 255 255 000 000 000 000 000 000 the results are 043 070 088 079 061 069 112 141 127 098 096 154 194 175 135 105 169 212 191 148 105 169 212 191 148 105 169 212 191 148 096 154 194 175 135 078 126 159 143 111 060 098 123 111 086 which is not symmetrical. For radii >=2 this problem does not happen.
Dirk Schulze
Comment 6
2011-04-27 20:11:20 PDT
I could compare the both shadows (ContextShadow and ShadowBlur) and the result of ContextShadow looked more sane. It also did not have big problems with 0-1px shadows. Is there a difference in the implementation?
Simon Fraser (smfr)
Comment 7
2011-04-28 09:53:10 PDT
Context Shadows's code gives: Blur source: 000 000 000 000 000 000 255 255 255 000 000 255 255 255 000 000 255 255 255 000 000 255 255 255 000 000 255 255 255 000 000 255 255 255 000 000 255 255 255 000 000 000 000 000 000 Blur result: 086 111 123 098 060 111 143 159 126 078 135 175 194 154 096 148 191 212 169 105 148 191 212 169 105 148 191 212 169 105 135 175 194 154 096 098 127 141 112 069 061 079 088 070 043 which is still incorrect, but different (not sure why).
Simon Fraser (smfr)
Comment 8
2011-04-28 10:51:46 PDT
If I add 1px of padding so that the edge alpha is always zero, the issue goes away. I'll do that.
Simon Fraser (smfr)
Comment 9
2011-04-28 12:45:31 PDT
Created
attachment 91539
[details]
Patch
Dirk Schulze
Comment 10
2011-04-28 20:35:11 PDT
Comment on
attachment 91539
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=91539&action=review
Can you please check if the pixel results for feDropShadow changed (they should) and update them? They are located at LayoutTests/svg/filter/feDropShadow.svg and LayoutTests/dynamic-updates/ r- for the test and the and the missing result updates. The fix itself looks good to me. If I should be wrong with tests just add a comment.
> LayoutTests/fast/box-shadow/single-pixel-shadow.html:15 > + -webkit-transform-origin: -1px -1px; > + -webkit-transform: scale(20);
Do you really want a pixelation here? On SVG we try to avoid this and transform all affected objects to devicespace and apply shadows afterwards. So we always have a goof looking shadow. This definitely does not belong to this big. But if it gets changed in the future, the text would be useless. Have you checked what Firefox or Opera are doing? But I don't have an idea how to make a pixel with it. What about canvas? Is canvas using shadow? If you draw a shadow on canvas it should be pixelated on scaling, also in the future, no?
Dirk Schulze
Comment 11
2011-04-28 20:48:54 PDT
Comment on
attachment 91539
[details]
Patch Talked with Simon on IRC. We don't see a way to have constant results on shadows across platforms as long as not all platforms are using ShadowBlur. Even if we get resolution independent shadows, we should see if the shadow is broken, since the shadow radius gets scaled as well. Simon updates filter results on landing.
Simon Fraser (smfr)
Comment 12
2011-04-28 21:08:00 PDT
http://trac.webkit.org/changeset/85299
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