| Summary: | [CoordinatedGraphics] Issue with shadow rendering for image elements | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | ujwal koneru <ujwal.koneru> |
| Component: | Images | Assignee: | ujwal koneru <ujwal.koneru> |
| Status: | RESOLVED DUPLICATE | ||
| Severity: | Normal | CC: | Hironori.Fujii, kkinnunen, sabouhallawa, simon.fraser, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Other | ||
| OS: | Linux | ||
| Attachments: | |||
Comment on attachment 451940 [details] Drop shadow clips shadow to image element. ><!DOCTYPE html> ><html><head> > <title>dropshadow test</title> > </head> ><body> > <div style="margin-left: 150px; margin-top: 360px"> > <img src="https://i.imgur.com/L9YCQmk.png" style="width: 175px; margin: 15px; filter:drop-shadow(20px 20px 30px blue) ;"> > </div> ></body></html> Created attachment 451942 [details]
drop shadow test clipping.
test case
Created attachment 452314 [details]
current output
current output where shadows are clipped.
Created attachment 452316 [details] Output when full layer is copied by the tilerect Changed rect.intersect to rect.unite to render full layer at https://github.com/WebKit/WebKit/blob/7f1c2ffe6a36cedde507edc54311e7a8fcde50d9/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp#L678 This shows the paint finished the shadow but the updaterect on tile(https://github.com/WebKit/WebKit/blob/7f1c2ffe6a36cedde507edc54311e7a8fcde50d9/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp#L1169) does not consider the outsets/visual overflow of the filter. The block artifact of the shadow is a secondary issue that is patched at https://bugs.webkit.org/show_bug.cgi?id=236407 Created attachment 452320 [details] [screenshot] Safari Technology Preview 140 I'm observing an issue with Safari Technology Preview 140. 1. Start STP 2. Menu > Safari Technology Preview > Clear History... > Clear History 3. Load https://bugs.webkit.org/attachment.cgi?id=451942 I think there are two problems here. 1. No shadow issue I think this is Coordinated Graphics specific bug. It can be reprocuded with GTK and PlayStation ports. 2. Clipped shadow issue I think this is WebKit common bug. (In reply to Fujii Hironori from comment #6) > 2. Clipped shadow issue > I think this is WebKit common bug. Filed another bug ticket for this. Bug 236758 – img element with drop-shadow filter doesn't repaint correctly on loading the image Created attachment 452383 [details]
shadows third issue when blur radius is less than offset.
Thanks Fujii-san.
I see a third issue when blur radius is less than xoff/yoffsets. At the tile boundary, we are missing the shadow. This is closely related to (1) above and I think also an coordinated graphics issue.
Created attachment 452384 [details]
shadows not rendered on tile edge, when full layer is rendered
This might need a new bug since the source dirty rect of the tile has shadow missing unlike original issue. (paint missed shadow on tile edges(?), even though when I dump shadow rects at \platform\graphics\filters\software, seems to have complete shadow size.)
Good catch. Filed: Bug 236800 – drop-shadow filter doesn't work correctly in tiled backing layer Rootcaused the issue to missing set on 'hassoftwarefilter' flag. Renderview has a flag to trigger correct dirty rect calculation at https://github.com/WebKit/WebKit/blob/388a2cb6b11b3c27af168a286fc4c6f16baeb505/Source/WebCore/rendering/RenderObject.cpp#L866 when the container is created. However the flag has to be set every time a software filter is used. I suspect apple is not seeing this because filters are accelerated/coreimage flags trigger a correct repaint rect. When accelerated/non-accelerated filter determination is made for the layer, should set https://github.com/WebKit/WebKit/blob/76f8900db60ddf7e2690c37d6b7535e86f9e374e/Source/WebCore/rendering/RenderLayer.cpp#L5736 +renderer().view().setHasSoftwareFilters(!renderer().page().acceleratedFiltersEnabled()); Will open a PR. Created attachment 462828 [details]
test case 2
204269@main (bug#189248) removed setHasSoftwareFilters calling code without a change log description. *** This bug has been marked as a duplicate of bug 236758 *** Oops. wrong bug id. *** This bug has been marked as a duplicate of bug 118411 *** |
Created attachment 451940 [details] Drop shadow clips shadow to image element. When shadows are rendered for an image element, shadows are clipped to the image element size. Debug shows the layer does render the shadow but final tiles are not updated since the rect is clipped to the image element size. Observed this on BSDunix/playstation. unsure on other platforms.