OLD | NEW |
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 Loading... |
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;) |
OLD | NEW |