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

Side by Side Diff: bench/PDFBench.cpp

Issue 1829303002: move setshader to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: addressing comments from #8 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 | bench/PerlinNoiseBench.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 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 pts, colors, nullptr, SK_ARRAY_COUNT(colors), 179 pts, colors, nullptr, SK_ARRAY_COUNT(colors),
180 SkShader::kClamp_TileMode); 180 SkShader::kClamp_TileMode);
181 } 181 }
182 void onDraw(int loops, SkCanvas*) final { 182 void onDraw(int loops, SkCanvas*) final {
183 SkASSERT(fShader); 183 SkASSERT(fShader);
184 while (loops-- > 0) { 184 while (loops-- > 0) {
185 NullWStream nullStream; 185 NullWStream nullStream;
186 SkPDFDocument doc(&nullStream, nullptr, 72, nullptr); 186 SkPDFDocument doc(&nullStream, nullptr, 72, nullptr);
187 sk_sp<SkPDFObject> shader( 187 sk_sp<SkPDFObject> shader(
188 SkPDFShader::GetPDFShader( 188 SkPDFShader::GetPDFShader(
189 &doc, 72, *fShader, SkMatrix::I(), 189 &doc, 72, fShader.get(), SkMatrix::I(),
190 SkIRect::MakeWH(400,400), 72)); 190 SkIRect::MakeWH(400,400), 72));
191 } 191 }
192 } 192 }
193 }; 193 };
194 194
195 } // namespace 195 } // namespace
196 DEF_BENCH(return new PDFImageBench;) 196 DEF_BENCH(return new PDFImageBench;)
197 DEF_BENCH(return new PDFJpegImageBench;) 197 DEF_BENCH(return new PDFJpegImageBench;)
198 DEF_BENCH(return new PDFCompressionBench;) 198 DEF_BENCH(return new PDFCompressionBench;)
199 DEF_BENCH(return new PDFScalarBench;) 199 DEF_BENCH(return new PDFScalarBench;)
200 DEF_BENCH(return new PDFShaderBench;) 200 DEF_BENCH(return new PDFShaderBench;)
OLDNEW
« no previous file with comments | « no previous file | bench/PerlinNoiseBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698