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 fIgnoreFailures = false; |
17 } | 18 } |
18 GM::~GM() {} | 19 GM::~GM() {} |
19 | 20 |
20 void GM::draw(SkCanvas* canvas) { | 21 void GM::draw(SkCanvas* canvas) { |
21 this->drawBackground(canvas); | 22 this->drawBackground(canvas); |
22 this->drawContent(canvas); | 23 this->drawContent(canvas); |
23 } | 24 } |
24 | 25 |
25 void GM::drawContent(SkCanvas* canvas) { | 26 void GM::drawContent(SkCanvas* canvas) { |
26 if (!fHaveCalledOnceBeforeDraw) { | 27 if (!fHaveCalledOnceBeforeDraw) { |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 GrRenderTarget* renderTarget = device->accessRenderTarget(); | 71 GrRenderTarget* renderTarget = device->accessRenderTarget(); |
71 if (NULL != renderTarget) { | 72 if (NULL != renderTarget) { |
72 return renderTarget->getContext(); | 73 return renderTarget->getContext(); |
73 } | 74 } |
74 return NULL; | 75 return NULL; |
75 } | 76 } |
76 #endif | 77 #endif |
77 | 78 |
78 // need to explicitly declare this, or we get some weird infinite loop llist | 79 // need to explicitly declare this, or we get some weird infinite loop llist |
79 template GMRegistry* SkTRegistry<GM*(*)(void*)>::gHead; | 80 template GMRegistry* SkTRegistry<GM*(*)(void*)>::gHead; |
OLD | NEW |