| 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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 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  Loading... | 
| 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;) | 
| OLD | NEW | 
|---|