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

Side by Side Diff: samplecode/SampleApp.cpp

Issue 1279123007: SkPDF: allow PDF module to be disabled in DM and SampleApp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-08-11 (Tuesday) 10:04:57 EDT : #if SK_SUPPORT_PDF Created 5 years, 4 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 | « gyp/tests.gypi ('k') | src/doc/SkDocument_PDF_None.cpp » ('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 1153 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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 }
OLDNEW
« no previous file with comments | « gyp/tests.gypi ('k') | src/doc/SkDocument_PDF_None.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698