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

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: CodecBench decodes to fColorType, as intended. 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
« no previous file with comments | « bench/CodecBench.cpp ('k') | bench/DecodingBench.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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"
12 #include "SkBitmap.h"
13 #include "SkData.h"
9 #include "SkImageDecoder.h" 14 #include "SkImageDecoder.h"
10 #include "SkImageInfo.h" 15 #include "SkImageInfo.h"
11 #include "SkStream.h" 16 #include "SkRefCnt.h"
12 #include "SkString.h" 17 #include "SkString.h"
13 18
14 /* 19 /*
15 * 20 *
16 * This benchmark is designed to test the performance of image decoding. 21 * This benchmark is designed to test the performance of image decoding.
17 * It is invoked from the nanobench.cpp file. 22 * It is invoked from the nanobench.cpp file.
18 * 23 *
19 */ 24 */
20 class DecodingBench : public Benchmark { 25 class DecodingBench : public Benchmark {
21 public: 26 public:
22 DecodingBench(SkString path, SkColorType colorType); 27 DecodingBench(SkString path, SkColorType colorType);
23 28
24 protected: 29 protected:
25 const char* onGetName() override; 30 const char* onGetName() override;
26 bool isSuitableFor(Backend backend) override; 31 bool isSuitableFor(Backend backend) override;
27 void onDraw(const int n, SkCanvas* canvas) override; 32 void onDraw(const int n, SkCanvas* canvas) override;
28 33 void onPreDraw() override;
34
29 private: 35 private:
30 SkString fName; 36 SkString fName;
31 SkColorType fColorType; 37 SkColorType fColorType;
32 SkAutoTDelete<SkMemoryStream> fStream; 38 SkAutoTUnref<SkData> fData;
33 SkAutoTDelete<SkImageDecoder> fDecoder; 39 SkBitmap fBitmap;
34 typedef Benchmark INHERITED; 40 typedef Benchmark INHERITED;
35 }; 41 };
42 #endif // DecodingBench_DEFINED
OLDNEW
« no previous file with comments | « bench/CodecBench.cpp ('k') | bench/DecodingBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698