Closed Bug 740963 Opened 8 years ago Closed 8 years ago

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

Categories

(Core :: Graphics, defect)

x86_64
Linux
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla14

People

(Reporter: gw280, Assigned: gw280)

Details

Attachments

(1 file, 1 obsolete file)

Skia requires that dash arrays are a multiple of two in size for SkDashPathEffect.
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-
Attachment #611040 - Flags: review?(jmuizelaar) → review+
https://hg.mozilla.org/mozilla-central/rev/fa5f41ab5315
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla14
You need to log in before you can comment on or make changes to this bug.