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

Unified Diff: tools/VisualBench/VisualSKPBench.cpp

Issue 1215033002: Add benchmarkstream to visualbench (Closed) Base URL: https://skia.googlesource.com/skia.git@microbenches
Patch Set: tweaks Created 5 years, 6 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 | « tools/VisualBench/VisualSKPBench.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/VisualBench/VisualSKPBench.cpp
diff --git a/tools/VisualBench/VisualSKPBench.cpp b/tools/VisualBench/VisualSKPBench.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..9e03d7148817cbf44f21ca2072ccd6b8bfce5788
--- /dev/null
+++ b/tools/VisualBench/VisualSKPBench.cpp
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ *
+ */
+
+#include "VisualSKPBench.h"
+
+VisualSKPBench::VisualSKPBench(const char* name, const SkPicture* pic)
+ : fPic(SkRef(pic))
+ , fName(name) {
+ fUniqueName.printf("%s", name);
+}
+
+const char* VisualSKPBench::onGetName() {
+ return fName.c_str();
+}
+
+const char* VisualSKPBench::onGetUniqueName() {
+ return fUniqueName.c_str();
+}
+
+bool VisualSKPBench::isSuitableFor(Backend backend) {
+ return backend != kNonRendering_Backend;
+}
+
+void VisualSKPBench::onDraw(const int loops, SkCanvas* canvas) {
+ for (int i = 0; i < loops; i++) {
+ canvas->drawPicture(fPic);
+ }
+}
« no previous file with comments | « tools/VisualBench/VisualSKPBench.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698