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

Unified Diff: experimental/tools/multipage_pdf_profiler.cpp

Issue 769423002: work in progress (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « experimental/tools/gmtoskp.cpp ('k') | gm/smallimage.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: experimental/tools/multipage_pdf_profiler.cpp
diff --git a/experimental/tools/multipage_pdf_profiler.cpp b/experimental/tools/multipage_pdf_profiler.cpp
index 93c8df9fb4adc2dc455ba15821e32344bc37b2df..4f8eae2fb6fd8f3932fcf1b5c0acceb1fad20e7d 100644
--- a/experimental/tools/multipage_pdf_profiler.cpp
+++ b/experimental/tools/multipage_pdf_profiler.cpp
@@ -12,19 +12,16 @@
#include "SkPicture.h"
#include "SkStream.h"
#include "SkTemplates.h"
+#include "PageCachingDocument.h"
#include "ProcStats.h"
#include "flags/SkCommandLineFlags.h"
-#ifdef SK_ENABLE_NEW_SKPDF_BACKEND
-#include "skpdf.h"
-#endif
-
DEFINE_string2(readPath,
r,
"",
"(Required) The path to a .skp Skia Picture file.");
DEFINE_string2(writePath, w, "", "If set, write PDF output to this file.");
-DEFINE_bool(newPdf, false, "Use the new PDF backend.");
+DEFINE_bool(cachePages, false, "Use a PageCachingDocument.");
DEFINE_bool(nullCanvas, true, "Render to a SkNullCanvas as a control.");
__SK_FORCE_IMAGE_DECODER_LINKING;
@@ -45,12 +42,11 @@ public:
};
SkDocument* CreatePDFDocument(SkWStream* out) {
-#ifdef SK_ENABLE_NEW_SKPDF_BACKEND
- if (FLAGS_newPdf) {
- return skpdf::CreatePDFDocument(out);
+ if (FLAGS_cachePages) {
+ return CreatePageCachingDocument(out);
+ } else {
+ return SkDocument::CreatePDF(out);
}
-#endif
- return SkDocument::CreatePDF(out);
}
} // namespace
@@ -119,7 +115,8 @@ int main(int argc, char** argv) {
canvas->clipRect(letterRect);
canvas->translate(SkIntToScalar(-kLetterWidth * x),
SkIntToScalar(-kLetterHeight * y));
- canvas->drawPicture(picture);
+ picture->playback(canvas);
+ //canvas->drawPicture(picture);
}
canvas->flush();
if (!FLAGS_nullCanvas) {
« no previous file with comments | « experimental/tools/gmtoskp.cpp ('k') | gm/smallimage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698