fuzzer fixes
Fix path bugs exposed by the path fuzzer.
Changes to existing gm and samplecode files defer their calls to construct
SkPath objects until the first draw instead of at test initialization.
Add an experimental call to SkPath to validate the internal SkPathRef.
Fix SkPath::addPoly to set the last moveto after adding a close verb.
Fix stroke to handle failures when computing the unit normal.
Add a unit test for the unit normal failure.
R=reed@google.com
Review URL: https://codereview.chromium.org/953383002
diff --git a/samplecode/SampleStrokePath.cpp b/samplecode/SampleStrokePath.cpp
index 4f6e3cc..00e5821 100644
--- a/samplecode/SampleStrokePath.cpp
+++ b/samplecode/SampleStrokePath.cpp
@@ -98,8 +98,8 @@
class StrokePathView : public SampleView {
SkScalar fWidth;
SkPath fPath;
-public:
- StrokePathView() {
+protected:
+ void onOnceBeforeDraw() SK_OVERRIDE {
// test_blur();
fWidth = SkIntToScalar(120);
@@ -122,7 +122,6 @@
this->setBGColor(0xFFDDDDDD);
}
-protected:
// overrides from SkEventSink
bool onQuery(SkEvent* evt) SK_OVERRIDE {
if (SampleCode::TitleQ(*evt)) {