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

Unified Diff: bench/PDFBench.cpp

Issue 1844343004: SkWStream::writeText inlined. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | include/core/SkStream.h » ('j') | include/core/SkStream.h » ('J')
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 9da745c2806f2ad7586689f052d6d542f23ec160..df6873c59685836a73ee51cce4e8590640a80b1b 100644
--- a/bench/PDFBench.cpp
+++ b/bench/PDFBench.cpp
@@ -17,6 +17,7 @@
#include "SkPDFUtils.h"
#include "SkPixmap.h"
#include "SkRandom.h"
+#include "SkStream.h"
namespace {
struct NullWStream : public SkWStream {
@@ -190,9 +191,26 @@ struct PDFShaderBench : public Benchmark {
}
};
+struct WStreamWriteTextBenchmark : public Benchmark {
+ std::unique_ptr<SkWStream> fWStream;
+ WStreamWriteTextBenchmark() : fWStream(new NullWStream) {}
+ const char* onGetName() override { return "WStreamWriteText"; }
+ bool isSuitableFor(Backend backend) override {
+ return backend == kNonRendering_Backend;
+ }
+ void onDraw(int loops, SkCanvas*) override {
+ while (loops-- > 0) {
+ for (int i = 1000; i-- > 0;) {
+ fWStream->writeText("HELLO SKIA!\n");
+ }
+ }
+ }
+};
+
} // namespace
DEF_BENCH(return new PDFImageBench;)
DEF_BENCH(return new PDFJpegImageBench;)
DEF_BENCH(return new PDFCompressionBench;)
DEF_BENCH(return new PDFScalarBench;)
DEF_BENCH(return new PDFShaderBench;)
+DEF_BENCH(return new WStreamWriteTextBenchmark;)
« no previous file with comments | « no previous file | include/core/SkStream.h » ('j') | include/core/SkStream.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698