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

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: free → release 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') | 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 12 matching lines...) Expand all
23 size_t fN; 23 size_t fN;
24 }; 24 };
25 25
26 static void test_pdf_object_serialization(SkPDFObject* object) { 26 static void test_pdf_object_serialization(SkPDFObject* object) {
27 // SkDebugWStream wStream; 27 // SkDebugWStream wStream;
28 NullWStream wStream; 28 NullWStream wStream;
29 SkPDFSubstituteMap substitutes; 29 SkPDFSubstituteMap substitutes;
30 SkPDFObjNumMap objNumMap; 30 SkPDFObjNumMap objNumMap;
31 objNumMap.addObjectRecursively(object, substitutes); 31 objNumMap.addObjectRecursively(object, substitutes);
32 for (int i = 0; i < objNumMap.objects().count(); ++i) { 32 for (int i = 0; i < objNumMap.objects().count(); ++i) {
33 SkPDFObject* object = objNumMap.objects()[i]; 33 SkPDFObject* object = objNumMap.objects()[i].get();
34 wStream.writeDecAsText(i + 1); 34 wStream.writeDecAsText(i + 1);
35 wStream.writeText(" 0 obj\n"); 35 wStream.writeText(" 0 obj\n");
36 object->emitObject(&wStream, objNumMap, substitutes); 36 object->emitObject(&wStream, objNumMap, substitutes);
37 wStream.writeText("\nendobj\n"); 37 wStream.writeText("\nendobj\n");
38 } 38 }
39 } 39 }
40 40
41 class PDFImageBench : public Benchmark { 41 class PDFImageBench : public Benchmark {
42 public: 42 public:
43 PDFImageBench() {} 43 PDFImageBench() {}
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 (void)SkPDFUtils::FloatToDecimal(f, dst); 160 (void)SkPDFUtils::FloatToDecimal(f, dst);
161 } 161 }
162 } 162 }
163 }; 163 };
164 164
165 } // namespace 165 } // namespace
166 DEF_BENCH(return new PDFImageBench;) 166 DEF_BENCH(return new PDFImageBench;)
167 DEF_BENCH(return new PDFJpegImageBench;) 167 DEF_BENCH(return new PDFJpegImageBench;)
168 DEF_BENCH(return new PDFCompressionBench;) 168 DEF_BENCH(return new PDFCompressionBench;)
169 DEF_BENCH(return new PDFScalarBench;) 169 DEF_BENCH(return new PDFScalarBench;)
OLDNEW
« no previous file with comments | « no previous file | src/pdf/SkPDFBitmap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698