aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/VisualBench/VisualSKPBench.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/VisualBench/VisualSKPBench.cpp')
-rw-r--r--tools/VisualBench/VisualSKPBench.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/tools/VisualBench/VisualSKPBench.cpp b/tools/VisualBench/VisualSKPBench.cpp
new file mode 100644
index 0000000000..9e03d71488
--- /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);
+ }
+}