| 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 "GMSampleView.h" | 8 #include "GMSampleView.h" |
| 9 | 9 |
| 10 GMSampleView::GMSampleView(GM* gm) : fShowSize(false), fGM(gm) {} | 10 GMSampleView::GMSampleView(GM* gm) : fShowSize(false), fGM(gm) {} |
| 11 | 11 |
| 12 GMSampleView::~GMSampleView() { | 12 GMSampleView::~GMSampleView() { |
| 13 delete fGM; | 13 delete fGM; |
| 14 } | 14 } |
| 15 | 15 |
| 16 SkEvent* GMSampleView::NewShowSizeEvt(bool doShowSize) { | 16 SkEvent* GMSampleView::NewShowSizeEvt(bool doShowSize) { |
| 17 SkEvent* evt = SkNEW_ARGS(SkEvent, ("GMSampleView::showSize")); | 17 SkEvent* evt = new SkEvent("GMSampleView::showSize"); |
| 18 evt->setFast32(doShowSize); | 18 evt->setFast32(doShowSize); |
| 19 return evt; | 19 return evt; |
| 20 } | 20 } |
| 21 | 21 |
| 22 bool GMSampleView::onQuery(SkEvent* evt) { | 22 bool GMSampleView::onQuery(SkEvent* evt) { |
| 23 if (SampleCode::TitleQ(*evt)) { | 23 if (SampleCode::TitleQ(*evt)) { |
| 24 SkString name("GM:"); | 24 SkString name("GM:"); |
| 25 name.append(fGM->getName()); | 25 name.append(fGM->getName()); |
| 26 SampleCode::TitleR(evt, name.c_str()); | 26 SampleCode::TitleR(evt, name.c_str()); |
| 27 return true; | 27 return true; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 53 } | 53 } |
| 54 | 54 |
| 55 void GMSampleView::onDrawBackground(SkCanvas* canvas) { | 55 void GMSampleView::onDrawBackground(SkCanvas* canvas) { |
| 56 fGM->drawBackground(canvas); | 56 fGM->drawBackground(canvas); |
| 57 } | 57 } |
| 58 | 58 |
| 59 bool GMSampleView::onAnimate(const SkAnimTimer& timer) { | 59 bool GMSampleView::onAnimate(const SkAnimTimer& timer) { |
| 60 return fGM->animate(timer); | 60 return fGM->animate(timer); |
| 61 } | 61 } |
| 62 | 62 |
| OLD | NEW |