Closed Bug 296907 Opened 19 years ago Closed 19 years ago

fill/stroke shouldn't destroy path

Categories

(Core :: Graphics: Canvas2D, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: paper, Assigned: vlad)

Details

(Keywords: fixed1.8.0.1, fixed1.8.1)

Attachments

(1 file)

I should be able to build a nice path, then stroke and fill it.  Currently, if I
made a very complex path, I'd have to stroke it, then rebuild the same path,
then fill it.  That's a waste of CPU time.

The spec currently says

"Paths, when filled or stroked, are painted without affecting the current path,"

as well as (in bold italic green, I might add)

"The current path is persistent, and can only be reset using the beginPath()
method."
Now this bug is definitely valid IMHO.
well i would attach a patch, but after a system crash i have to set everything up again and i don't have much time so i don't know when i'll be ready. until then i'd love to see someone change

nsCanvasRenderingContext2D.cpp
line 1070
from
cairo_fill(mCairo);
to
cairo_fill_preserve(mCairo);
and line 1078
from
cairo_stroke(mCairo);
to cairo_stroke_preserve(mCairo);

thanks.

this really slows down my 3d engine... =)
Argh.. we couldn't fix this on the branch until we took the late update to cairo 1.0, and I forgot that this was still outstanding at that point.
Assignee: nobody → vladimir
Status: NEW → ASSIGNED
Attachment #201872 - Flags: review?(pavlov)
Attachment #201872 - Flags: review?(pavlov) → review+
Small patch that fixes spec compatability with <canvas>.  We couldn't do this before due to cairo, but it became possible once cairo 1.0 landed on the branch (at which point I promptly forgot that this was waiting on cairo 1.0, ugh.).  There are workarounds for this (drawing the path twice if someone wants to fill and stroke), so this can also wait for 1.8.1.
Flags: blocking1.8rc2?
-> 1.8.1
Flags: blocking1.8rc2? → blocking1.8.1?
Can I beg for this for any possible RC before 1.5? :]
Checked in on trunk; low risk patch for 1.8.0.1 and fixes canvas spec-compliance.
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Flags: blocking1.8.1? → blocking1.8.0.1?
Resolution: --- → FIXED
Attachment #201872 - Flags: approval1.8.1?
Attachment #201872 - Flags: approval1.8.0.1?
Flags: blocking1.8.1?
Flags: blocking1.8.1?
Flags: blocking1.8.1+
Flags: blocking1.8.0.1?
Flags: blocking1.8.0.1+
Comment on attachment 201872 [details] [diff] [review]
canvas-path-preserve.patch

a=dveditz for drivers
Attachment #201872 - Flags: approval1.8.1?
Attachment #201872 - Flags: approval1.8.1+
Attachment #201872 - Flags: approval1.8.0.1?
Attachment #201872 - Flags: approval1.8.0.1+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: