| 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 | 8 |
| 9 | 9 |
| 10 #ifndef GMSampleView_DEFINED | 10 #ifndef GMSampleView_DEFINED |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 static SkEvent* NewShowSizeEvt(bool doShowSize) { | 29 static SkEvent* NewShowSizeEvt(bool doShowSize) { |
| 30 SkEvent* evt = SkNEW_ARGS(SkEvent, ("GMSampleView::showSize")); | 30 SkEvent* evt = SkNEW_ARGS(SkEvent, ("GMSampleView::showSize")); |
| 31 evt->setFast32(doShowSize); | 31 evt->setFast32(doShowSize); |
| 32 return evt; | 32 return evt; |
| 33 } | 33 } |
| 34 | 34 |
| 35 protected: | 35 protected: |
| 36 virtual bool onQuery(SkEvent* evt) { | 36 virtual bool onQuery(SkEvent* evt) { |
| 37 if (SampleCode::TitleQ(*evt)) { | 37 if (SampleCode::TitleQ(*evt)) { |
| 38 SkString name("GM:"); | 38 SkString name("GM:"); |
| 39 name.append(fGM->shortName()); | 39 name.append(fGM->getName()); |
| 40 SampleCode::TitleR(evt, name.c_str()); | 40 SampleCode::TitleR(evt, name.c_str()); |
| 41 return true; | 41 return true; |
| 42 } | 42 } |
| 43 return this->INHERITED::onQuery(evt); | 43 return this->INHERITED::onQuery(evt); |
| 44 } | 44 } |
| 45 | 45 |
| 46 virtual bool onEvent(const SkEvent& evt) SK_OVERRIDE { | 46 virtual bool onEvent(const SkEvent& evt) SK_OVERRIDE { |
| 47 if (evt.isType("GMSampleView::showSize")) { | 47 if (evt.isType("GMSampleView::showSize")) { |
| 48 fShowSize = SkToBool(evt.getFast32()); | 48 fShowSize = SkToBool(evt.getFast32()); |
| 49 return true; | 49 return true; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 69 virtual void onDrawBackground(SkCanvas* canvas) { | 69 virtual void onDrawBackground(SkCanvas* canvas) { |
| 70 fGM->drawBackground(canvas); | 70 fGM->drawBackground(canvas); |
| 71 } | 71 } |
| 72 | 72 |
| 73 private: | 73 private: |
| 74 GM* fGM; | 74 GM* fGM; |
| 75 typedef SampleView INHERITED; | 75 typedef SampleView INHERITED; |
| 76 }; | 76 }; |
| 77 | 77 |
| 78 #endif | 78 #endif |
| OLD | NEW |