[Skia] Handle non-multiple-of-two dash lengths in HelpersSkia::StrokeOptionsToPaint()

RESOLVED FIXED in mozilla14

Status

()

Core
Graphics
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: gw280, Assigned: gw280)

Tracking

unspecified
mozilla14
x86_64
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

Skia requires that dash arrays are a multiple of two in size for SkDashPathEffect.
Created attachment 611032 [details] [diff] [review]
Bug 740963 - [Skia] Handle non-multiple-of-two dash lengths in HelpersSkia::StrokeOptionsToPaint()
Attachment #611032 - Flags: review?(jmuizelaar)
Comment on attachment 611032 [details] [diff] [review]
Bug 740963 - [Skia] Handle non-multiple-of-two dash lengths in HelpersSkia::StrokeOptionsToPaint()


>+    if (aOptions.mDashLength % 2 == 0) {
>+      dashCount = aOptions.mDashLength;
>+    } else {
>+      dashCount = aOptions.mDashLength * 2;
>     }
>-    
>-    SkDashPathEffect* dash = new SkDashPathEffect(&pattern.front(), 
>-                                                  aOptions.mDashLength, 
>+
>+    SkScalar pattern[dashCount];

Please don't allocate this on the stack.
Attachment #611032 - Flags: review?(jmuizelaar) → review-
Created attachment 611040 [details] [diff] [review]
Bug 740963 - [Skia] Handle non-multiple-of-two dash lengths in HelpersSkia::StrokeOptionsToPaint()
Attachment #611032 - Attachment is obsolete: true
Attachment #611040 - Flags: review?(jmuizelaar)
Attachment #611040 - Flags: review?(jmuizelaar) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/fa5f41ab5315

Comment 5

5 years ago
https://hg.mozilla.org/mozilla-central/rev/fa5f41ab5315
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla14
You need to log in before you can comment on or make changes to this bug.