| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 "gm.h" | 8 #include "gm.h" |
| 9 using namespace skiagm; | 9 using namespace skiagm; |
| 10 | 10 |
| 11 SkString GM::gResourcePath; | 11 SkString GM::gResourcePath; |
| 12 | 12 |
| 13 GM::GM() { | 13 GM::GM() { |
| 14 fMode = kGM_Mode; |
| 14 fBGColor = SK_ColorWHITE; | 15 fBGColor = SK_ColorWHITE; |
| 15 fCanvasIsDeferred = false; | 16 fCanvasIsDeferred = false; |
| 16 fHaveCalledOnceBeforeDraw = false; | 17 fHaveCalledOnceBeforeDraw = false; |
| 17 fStarterMatrix.reset(); | 18 fStarterMatrix.reset(); |
| 18 } | 19 } |
| 19 GM::~GM() {} | 20 GM::~GM() {} |
| 20 | 21 |
| 21 void GM::draw(SkCanvas* canvas) { | 22 void GM::draw(SkCanvas* canvas) { |
| 22 this->drawBackground(canvas); | 23 this->drawBackground(canvas); |
| 23 this->drawContent(canvas); | 24 this->drawContent(canvas); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 SkISize size = this->getISize(); | 59 SkISize size = this->getISize(); |
| 59 SkRect r = SkRect::MakeWH(SkIntToScalar(size.width()), | 60 SkRect r = SkRect::MakeWH(SkIntToScalar(size.width()), |
| 60 SkIntToScalar(size.height())); | 61 SkIntToScalar(size.height())); |
| 61 SkPaint paint; | 62 SkPaint paint; |
| 62 paint.setColor(color); | 63 paint.setColor(color); |
| 63 canvas->drawRect(r, paint); | 64 canvas->drawRect(r, paint); |
| 64 } | 65 } |
| 65 | 66 |
| 66 // need to explicitly declare this, or we get some weird infinite loop llist | 67 // need to explicitly declare this, or we get some weird infinite loop llist |
| 67 template GMRegistry* SkTRegistry<GM*(*)(void*)>::gHead; | 68 template GMRegistry* SkTRegistry<GM*(*)(void*)>::gHead; |
| OLD | NEW |