Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(423)

Side by Side Diff: samplecode/SamplePathFuzz.cpp

Issue 1232463006: Fix up -Winconsistent-missing-override (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: llvm_coverage_build Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « samplecode/SamplePathClip.cpp ('k') | src/animator/SkXMLAnimatorWriter.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 634 matching lines...) Expand 10 before | Expand all | Expand 10 after
645 } 645 }
646 646
647 class PathFuzzView : public SampleView { 647 class PathFuzzView : public SampleView {
648 public: 648 public:
649 PathFuzzView() 649 PathFuzzView()
650 : fOneDraw(false) 650 : fOneDraw(false)
651 { 651 {
652 } 652 }
653 protected: 653 protected:
654 // overrides from SkEventSink 654 // overrides from SkEventSink
655 virtual bool onQuery(SkEvent* evt) { 655 bool onQuery(SkEvent* evt) override {
656 if (SampleCode::TitleQ(*evt)) { 656 if (SampleCode::TitleQ(*evt)) {
657 SampleCode::TitleR(evt, "PathFuzzer"); 657 SampleCode::TitleR(evt, "PathFuzzer");
658 return true; 658 return true;
659 } 659 }
660 return this->INHERITED::onQuery(evt); 660 return this->INHERITED::onQuery(evt);
661 } 661 }
662 662
663 void onOnceBeforeDraw() override { 663 void onOnceBeforeDraw() override {
664 fIndex = 0; 664 fIndex = 0;
665 SkImageInfo info(SkImageInfo::MakeN32Premul(SkScalarRoundToInt(width()), 665 SkImageInfo info(SkImageInfo::MakeN32Premul(SkScalarRoundToInt(width()),
666 SkScalarRoundToInt(height()))); 666 SkScalarRoundToInt(height())));
667 offscreen.allocPixels(info); 667 offscreen.allocPixels(info);
668 path_fuzz_stroker(&offscreen, fIndex); 668 path_fuzz_stroker(&offscreen, fIndex);
669 } 669 }
670 670
671 virtual void onDrawContent(SkCanvas* canvas) { 671 void onDrawContent(SkCanvas* canvas) override {
672 if (fOneDraw) { 672 if (fOneDraw) {
673 fuzzPath.randomize(); 673 fuzzPath.randomize();
674 const SkPath& path = fuzzPath.getPath(); 674 const SkPath& path = fuzzPath.getPath();
675 const SkPaint& paint = fuzzPath.getPaint(); 675 const SkPaint& paint = fuzzPath.getPaint();
676 const SkPath& clip = fuzzPath.getClip(); 676 const SkPath& clip = fuzzPath.getClip();
677 const SkMatrix& matrix = fuzzPath.getMatrix(); 677 const SkMatrix& matrix = fuzzPath.getMatrix();
678 if (!contains_only_moveTo(clip)) { 678 if (!contains_only_moveTo(clip)) {
679 canvas->clipPath(clip); 679 canvas->clipPath(clip);
680 } 680 }
681 canvas->setMatrix(matrix); 681 canvas->setMatrix(matrix);
(...skipping 10 matching lines...) Expand all
692 SkBitmap offscreen; 692 SkBitmap offscreen;
693 FuzzPath fuzzPath; 693 FuzzPath fuzzPath;
694 bool fOneDraw; 694 bool fOneDraw;
695 typedef SkView INHERITED; 695 typedef SkView INHERITED;
696 }; 696 };
697 697
698 static SkView* MyFactory() { return new PathFuzzView; } 698 static SkView* MyFactory() { return new PathFuzzView; }
699 static SkViewRegister reg(MyFactory); 699 static SkViewRegister reg(MyFactory);
700 700
701 701
OLDNEW
« no previous file with comments | « samplecode/SamplePathClip.cpp ('k') | src/animator/SkXMLAnimatorWriter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698