Closed
Bug 503283
Opened 15 years ago
Closed 14 years ago
"unbounded" globalCompositeOperations are terribly broken
Categories
(Core :: Graphics: Canvas2D, defect)
Tracking
()
RESOLVED
FIXED
Tracking | Status | |
---|---|---|
status1.9.1 | --- | ? |
People
(Reporter: emk, Assigned: emk)
References
()
Details
(Keywords: regression)
Attachments
(2 files, 1 obsolete file)
(deleted),
text/html
|
Details | |
(deleted),
patch
|
Details | Diff | Splinter Review |
Build ID:
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2a1pre) Gecko/20090708 Minefield/3.6a1pre
Steps to reproduce:
See the above URL.
Actual result:
source-in, source-out, destination-in, and destination-atop are not rendered at all.
Expected result:
Some sort of composition result should be rendered.
Fx 3.5 (Mozilla/5.0 (Windows; U; Windows NT 5.1; ja; rv:1.9.1) Gecko/20090624 Firefox/3.5) also fails. Fx 3.0.11 (Mozilla/5.0 (Windows; U; Windows NT 5.1; ja; rv:1.9.0.11) Gecko/2009060215 Firefox/3.0.11) seems to work.
Flags: wanted1.9.1.x?
Assignee | ||
Comment 1•15 years ago
|
||
Another failing example:
http://uupaa-js-spinoff.googlecode.com/svn/trunk/uuCanvas.js/demo1/5_1_canvas_savestate+shadow.html
Assignee | ||
Comment 2•15 years ago
|
||
http://hg.mozilla.org/mozilla-central/rev/dcec193ba5d7 (20081105): works
http://hg.mozilla.org/mozilla-central/rev/f3993df71c29 (20081106): broken
Keywords: regression
Assignee | ||
Comment 3•15 years ago
|
||
pushlog in regression range:
http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=dcec193ba5d7&tochange=f3993df71c29
regression from bug 462938?
Blocks: 462938
Comment 4•15 years ago
|
||
drawImage() or shadows cause this problem.
# fill() or stroke() look OK.
I attached modified version (using fill()) of "URL" testcase.
That doesn't cause the problem.
Comment 5•15 years ago
|
||
Oops, I attached shadow testcase!
This one uses fill().
Comment 6•15 years ago
|
||
Comment on attachment 387637 [details]
testcase using drawImage() and shadow (broken)
This uses shadow not fill()
Attachment #387637 -
Attachment description: testcase using fill() (not broken) → testcase using shadow (broken)
Assignee | ||
Comment 7•15 years ago
|
||
Comment #1 seems to be a different problem.
2007072505 not rendered at all (me.mozDrawText is not a function)
2007072517 cvs trunk: works
2008022002 mozilla-central: not rendered at all (ctx.fillText is not a function)
2008022005 cvs trunk: works
2008052006 cvs trunk: works
2008052103 mozilla-central: not rendered at all
2008061012 mozilla-central: not rendered at all
2008061107 mozilla-central: broken
I was unable to spot a regression range due to mercurial transition...
Comment 8•15 years ago
|
||
Sorry, I confused a bit...
drawImage() causes the problem.
shadows does not cause the problem.
(In reply to comment #1)
> Another failing example:
> http://uupaa-js-spinoff.googlecode.com/svn/trunk/uuCanvas.js/demo1/5_1_canvas_savestate+shadow.html
This is not failed.
http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-globalcompositeoperation
> source-out
> A out B. Display the source image wherever the source image is opaque and the destination image is transparent. Display transparency elsewhere.
Both "green shadow" and "red shadow" are rendered twice, but first one of them are cleared when rendering "blue shadow".
Updated•15 years ago
|
Attachment #387637 -
Attachment description: testcase using shadow (broken) → testcase using drawImage() and shadow (broken)
Attachment #387637 -
Attachment is obsolete: true
Assignee | ||
Comment 9•15 years ago
|
||
(In reply to comment #8)
> Both "green shadow" and "red shadow" are rendered twice, but first one of them
> are cleared when rendering "blue shadow".
All other browsers (Opera 9, Safari 4, Chrome 2, and even Fx3) doesn't clear the first "green shadow" and "red shadow". Is it an incorrect behaviour per spec?
Comment 10•15 years ago
|
||
(In reply to comment #9)
> (In reply to comment #8)
> > Both "green shadow" and "red shadow" are rendered twice, but first one of them
> > are cleared when rendering "blue shadow".
> All other browsers (Opera 9, Safari 4, Chrome 2, and even Fx3) doesn't clear
> the first "green shadow" and "red shadow". Is it an incorrect behaviour per
> spec?
In these browsers source-in, source-out,... operators are "bounded".
# ... Display transparency elsewhere covered by the source image.
But after bug 462938 (cairo 1.8.x?) these are "unbounded".
# ... Display transparency elsewhere.
http://cairographics.org/operators/
Assignee | ||
Comment 11•15 years ago
|
||
I found SVG Compositing calls them as clip-to-self property.
http://www.w3.org/TR/SVGCompositing/#clip-to-self
However, even if the operators are "unbounded", the "URL" testcase doesn't look correct to me.
If the operaters are "unbounded", It should get the similar result as Opera.
http://d.hatena.ne.jp/chaperatta/20080614/1213454680
Comment 12•15 years ago
|
||
(In reply to comment #11)
> However, even if the operators are "unbounded", the "URL" testcase doesn't look
> correct to me.
> If the operaters are "unbounded", It should get the similar result as Opera.
> http://d.hatena.ne.jp/chaperatta/20080614/1213454680
Yes. The "URL" testcase doesn't work well for Firefox 3.5 and later.
It uses drawImage() (source is an image) and drawImage() seems cause this problem.
#
# The testcase I attached uses fill() (source is a path) and its result seems OK.
# -> It seems like the cause of this bug is the handling of images.
Assignee | ||
Comment 13•15 years ago
|
||
nsCanvasRenderingContext2D::DrawImage() calls UpdateSurfaceClip()
http://hg.mozilla.org/releases/mozilla-1.9.1/annotate/f223409207c0/content/canvas/src/nsCanvasRenderingContext2D.cpp#l2983
which trys to fill the empty rect.
http://hg.mozilla.org/releases/mozilla-1.9.1/annotate/f223409207c0/gfx/thebes/src/gfxContext.cpp#l627
Then the entire canvas will be cleared out because the operator is "unbounded".
Assignee | ||
Comment 14•15 years ago
|
||
- // XXX cairo bug workaround; force a clip update on mThebes.
This workaround is now useless or even harmful. Bug 346421 and bug 347379 didn't regress.
- // XXX certain operators cause 2d.composite.uncovered.* tests to fail
I don't know the exact reason why OperatorAffectsUncoveredAreas was temporarily disabled, but 2d.composite.uncovered.* tests failed without enabling it (as the comment indicates).
Assignee | ||
Updated•15 years ago
|
Summary: Some globalCompositeOperation are terribly broken → "unbounded" globalCompositeOperations are terribly broken
Updated•15 years ago
|
status1.9.1:
--- → ?
Flags: wanted1.9.1.x?
Assignee | ||
Comment 15•14 years ago
|
||
Fixed by bug 599698 and bug 600120.
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 16•14 years ago
|
||
Comment on attachment 388920 [details] [diff] [review]
remove old workarounds
Canceling review request of an obsolete patch.
Attachment #388920 -
Flags: review?(vladimir)
You need to log in
before you can comment on or make changes to this bug.
Description
•