| 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 fBGColor = SK_ColorWHITE; | 14 fBGColor = SK_ColorWHITE; |
| 15 fCanvasIsDeferred = false; | 15 fCanvasIsDeferred = false; |
| 16 fHaveCalledOnceBeforeDraw = false; | 16 fHaveCalledOnceBeforeDraw = false; |
| 17 #if SK_SUPPORT_GPU |
| 18 fGr = NULL; |
| 19 #endif |
| 17 } | 20 } |
| 18 GM::~GM() {} | 21 GM::~GM() {} |
| 19 | 22 |
| 20 void GM::draw(SkCanvas* canvas) { | 23 void GM::draw(SkCanvas* canvas) { |
| 21 this->drawBackground(canvas); | 24 this->drawBackground(canvas); |
| 22 this->drawContent(canvas); | 25 this->drawContent(canvas); |
| 23 } | 26 } |
| 24 | 27 |
| 25 void GM::drawContent(SkCanvas* canvas) { | 28 void GM::drawContent(SkCanvas* canvas) { |
| 26 if (!fHaveCalledOnceBeforeDraw) { | 29 if (!fHaveCalledOnceBeforeDraw) { |
| (...skipping 30 matching lines...) Expand all Loading... |
| 57 SkISize size = this->getISize(); | 60 SkISize size = this->getISize(); |
| 58 SkRect r = SkRect::MakeWH(SkIntToScalar(size.width()), | 61 SkRect r = SkRect::MakeWH(SkIntToScalar(size.width()), |
| 59 SkIntToScalar(size.height())); | 62 SkIntToScalar(size.height())); |
| 60 SkPaint paint; | 63 SkPaint paint; |
| 61 paint.setColor(color); | 64 paint.setColor(color); |
| 62 canvas->drawRect(r, paint); | 65 canvas->drawRect(r, paint); |
| 63 } | 66 } |
| 64 | 67 |
| 65 // need to explicitly declare this, or we get some weird infinite loop llist | 68 // need to explicitly declare this, or we get some weird infinite loop llist |
| 66 template GMRegistry* SkTRegistry<GM*(*)(void*)>::gHead; | 69 template GMRegistry* SkTRegistry<GM*(*)(void*)>::gHead; |
| OLD | NEW |