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

Side by Side Diff: bench/PDFBench.cpp

Issue 1916093002: SkDocument/PDF: new API (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2016-04-26 (Tuesday) 15:55:33 EDT 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 | dm/DM.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 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,
186 SkDocument::PDFMetadata(), nullptr, false);
186 sk_sp<SkPDFObject> shader( 187 sk_sp<SkPDFObject> shader(
187 SkPDFShader::GetPDFShader( 188 SkPDFShader::GetPDFShader(
188 &doc, 72, fShader.get(), SkMatrix::I(), 189 &doc, 72, fShader.get(), SkMatrix::I(),
189 SkIRect::MakeWH(400,400), 72)); 190 SkIRect::MakeWH(400,400), 72));
190 } 191 }
191 } 192 }
192 }; 193 };
193 194
194 struct WStreamWriteTextBenchmark : public Benchmark { 195 struct WStreamWriteTextBenchmark : public Benchmark {
195 std::unique_ptr<SkWStream> fWStream; 196 std::unique_ptr<SkWStream> fWStream;
(...skipping 11 matching lines...) Expand all
207 } 208 }
208 }; 209 };
209 210
210 } // namespace 211 } // namespace
211 DEF_BENCH(return new PDFImageBench;) 212 DEF_BENCH(return new PDFImageBench;)
212 DEF_BENCH(return new PDFJpegImageBench;) 213 DEF_BENCH(return new PDFJpegImageBench;)
213 DEF_BENCH(return new PDFCompressionBench;) 214 DEF_BENCH(return new PDFCompressionBench;)
214 DEF_BENCH(return new PDFScalarBench;) 215 DEF_BENCH(return new PDFScalarBench;)
215 DEF_BENCH(return new PDFShaderBench;) 216 DEF_BENCH(return new PDFShaderBench;)
216 DEF_BENCH(return new WStreamWriteTextBenchmark;) 217 DEF_BENCH(return new WStreamWriteTextBenchmark;)
OLDNEW
« no previous file with comments | « no previous file | dm/DM.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698