Closed Bug 1154318 Opened 10 years ago Closed 3 years ago

Clipping for canvas ignored if shadowBlur is set on context

Categories

(Core :: Graphics: Canvas2D, defect, P5)

37 Branch
x86
Windows 7
defect

Tracking

()

RESOLVED DUPLICATE of bug 1758968

People

(Reporter: jan.boesenberg, Assigned: vliu)

References

Details

(Keywords: regression, Whiteboard: [gfx-noted])

Attachments

(2 files)

User Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.118 Safari/537.36 Steps to reproduce: When setting a simple clipping region on a canvas context, the clipping is ignored for the following path if shadowBlur is set to a non-zero value. Here is a very simple JSFiddle to demonstrate the issue. http://jsfiddle.net/d8k83gLc/1/ Compare with Chrome/IE and optionally delete line 8 to see the difference between applying shadowBlur and no shadowBlur. Actual results: The clipping region is ignored, the whole rectangle is drawn. Expected results: The clipping region should be honred, only the part of the rectangle within the clip should be drawn.
Pushlog: https://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=badfce143136&tochange=74852f33ad9c Suspect: Bug 1082827 Set gfx.canvas.azure.backends = direct2d,skia,cairo in preferences helps
Blocks: 1082827
Status: UNCONFIRMED → NEW
Ever confirmed: true
Component: Untriaged → Canvas: 2D
Keywords: regression
Product: Firefox → Core
Whiteboard: [gfx-noted]
Supplement: Clip works if something is drawn before the shadow inside the current render cycle.
Jan, does this still reproduce for you? I can't reproduce this locally.
Flags: needinfo?(jan.boesenberg)
Flags: needinfo?(jan.boesenberg)
Sorry for clearing the ni? by accident. I can reproduce on my nightly build locally. I can take this bug to look into if there is any fix on it.
Assignee: nobody → vliu
(In reply to Vincent Liu[:vliu] from comment #4) > Sorry for clearing the ni? by accident. I can reproduce on my nightly build > locally. I can take this bug to look into if there is any fix on it. Thanks Vincent, I would appreciate you adding a minimized testcase to this bug which isn't linked to a third-party website if possible. Testcases which rely on a third-party tend to get lost to the sands of time. If it can be reduced to something that can be attached to this bug report that would be ideal.
Vincent, as an aside I am tentatively setting this to P5. If you think it's something you can fix before Firefox 52 goes to Aurora then please set it to P1, or P2 if you think it'll take another release cycle to fix. Thanks.
Status: NEW → ASSIGNED
Priority: -- → P5
Attached file test-case.html.html
(In reply to Anthony Hughes (:ashughes) [GFX][QA][Mentor] from comment #5) > (In reply to Vincent Liu[:vliu] from comment #4) > > Sorry for clearing the ni? by accident. I can reproduce on my nightly build > > locally. I can take this bug to look into if there is any fix on it. > > Thanks Vincent, I would appreciate you adding a minimized testcase to this > bug which isn't linked to a third-party website if possible. Testcases which > rely on a third-party tend to get lost to the sands of time. If it can be > reduced to something that can be attached to this bug report that would be > ideal. Put reproducible test case into attachment.
(In reply to Vincent Liu[:vliu] from comment #7) > Put reproducible test case into attachment. Thanks Vincent. Can you also please attach a screenshot comparing the expected and actual behaviour?
In this attachment you can find the actual and expected result.
Keywords: testcase-wanted
Thanks to Liviu to attach the actual and expected result. Yes, I saw the same actual result on Firefox and other expected result on other browser. Actually I tried to dig into the code into D2D to find out where to cause this problem happens but seems still not figuring it out. When DrawSurfaceWithShadow() was called in FillRect(), the image it caught has filtered out arc part. No obvious clue to show where to do that.
I suspect the reason is in DrawTargetD2D1::DrawSurfaceWithShadow. Probably DrawTargetD2D1::GetImageForSurface ignores the clip.
(In reply to Xidorn Quan [:xidorn] (UTC+10) from comment #11) > I suspect the reason is in DrawTargetD2D1::DrawSurfaceWithShadow. Probably > DrawTargetD2D1::GetImageForSurface ignores the clip. DrawTargetD2D1::GetImageForSurface only gets the image from SourceSurfaceD2D1. I don't see any extra code ruling out bitmap if shadowblur is set. [1]: https://dxr.mozilla.org/mozilla-central/source/gfx/2d/DrawTargetD2D1.cpp#1848
This is repros for me. https://jsfiddle.net/7j0cjv10/12/ Any ETA for the fix?
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: