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 "SampleApp.h" | 8 #include "SampleApp.h" |
9 | 9 |
10 #include "OverView.h" | 10 #include "OverView.h" |
(...skipping 1153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1164 canvas->restoreToCount(count); | 1164 canvas->restoreToCount(count); |
1165 } | 1165 } |
1166 | 1166 |
1167 void SampleWindow::onDraw(SkCanvas* canvas) { | 1167 void SampleWindow::onDraw(SkCanvas* canvas) { |
1168 } | 1168 } |
1169 | 1169 |
1170 #include "SkColorPriv.h" | 1170 #include "SkColorPriv.h" |
1171 | 1171 |
1172 void SampleWindow::saveToPdf() | 1172 void SampleWindow::saveToPdf() |
1173 { | 1173 { |
1174 #if SK_SUPPORT_PDF | |
reed1
2015/08/11 15:41:04
Why are we guarding here? Do we not gracefully fai
| |
1174 fSaveToPdf = true; | 1175 fSaveToPdf = true; |
1175 this->inval(NULL); | 1176 this->inval(NULL); |
1177 #endif // SK_SUPPORT_PDF | |
1176 } | 1178 } |
1177 | 1179 |
1178 SkCanvas* SampleWindow::beforeChildren(SkCanvas* canvas) { | 1180 SkCanvas* SampleWindow::beforeChildren(SkCanvas* canvas) { |
1179 if (fSaveToPdf) { | 1181 if (fSaveToPdf) { |
1180 SkString name; | 1182 SkString name; |
1181 if (!this->getRawTitle(&name)) { | 1183 if (!this->getRawTitle(&name)) { |
1182 name.set("unknown_sample"); | 1184 name.set("unknown_sample"); |
1183 } | 1185 } |
1184 name.append(".pdf"); | 1186 name.append(".pdf"); |
1185 #ifdef SK_BUILD_FOR_ANDROID | 1187 #ifdef SK_BUILD_FOR_ANDROID |
(...skipping 1116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2302 setenv("ANDROID_ROOT", "/android/device/data", 0); | 2304 setenv("ANDROID_ROOT", "/android/device/data", 0); |
2303 #endif | 2305 #endif |
2304 SkGraphics::Init(); | 2306 SkGraphics::Init(); |
2305 SkEvent::Init(); | 2307 SkEvent::Init(); |
2306 } | 2308 } |
2307 | 2309 |
2308 void application_term() { | 2310 void application_term() { |
2309 SkEvent::Term(); | 2311 SkEvent::Term(); |
2310 SkGraphics::Term(); | 2312 SkGraphics::Term(); |
2311 } | 2313 } |
OLD | NEW |