| 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 | 9 |
| 10 using namespace skiagm; | 10 using namespace skiagm; |
| 11 | 11 |
| 12 const char* GM::gResourcePath; | |
| 13 | |
| 14 GM::GM() { | 12 GM::GM() { |
| 15 fMode = kGM_Mode; | 13 fMode = kGM_Mode; |
| 16 fBGColor = SK_ColorWHITE; | 14 fBGColor = SK_ColorWHITE; |
| 17 fCanvasIsDeferred = false; | 15 fCanvasIsDeferred = false; |
| 18 fHaveCalledOnceBeforeDraw = false; | 16 fHaveCalledOnceBeforeDraw = false; |
| 19 fStarterMatrix.reset(); | 17 fStarterMatrix.reset(); |
| 20 } | 18 } |
| 21 | 19 |
| 22 GM::~GM() {} | 20 GM::~GM() {} |
| 23 | 21 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 | 57 |
| 60 void GM::drawSizeBounds(SkCanvas* canvas, SkColor color) { | 58 void GM::drawSizeBounds(SkCanvas* canvas, SkColor color) { |
| 61 SkISize size = this->getISize(); | 59 SkISize size = this->getISize(); |
| 62 SkRect r = SkRect::MakeWH(SkIntToScalar(size.width()), | 60 SkRect r = SkRect::MakeWH(SkIntToScalar(size.width()), |
| 63 SkIntToScalar(size.height())); | 61 SkIntToScalar(size.height())); |
| 64 SkPaint paint; | 62 SkPaint paint; |
| 65 paint.setColor(color); | 63 paint.setColor(color); |
| 66 canvas->drawRect(r, paint); | 64 canvas->drawRect(r, paint); |
| 67 } | 65 } |
| 68 | 66 |
| 69 void GM::SetResourcePath(const char* resourcePath) { | |
| 70 gResourcePath = resourcePath; | |
| 71 } | |
| 72 | |
| 73 SkString GM::GetResourcePath() { | |
| 74 return SkString(gResourcePath); | |
| 75 } | |
| 76 | |
| 77 // 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 |
| 78 template GMRegistry* SkTRegistry<GM*(*)(void*)>::gHead; | 68 template GMRegistry* GMRegistry::gHead; |
| OLD | NEW |