Closed Bug 771853 Opened 13 years ago Closed 10 years ago

Path get cleared after strokeText function is called

Categories

(Core :: Graphics: Canvas2D, defect)

12 Branch
x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: kcleung88, Assigned: eflores)

References

Details

(Keywords: regression)

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 5.1; rv:13.0) Gecko/20100101 Firefox/13.0.1 Build ID: 20120614114901 Steps to reproduce: var context=document.getElementById('myCanvas').getContext('2d'); context.moveTo(148,93); context.lineTo(531,280); context.strokeText("abc",192,177); context.stroke(); Actual results: The path : context.moveTo(148,93); context.lineTo(531,280); is not shown in FireFox. Expected results: The path : context.moveTo(148,93); context.lineTo(531,280); is shown in other browsers
Works fine for me on Mac. Is this Windows-only? Would you mind attaching the complete testcase that shows the problem for you?
Attached file html
I can reproduce the problem with HWA disabled. however It works fine with HWA enabled. Regression window(m-c) Good: http://hg.mozilla.org/mozilla-central/rev/7cdb5f5d38c6 Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0a1) Gecko/20120126 Firefox/12.0a1 ID:20120126093130 Bad: http://hg.mozilla.org/mozilla-central/rev/a82c9700c673 Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0a1) Gecko/20120126 Firefox/12.0a1 ID:20120126151450 Pushlog: http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=7cdb5f5d38c6&tochange=a82c9700c673 Regression window(m-c) Good: http://hg.mozilla.org/integration/mozilla-inbound/rev/ba57f7b6a2f3 Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0a1) Gecko/20120126 Firefox/12.0a1 ID:20120126040148 Bad: http://hg.mozilla.org/integration/mozilla-inbound/rev/9b70467dfec0 Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0a1) Gecko/20120125 Firefox/12.0a1 ID:20120126051451 Pushlog: http://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=ba57f7b6a2f3&tochange=9b70467dfec0 Triggered by: eba8a5ac183f Edwin Flores — Bug 710521 - Refactor gfxFont to separate out drawing stroke and drawing to path. r=roc
Blocks: 710521
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: regression
Version: 13 Branch → 12 Branch
Edwin, can you take a look at this?
In particular, the patch in question changed the non-Azure 2d context but didn't change the Azure one. So I bet the difference is not HWA vs not but Azure context vs not. And in particular, the Flush() method in that patch does this: + if (aDrawMode & gfxFont::GLYPH_STROKE) { + cairo_new_path(aCR); + cairo_glyph_path(aCR, mGlyphBuffer, mNumGlyphs); + cairo_stroke(aCR); which nukes any existing path on aCR. The canvas code _used_ to work around that with the pathSR.Save() bit right before it used to call mThebes->NewPath(), but that went away in the patch. I bet just putting it back in the stroke case will fix this.
Is this bug still an issue? Code has been refactored a reasonable amount since.
(In reply to John Drinkwater (:beta) from comment #5) > Is this bug still an issue? Code has been refactored a reasonable amount > since. Attached test case WFM.
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: