OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 #include "SampleCode.h" | 8 #include "SampleCode.h" |
9 #include "SkBlurMask.h" | 9 #include "SkBlurMask.h" |
10 #include "SkBlurMaskFilter.h" | 10 #include "SkBlurMaskFilter.h" |
(...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
690 canvas.restore(); | 690 canvas.restore(); |
691 SkString str; | 691 SkString str; |
692 str.printf("/skimages/slide_" SK_SIZE_T_SPECIFIER ".png", i); | 692 str.printf("/skimages/slide_" SK_SIZE_T_SPECIFIER ".png", i); |
693 SkImageEncoder::EncodeFile(str.c_str(), bm, SkImageEncoder::kPNG_Typ
e, 100); | 693 SkImageEncoder::EncodeFile(str.c_str(), bm, SkImageEncoder::kPNG_Typ
e, 100); |
694 } | 694 } |
695 this->setBGColor(BG_COLOR); | 695 this->setBGColor(BG_COLOR); |
696 } | 696 } |
697 | 697 |
698 protected: | 698 protected: |
699 // overrides from SkEventSink | 699 // overrides from SkEventSink |
700 bool onQuery(SkEvent* evt) SK_OVERRIDE { | 700 bool onQuery(SkEvent* evt) override { |
701 if (SampleCode::TitleQ(*evt)) { | 701 if (SampleCode::TitleQ(*evt)) { |
702 SampleCode::TitleR(evt, "Slides"); | 702 SampleCode::TitleR(evt, "Slides"); |
703 return true; | 703 return true; |
704 } | 704 } |
705 return this->INHERITED::onQuery(evt); | 705 return this->INHERITED::onQuery(evt); |
706 } | 706 } |
707 | 707 |
708 void onDrawContent(SkCanvas* canvas) SK_OVERRIDE { | 708 void onDrawContent(SkCanvas* canvas) override { |
709 this->init(); | 709 this->init(); |
710 gProc[fIndex](canvas); | 710 gProc[fIndex](canvas); |
711 } | 711 } |
712 | 712 |
713 SkView::Click* onFindClickHandler(SkScalar x, SkScalar y, unsigned) SK_OVERR
IDE { | 713 SkView::Click* onFindClickHandler(SkScalar x, SkScalar y, unsigned) override
{ |
714 this->init(); | 714 this->init(); |
715 fIndex = (fIndex + 1) % SK_ARRAY_COUNT(gProc); | 715 fIndex = (fIndex + 1) % SK_ARRAY_COUNT(gProc); |
716 this->inval(NULL); | 716 this->inval(NULL); |
717 return NULL; | 717 return NULL; |
718 } | 718 } |
719 | 719 |
720 private: | 720 private: |
721 typedef SampleView INHERITED; | 721 typedef SampleView INHERITED; |
722 }; | 722 }; |
723 | 723 |
724 ////////////////////////////////////////////////////////////////////////////// | 724 ////////////////////////////////////////////////////////////////////////////// |
725 | 725 |
726 static SkView* MyFactory() { return new SlideView; } | 726 static SkView* MyFactory() { return new SlideView; } |
727 static SkViewRegister reg(MyFactory); | 727 static SkViewRegister reg(MyFactory); |
OLD | NEW |