aboutsummaryrefslogtreecommitdiffhomepage
path: root/bench/CodecBench.h
diff options
context:
space:
mode:
Diffstat (limited to 'bench/CodecBench.h')
-rw-r--r--bench/CodecBench.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/bench/CodecBench.h b/bench/CodecBench.h
new file mode 100644
index 0000000000..2bc4ba9a6f
--- /dev/null
+++ b/bench/CodecBench.h
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef CodecBench_DEFINED
+#define CodecBench_DEFINED
+
+#include "Benchmark.h"
+#include "SkBitmap.h"
+#include "SkData.h"
+#include "SkImageInfo.h"
+#include "SkRefCnt.h"
+#include "SkString.h"
+
+/**
+ * Time SkCodec.
+ */
+class CodecBench : public Benchmark {
+public:
+ // Calls encoded->ref()
+ CodecBench(SkString basename, SkData* encoded, SkColorType colorType);
+
+protected:
+ const char* onGetName() override;
+ bool isSuitableFor(Backend backend) override;
+ void onDraw(const int n, SkCanvas* canvas) override;
+ void onPreDraw() override;
+
+private:
+ SkString fName;
+ const SkColorType fColorType;
+ SkAutoTUnref<SkData> fData;
+ SkBitmap fBitmap;
+ typedef Benchmark INHERITED;
+};
+#endif // CodecBench_DEFINED