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 1361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1372 SkCanvas* SampleWindow::beforeChildren(SkCanvas* canvas) { | 1372 SkCanvas* SampleWindow::beforeChildren(SkCanvas* canvas) { |
1373 if (fSaveToPdf) { | 1373 if (fSaveToPdf) { |
1374 SkString name; | 1374 SkString name; |
1375 if (!this->getRawTitle(&name)) { | 1375 if (!this->getRawTitle(&name)) { |
1376 name.set("unknown_sample"); | 1376 name.set("unknown_sample"); |
1377 } | 1377 } |
1378 name.append(".pdf"); | 1378 name.append(".pdf"); |
1379 #ifdef SK_BUILD_FOR_ANDROID | 1379 #ifdef SK_BUILD_FOR_ANDROID |
1380 name.prepend("/sdcard/"); | 1380 name.prepend("/sdcard/"); |
1381 #endif | 1381 #endif |
1382 fPDFDocument.reset(SkDocument::CreatePDF(name.c_str())); | 1382 fPDFDocument = SkDocument::MakePDF(name.c_str()); |
1383 canvas = fPDFDocument->beginPage(this->width(), this->height()); | 1383 canvas = fPDFDocument->beginPage(this->width(), this->height()); |
1384 } else if (fSaveToSKP) { | 1384 } else if (fSaveToSKP) { |
1385 canvas = fRecorder.beginRecording(9999, 9999, nullptr, 0); | 1385 canvas = fRecorder.beginRecording(9999, 9999, nullptr, 0); |
1386 } else if (fUsePicture) { | 1386 } else if (fUsePicture) { |
1387 canvas = fRecorder.beginRecording(9999, 9999, nullptr, 0); | 1387 canvas = fRecorder.beginRecording(9999, 9999, nullptr, 0); |
1388 } else { | 1388 } else { |
1389 canvas = this->INHERITED::beforeChildren(canvas); | 1389 canvas = this->INHERITED::beforeChildren(canvas); |
1390 } | 1390 } |
1391 | 1391 |
1392 if (fUseClip) { | 1392 if (fUseClip) { |
(...skipping 1008 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2401 #ifdef SK_BUILD_FOR_MAC | 2401 #ifdef SK_BUILD_FOR_MAC |
2402 setenv("ANDROID_ROOT", "/android/device/data", 0); | 2402 setenv("ANDROID_ROOT", "/android/device/data", 0); |
2403 #endif | 2403 #endif |
2404 SkGraphics::Init(); | 2404 SkGraphics::Init(); |
2405 SkEvent::Init(); | 2405 SkEvent::Init(); |
2406 } | 2406 } |
2407 | 2407 |
2408 void application_term() { | 2408 void application_term() { |
2409 SkEvent::Term(); | 2409 SkEvent::Term(); |
2410 } | 2410 } |
OLD | NEW |