Closed Bug 768067 Opened 12 years ago Closed 11 years ago

Implement canvasRenderingContext2D.get/setLineDash

Categories

(Core :: Graphics: Canvas2D, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla27
Tracking Status
relnote-firefox --- 27+

People

(Reporter: peterv, Assigned: cabanier)

References

(Blocks 1 open bug, )

Details

(Keywords: dev-doc-complete, html5, Whiteboard: [parity with Safari, Chrome and IE])

Attachments

(2 files, 5 obsolete files)

      No description provided.
Attached patch canvaslinedash.patch (obsolete) — Splinter Review
Attachment #813352 - Attachment is obsolete: true
Attachment #813353 - Attachment is obsolete: true
Attachment #813354 - Flags: review?(roc)
Not sure about removing the moz methods. That would break current sites...
Assignee: nobody → cabanier
Whiteboard: [parity with Safari, Chrome and IE]
Attachment #813354 - Flags: review?(roc) → review?(bas)
Attachment #815180 - Flags: review?(bas)
Attachment #813354 - Attachment is obsolete: true
Attachment #813354 - Flags: review?(bas)
This Bug 768067, Bug 740284, Bug 683051 and Bug 809586 seem to overlap at least in part. Can somebody with the necessary knowledge (and privs) please clean up/merge and clarify the individual bugs & summaries?
Comment on attachment 815180 [details] [diff] [review]
Add support for set/getLineDash and dash offset

Review of attachment 815180 [details] [diff] [review]:
-----------------------------------------------------------------

::: content/canvas/src/CanvasRenderingContext2D.cpp
@@ +2856,5 @@
> +CanvasRenderingContext2D::SetLineDash(const mozilla::dom::AutoSequence<double>& mSegments) {
> +  FallibleTArray<mozilla::gfx::Float>& dash = CurrentState().dash;
> +  dash.Clear();
> +
> +  for(mozilla::dom::AutoSequence<double>::index_type x = 0; x < mSegments.Length(); x++) {

uint32_t type for 'x'.

@@ +2859,5 @@
> +
> +  for(mozilla::dom::AutoSequence<double>::index_type x = 0; x < mSegments.Length(); x++) {
> +    dash.AppendElement(mSegments[x]);
> +  }
> +  if(mSegments.Length()%2) { // If the number of elements is odd, concatenate again

Sapace after 'if' and 'for'.

@@ +2867,5 @@
> +  }
> +}
> +
> +void
> +CanvasRenderingContext2D::GetLineDash(nsTArray<double>& mSegments) const {

This parameter should be called aSegments

@@ +2871,5 @@
> +CanvasRenderingContext2D::GetLineDash(nsTArray<double>& mSegments) const {
> +  const FallibleTArray<mozilla::gfx::Float>& dash = CurrentState().dash;
> +  mSegments.Clear();
> +
> +  for(FallibleTArray<mozilla::gfx::Float>::index_type x = 0; x < dash.Length(); x++) {

Space after 'for'.

Also, you can make x 'uint32_t'. Easier to read.
Attachment #815180 - Flags: review?(bas) → review+
Attachment #815180 - Attachment is obsolete: true
Updated patch per roc's comments.
Try server: https://tbpl.mozilla.org/?tree=Try&rev=e6dd13184378
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/b16182c733bb
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla27
(In reply to Rik Cabanier from comment #10)
> Updated patch per roc's comments.

The comments were not addressed.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
(In reply to :Ms2ger from comment #14)
> (In reply to Rik Cabanier from comment #10)
> > Updated patch per roc's comments.
> 
> The comments were not addressed.

I must have copied the wrong patch :-(
Will fix this asap
Attached patch Fix style (obsolete) — Splinter Review
Attachment #823033 - Flags: review?(Ms2ger)
Attachment #823033 - Attachment is obsolete: true
Attachment #823033 - Flags: review?(Ms2ger)
Attachment #823037 - Flags: review?(Ms2ger)
Comment on attachment 823037 [details] [diff] [review]
Fix incorrect style

Review of attachment 823037 [details] [diff] [review]:
-----------------------------------------------------------------

This is r=roc in comment 8.
Attachment #823037 - Flags: review?(Ms2ger)
Keywords: checkin-needed
Blocks: 931643
Summary: Implement canvasRenderingContext2D.get/setLineDash and deprecate/remove mozDash → Implement canvasRenderingContext2D.get/setLineDash
https://hg.mozilla.org/mozilla-central/rev/222175ec725f
Status: REOPENED → RESOLVED
Closed: 11 years ago11 years ago
Resolution: --- → FIXED
Depends on: 931389
No longer blocks: 931643
Blocks: 931389
No longer depends on: 931389
You need to log in before you can comment on or make changes to this bug.