| 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 667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 678 const SkMatrix& matrix = fuzzPath.getMatrix(); | 678 const SkMatrix& matrix = fuzzPath.getMatrix(); |
| 679 if (!contains_only_moveTo(clip)) { | 679 if (!contains_only_moveTo(clip)) { |
| 680 canvas->clipPath(clip); | 680 canvas->clipPath(clip); |
| 681 } | 681 } |
| 682 canvas->setMatrix(matrix); | 682 canvas->setMatrix(matrix); |
| 683 canvas->drawPath(path, paint); | 683 canvas->drawPath(path, paint); |
| 684 } else { | 684 } else { |
| 685 path_fuzz_stroker(&offscreen, fIndex += 100); | 685 path_fuzz_stroker(&offscreen, fIndex += 100); |
| 686 canvas->drawBitmap(offscreen, 0, 0); | 686 canvas->drawBitmap(offscreen, 0, 0); |
| 687 } | 687 } |
| 688 this->inval(NULL); | 688 this->inval(nullptr); |
| 689 } | 689 } |
| 690 | 690 |
| 691 private: | 691 private: |
| 692 int fIndex; | 692 int fIndex; |
| 693 SkBitmap offscreen; | 693 SkBitmap offscreen; |
| 694 FuzzPath fuzzPath; | 694 FuzzPath fuzzPath; |
| 695 bool fOneDraw; | 695 bool fOneDraw; |
| 696 typedef SkView INHERITED; | 696 typedef SkView INHERITED; |
| 697 }; | 697 }; |
| 698 | 698 |
| 699 static SkView* MyFactory() { return new PathFuzzView; } | 699 static SkView* MyFactory() { return new PathFuzzView; } |
| 700 static SkViewRegister reg(MyFactory); | 700 static SkViewRegister reg(MyFactory); |
| 701 | 701 |
| 702 | 702 |
| OLD | NEW |