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

Side by Side Diff: bench/PDFBench.cpp

Issue 1892203002: Revert of SkPDF: PDF/A runtime switch (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 8 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.gyp » ('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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 SK_ColorWHITE, SK_ColorBLACK, 175 SK_ColorWHITE, SK_ColorBLACK,
176 }; 176 };
177 fShader = SkGradientShader::MakeLinear( 177 fShader = SkGradientShader::MakeLinear(
178 pts, colors, nullptr, SK_ARRAY_COUNT(colors), 178 pts, colors, nullptr, SK_ARRAY_COUNT(colors),
179 SkShader::kClamp_TileMode); 179 SkShader::kClamp_TileMode);
180 } 180 }
181 void onDraw(int loops, SkCanvas*) final { 181 void onDraw(int loops, SkCanvas*) final {
182 SkASSERT(fShader); 182 SkASSERT(fShader);
183 while (loops-- > 0) { 183 while (loops-- > 0) {
184 NullWStream nullStream; 184 NullWStream nullStream;
185 SkPDFDocument doc(&nullStream, nullptr, 72, nullptr, false); 185 SkPDFDocument doc(&nullStream, nullptr, 72, nullptr);
186 sk_sp<SkPDFObject> shader( 186 sk_sp<SkPDFObject> shader(
187 SkPDFShader::GetPDFShader( 187 SkPDFShader::GetPDFShader(
188 &doc, 72, fShader.get(), SkMatrix::I(), 188 &doc, 72, fShader.get(), SkMatrix::I(),
189 SkIRect::MakeWH(400,400), 72)); 189 SkIRect::MakeWH(400,400), 72));
190 } 190 }
191 } 191 }
192 }; 192 };
193 193
194 struct WStreamWriteTextBenchmark : public Benchmark { 194 struct WStreamWriteTextBenchmark : public Benchmark {
195 std::unique_ptr<SkWStream> fWStream; 195 std::unique_ptr<SkWStream> fWStream;
(...skipping 11 matching lines...) Expand all
207 } 207 }
208 }; 208 };
209 209
210 } // namespace 210 } // namespace
211 DEF_BENCH(return new PDFImageBench;) 211 DEF_BENCH(return new PDFImageBench;)
212 DEF_BENCH(return new PDFJpegImageBench;) 212 DEF_BENCH(return new PDFJpegImageBench;)
213 DEF_BENCH(return new PDFCompressionBench;) 213 DEF_BENCH(return new PDFCompressionBench;)
214 DEF_BENCH(return new PDFScalarBench;) 214 DEF_BENCH(return new PDFScalarBench;)
215 DEF_BENCH(return new PDFShaderBench;) 215 DEF_BENCH(return new PDFShaderBench;)
216 DEF_BENCH(return new WStreamWriteTextBenchmark;) 216 DEF_BENCH(return new WStreamWriteTextBenchmark;)
OLDNEW
« no previous file with comments | « no previous file | gyp/pdf.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698