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

Side by Side Diff: bench/PDFBench.cpp

Issue 2190883003: SkPDF: PDFStream has-a not is-a PDFDict (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2016-07-29 (Friday) 12:30:20 EDT Created 4 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 | « no previous file | gyp/pdf.gypi » ('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 2016 Google Inc. 2 * Copyright 2016 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 "Benchmark.h" 8 #include "Benchmark.h"
9 #include "Resources.h" 9 #include "Resources.h"
10 #include "SkAutoPixmapStorage.h" 10 #include "SkAutoPixmapStorage.h"
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 bool isSuitableFor(Backend backend) override { 130 bool isSuitableFor(Backend backend) override {
131 return backend == kNonRendering_Backend; 131 return backend == kNonRendering_Backend;
132 } 132 }
133 void onDelayedSetup() override { 133 void onDelayedSetup() override {
134 fAsset.reset(GetResourceAsStream("pdf_command_stream.txt")); 134 fAsset.reset(GetResourceAsStream("pdf_command_stream.txt"));
135 } 135 }
136 void onDraw(int loops, SkCanvas*) override { 136 void onDraw(int loops, SkCanvas*) override {
137 SkASSERT(fAsset); 137 SkASSERT(fAsset);
138 if (!fAsset) { return; } 138 if (!fAsset) { return; }
139 while (loops-- > 0) { 139 while (loops-- > 0) {
140 sk_sp<SkPDFObject> object( 140 sk_sp<SkPDFObject> object =
141 new SkPDFSharedStream(fAsset->duplicate())); 141 sk_make_sp<SkPDFSharedStream>(
142 std::unique_ptr<SkStreamAsset>(fAsset->duplicate()));
142 test_pdf_object_serialization(object); 143 test_pdf_object_serialization(object);
143 } 144 }
144 } 145 }
145 146
146 private: 147 private:
147 SkAutoTDelete<SkStreamAsset> fAsset; 148 SkAutoTDelete<SkStreamAsset> fAsset;
148 }; 149 };
149 150
150 // Test speed of SkPDFUtils::FloatToDecimal for typical floats that 151 // Test speed of SkPDFUtils::FloatToDecimal for typical floats that
151 // might be found in a PDF document. 152 // might be found in a PDF document.
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 245
245 } // namespace 246 } // namespace
246 DEF_BENCH(return new PDFImageBench;) 247 DEF_BENCH(return new PDFImageBench;)
247 DEF_BENCH(return new PDFJpegImageBench;) 248 DEF_BENCH(return new PDFJpegImageBench;)
248 DEF_BENCH(return new PDFCompressionBench;) 249 DEF_BENCH(return new PDFCompressionBench;)
249 DEF_BENCH(return new PDFScalarBench;) 250 DEF_BENCH(return new PDFScalarBench;)
250 DEF_BENCH(return new PDFColorComponentBench;) 251 DEF_BENCH(return new PDFColorComponentBench;)
251 DEF_BENCH(return new PDFShaderBench;) 252 DEF_BENCH(return new PDFShaderBench;)
252 DEF_BENCH(return new WStreamWriteTextBenchmark;) 253 DEF_BENCH(return new WStreamWriteTextBenchmark;)
253 DEF_BENCH(return new WritePDFTextBenchmark;) 254 DEF_BENCH(return new WritePDFTextBenchmark;)
OLDNEW
« no previous file with comments | « no previous file | gyp/pdf.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698