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

Side by Side Diff: bench/PDFBench.cpp

Issue 1790023003: SkPDF: add drop() virtual to release resources early. (Closed) Base URL: https://skia.googlesource.com/skia.git@skpdf-global
Patch Set: Record move fns Created 4 years, 9 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 | src/pdf/SkPDFBitmap.cpp » ('j') | src/pdf/SkPDFBitmap.cpp » ('J')
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 "SkData.h" 10 #include "SkData.h"
(...skipping 11 matching lines...) Expand all
22 size_t fN; 22 size_t fN;
23 }; 23 };
24 24
25 static void test_pdf_object_serialization(SkPDFObject* object) { 25 static void test_pdf_object_serialization(SkPDFObject* object) {
26 // SkDebugWStream wStream; 26 // SkDebugWStream wStream;
27 NullWStream wStream; 27 NullWStream wStream;
28 SkPDFSubstituteMap substitutes; 28 SkPDFSubstituteMap substitutes;
29 SkPDFObjNumMap objNumMap; 29 SkPDFObjNumMap objNumMap;
30 objNumMap.addObjectRecursively(object, substitutes); 30 objNumMap.addObjectRecursively(object, substitutes);
31 for (int i = 0; i < objNumMap.objects().count(); ++i) { 31 for (int i = 0; i < objNumMap.objects().count(); ++i) {
32 SkPDFObject* object = objNumMap.objects()[i]; 32 SkPDFObject* object = objNumMap.objects()[i].get();
33 wStream.writeDecAsText(i + 1); 33 wStream.writeDecAsText(i + 1);
34 wStream.writeText(" 0 obj\n"); 34 wStream.writeText(" 0 obj\n");
35 object->emitObject(&wStream, objNumMap, substitutes); 35 object->emitObject(&wStream, objNumMap, substitutes);
36 wStream.writeText("\nendobj\n"); 36 wStream.writeText("\nendobj\n");
37 } 37 }
38 } 38 }
39 39
40 class PDFImageBench : public Benchmark { 40 class PDFImageBench : public Benchmark {
41 public: 41 public:
42 PDFImageBench() {} 42 PDFImageBench() {}
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 (void)SkPDFUtils::FloatToDecimal(f, dst); 162 (void)SkPDFUtils::FloatToDecimal(f, dst);
163 } 163 }
164 } 164 }
165 }; 165 };
166 166
167 } // namespace 167 } // namespace
168 DEF_BENCH(return new PDFImageBench;) 168 DEF_BENCH(return new PDFImageBench;)
169 DEF_BENCH(return new PDFJpegImageBench;) 169 DEF_BENCH(return new PDFJpegImageBench;)
170 DEF_BENCH(return new PDFCompressionBench;) 170 DEF_BENCH(return new PDFCompressionBench;)
171 DEF_BENCH(return new PDFScalarBench;) 171 DEF_BENCH(return new PDFScalarBench;)
OLDNEW
« no previous file with comments | « no previous file | src/pdf/SkPDFBitmap.cpp » ('j') | src/pdf/SkPDFBitmap.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698