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

Unified Diff: bench/PDFBench.cpp

Issue 2151863003: SkPdf: smaller color serialization (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: SkFixed - 2016-07-15 (Friday) 15:45:32 EDT Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/pdf/SkPDFDevice.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/PDFBench.cpp
diff --git a/bench/PDFBench.cpp b/bench/PDFBench.cpp
index 8f5d2db5b4a51b78f40307e452d583395b761643..19f8e2f8cd061bca7c06710b01374a2e778a88f0 100644
--- a/bench/PDFBench.cpp
+++ b/bench/PDFBench.cpp
@@ -164,6 +164,21 @@ struct PDFScalarBench : public Benchmark {
}
};
+struct PDFColorComponentBench : public Benchmark {
+ bool isSuitableFor(Backend b) override {
+ return b == kNonRendering_Backend;
+ }
+ const char* onGetName() override { return "PDFColorComponent"; }
+ void onDraw(int loops, SkCanvas*) override {
+ char dst[5];
+ while (loops-- > 0) {
+ for (int i = 0; i < 256; ++i) {
+ (void)SkPDFUtils::ColorToDecimal(SkToU8(i), dst);
+ }
+ }
+ }
+};
+
struct PDFShaderBench : public Benchmark {
sk_sp<SkShader> fShader;
const char* onGetName() final { return "PDFShader"; }
@@ -232,6 +247,7 @@ DEF_BENCH(return new PDFImageBench;)
DEF_BENCH(return new PDFJpegImageBench;)
DEF_BENCH(return new PDFCompressionBench;)
DEF_BENCH(return new PDFScalarBench;)
+DEF_BENCH(return new PDFColorComponentBench;)
DEF_BENCH(return new PDFShaderBench;)
DEF_BENCH(return new WStreamWriteTextBenchmark;)
DEF_BENCH(return new WritePDFTextBenchmark;)
« no previous file with comments | « no previous file | src/pdf/SkPDFDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698