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 1268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1279 canvas->restoreToCount(count); | 1279 canvas->restoreToCount(count); |
1280 } | 1280 } |
1281 | 1281 |
1282 void SampleWindow::onDraw(SkCanvas* canvas) { | 1282 void SampleWindow::onDraw(SkCanvas* canvas) { |
1283 } | 1283 } |
1284 | 1284 |
1285 #include "SkColorPriv.h" | 1285 #include "SkColorPriv.h" |
1286 | 1286 |
1287 void SampleWindow::saveToPdf() | 1287 void SampleWindow::saveToPdf() |
1288 { | 1288 { |
1289 #if SK_SUPPORT_PDF | |
1290 fSaveToPdf = true; | 1289 fSaveToPdf = true; |
1291 this->inval(nullptr); | 1290 this->inval(nullptr); |
1292 #endif // SK_SUPPORT_PDF | |
1293 } | 1291 } |
1294 | 1292 |
1295 SkCanvas* SampleWindow::beforeChildren(SkCanvas* canvas) { | 1293 SkCanvas* SampleWindow::beforeChildren(SkCanvas* canvas) { |
1296 if (fSaveToPdf) { | 1294 if (fSaveToPdf) { |
1297 SkString name; | 1295 SkString name; |
1298 if (!this->getRawTitle(&name)) { | 1296 if (!this->getRawTitle(&name)) { |
1299 name.set("unknown_sample"); | 1297 name.set("unknown_sample"); |
1300 } | 1298 } |
1301 name.append(".pdf"); | 1299 name.append(".pdf"); |
1302 #ifdef SK_BUILD_FOR_ANDROID | 1300 #ifdef SK_BUILD_FOR_ANDROID |
(...skipping 969 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2272 #ifdef SK_BUILD_FOR_MAC | 2270 #ifdef SK_BUILD_FOR_MAC |
2273 setenv("ANDROID_ROOT", "/android/device/data", 0); | 2271 setenv("ANDROID_ROOT", "/android/device/data", 0); |
2274 #endif | 2272 #endif |
2275 SkGraphics::Init(); | 2273 SkGraphics::Init(); |
2276 SkEvent::Init(); | 2274 SkEvent::Init(); |
2277 } | 2275 } |
2278 | 2276 |
2279 void application_term() { | 2277 void application_term() { |
2280 SkEvent::Term(); | 2278 SkEvent::Term(); |
2281 } | 2279 } |
OLD | NEW |