| 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 25 matching lines...) Expand all Loading... |
| 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->getName()); | 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 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; |
| 50 } | 50 } |
| 51 return this->INHERITED::onEvent(evt); | 51 return this->INHERITED::onEvent(evt); |
| 52 } | 52 } |
| 53 | 53 |
| 54 virtual void onDrawContent(SkCanvas* canvas) { | 54 virtual void onDrawContent(SkCanvas* canvas) { |
| 55 { | 55 { |
| 56 SkAutoCanvasRestore acr(canvas, fShowSize); | 56 SkAutoCanvasRestore acr(canvas, fShowSize); |
| (...skipping 12 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 |