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

Side by Side Diff: bench/DecodingBench.h

Issue 1044363002: Add timing SkCodec to nanobench. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 8 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef DecodingBench_DEFINED
9 #define DecodingBench_DEFINED
10
8 #include "Benchmark.h" 11 #include "Benchmark.h"
9 #include "SkImageDecoder.h" 12 #include "SkImageDecoder.h"
10 #include "SkImageInfo.h" 13 #include "SkImageInfo.h"
11 #include "SkStream.h" 14 #include "SkStream.h"
12 #include "SkString.h" 15 #include "SkString.h"
13 16
14 /* 17 /*
15 * 18 *
16 * This benchmark is designed to test the performance of image decoding. 19 * This benchmark is designed to test the performance of image decoding.
17 * It is invoked from the nanobench.cpp file. 20 * It is invoked from the nanobench.cpp file.
18 * 21 *
19 */ 22 */
20 class DecodingBench : public Benchmark { 23 class DecodingBench : public Benchmark {
21 public: 24 public:
22 DecodingBench(SkString path, SkColorType colorType); 25 DecodingBench(SkString path, SkColorType colorType);
23 26
24 protected: 27 protected:
25 const char* onGetName() override; 28 const char* onGetName() override;
26 bool isSuitableFor(Backend backend) override; 29 bool isSuitableFor(Backend backend) override;
27 void onDraw(const int n, SkCanvas* canvas) override; 30 void onDraw(const int n, SkCanvas* canvas) override;
28 31
29 private: 32 private:
30 SkString fName; 33 SkString fName;
31 SkColorType fColorType; 34 SkColorType fColorType;
32 SkAutoTDelete<SkMemoryStream> fStream; 35 SkAutoTDelete<SkMemoryStream> fStream;
33 SkAutoTDelete<SkImageDecoder> fDecoder;
34 typedef Benchmark INHERITED; 36 typedef Benchmark INHERITED;
35 }; 37 };
38 #endif // DecodingBench_DEFINED
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698