Last Comment Bug 740963 - [Skia] Handle non-multiple-of-two dash lengths in HelpersSkia::StrokeOptionsToPaint()
: [Skia] Handle non-multiple-of-two dash lengths in HelpersSkia::StrokeOptionsT...
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Graphics (show other bugs)
: unspecified
: x86_64 Linux
: -- normal (vote)
: mozilla14
Assigned To: George Wright (:gw280) (:gwright)
:
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-03-30 14:12 PDT by George Wright (:gw280) (:gwright)
Modified: 2012-03-31 19:27 PDT (History)
1 user (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Bug 740963 - [Skia] Handle non-multiple-of-two dash lengths in HelpersSkia::StrokeOptionsToPaint() (2.10 KB, patch)
2012-03-30 14:24 PDT, George Wright (:gw280) (:gwright)
jmuizelaar: review-
Details | Diff | Splinter Review
Bug 740963 - [Skia] Handle non-multiple-of-two dash lengths in HelpersSkia::StrokeOptionsToPaint() (2.10 KB, patch)
2012-03-30 14:31 PDT, George Wright (:gw280) (:gwright)
jmuizelaar: review+
Details | Diff | Splinter Review

Description George Wright (:gw280) (:gwright) 2012-03-30 14:12:51 PDT
Skia requires that dash arrays are a multiple of two in size for SkDashPathEffect.
Comment 1 George Wright (:gw280) (:gwright) 2012-03-30 14:24:14 PDT
Created attachment 611032 [details] [diff] [review]
Bug 740963 - [Skia] Handle non-multiple-of-two dash lengths in HelpersSkia::StrokeOptionsToPaint()
Comment 2 Jeff Muizelaar [:jrmuizel] 2012-03-30 14:30:12 PDT
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.
Comment 3 George Wright (:gw280) (:gwright) 2012-03-30 14:31:36 PDT
Created attachment 611040 [details] [diff] [review]
Bug 740963 - [Skia] Handle non-multiple-of-two dash lengths in HelpersSkia::StrokeOptionsToPaint()
Comment 4 George Wright (:gw280) (:gwright) 2012-03-30 14:37:08 PDT
https://hg.mozilla.org/integration/mozilla-inbound/rev/fa5f41ab5315
Comment 5 Ed Morley [:emorley] 2012-03-31 19:27:50 PDT
https://hg.mozilla.org/mozilla-central/rev/fa5f41ab5315

Note You need to log in before you can comment on or make changes to this bug.