OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "SampleCode.h" | 8 #include "SampleCode.h" |
9 #include "SkView.h" | 9 #include "SkView.h" |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
664 protected: | 664 protected: |
665 // overrides from SkEventSink | 665 // overrides from SkEventSink |
666 virtual bool onQuery(SkEvent* evt) { | 666 virtual bool onQuery(SkEvent* evt) { |
667 if (SampleCode::TitleQ(*evt)) { | 667 if (SampleCode::TitleQ(*evt)) { |
668 SampleCode::TitleR(evt, "PathFuzzer"); | 668 SampleCode::TitleR(evt, "PathFuzzer"); |
669 return true; | 669 return true; |
670 } | 670 } |
671 return this->INHERITED::onQuery(evt); | 671 return this->INHERITED::onQuery(evt); |
672 } | 672 } |
673 | 673 |
674 void onOnceBeforeDraw() SK_OVERRIDE { | 674 void onOnceBeforeDraw() override { |
675 fIndex = 0; | 675 fIndex = 0; |
676 SkImageInfo info(SkImageInfo::MakeN32Premul(SkScalarRoundToInt(width()),
| 676 SkImageInfo info(SkImageInfo::MakeN32Premul(SkScalarRoundToInt(width()),
|
677 SkScalarRoundToInt(height()))); | 677 SkScalarRoundToInt(height()))); |
678 offscreen.allocPixels(info); | 678 offscreen.allocPixels(info); |
679 path_fuzz_stroker(&offscreen, fIndex); | 679 path_fuzz_stroker(&offscreen, fIndex); |
680 } | 680 } |
681 | 681 |
682 virtual void onDrawContent(SkCanvas* canvas) { | 682 virtual void onDrawContent(SkCanvas* canvas) { |
683 if (fOneDraw) { | 683 if (fOneDraw) { |
684 fuzzPath.randomize(); | 684 fuzzPath.randomize(); |
(...skipping 18 matching lines...) Expand all Loading... |
703 SkBitmap offscreen; | 703 SkBitmap offscreen; |
704 FuzzPath fuzzPath; | 704 FuzzPath fuzzPath; |
705 bool fOneDraw; | 705 bool fOneDraw; |
706 typedef SkView INHERITED; | 706 typedef SkView INHERITED; |
707 }; | 707 }; |
708 | 708 |
709 static SkView* MyFactory() { return new PathFuzzView; } | 709 static SkView* MyFactory() { return new PathFuzzView; } |
710 static SkViewRegister reg(MyFactory); | 710 static SkViewRegister reg(MyFactory); |
711 | 711 |
712 | 712 |
OLD | NEW |