Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(374)

Side by Side Diff: samplecode/SampleApp.cpp

Issue 1936283003: documentation: SkDocument::MakePDF() (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2016-05-02 (Monday) 17:27:37 EDT Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « samplecode/SampleApp.h ('k') | site/user/api/canvas.md » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « samplecode/SampleApp.h ('k') | site/user/api/canvas.md » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698