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

Side by Side Diff: bench/CodecSubsetBench.h

Issue 1160953002: Subset decoding benchmarks (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « no previous file | bench/CodecSubsetBench.cpp » ('j') | bench/CodecSubsetBench.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright 2015 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #include "Benchmark.h"
9 #include "SkImageDecoder.h"
10 #include "SkImageInfo.h"
11 #include "SkStream.h"
12 #include "SkString.h"
13
14 /*
15 *
16 * This benchmark is designed to test the performance of subset decoding.
17 *
18 */
19 class CodecSubsetBench : public Benchmark {
20 public:
21
22 // Defines the style of the subset decoding benchmark.
23 enum SubsetMode {
24 // Use an input width, height, left, and top to decode a single subset.
25 // Must specify: subsetWidth, subsetHeight, offsetLeft, offsetTop
scroggo 2015/05/29 15:36:03 It might be clearer to have different constructors
msarett 2015/06/01 14:03:25 I am splitting the benchmark into separate subclas
26 kSingle_SubsetMode,
27
28 // Use a divisor to decode the entire image in a grid of divisor x divis or blocks.
29 // Must specify: divisor
30 kDivisor_SubsetMode,
31
32 // Use input dimensions to decode the entire image where each block is s usbetW x subsetH.
33 // Must specify: subsetWidth, subsetHeight
34 kTranslate_SubsetMode,
35
36 // Choose subsets to mimic a user zooming out on a photo
scroggo 2015/05/29 15:36:03 nit: zooming in* ?
msarett 2015/06/01 14:03:25 It mimics zooming out. The subsets get bigger eac
37 // Must specify: subsetWidth, subsetHeight
38 kScale_SubsetMode
39 };
40
41 CodecSubsetBench(SkString* path,
42 SubsetMode subsetMode,
43 SkColorType colorType,
44 uint32_t subsetWidth,
45 uint32_t subsetHeight,
46 uint32_t offsetLeft,
47 uint32_t offsetTop,
48 uint32_t divisor,
49 bool useCodec);
50
51 protected:
52 const char* onGetName() override;
53 bool isSuitableFor(Backend backend) override;
54 void onDraw(const int n, SkCanvas* canvas) override;
55
56 private:
57
58 SkString fName;
59 SubsetMode fSubsetMode;
60 SkColorType fColorType;
61 const uint32_t fSubsetWidth;
62 const uint32_t fSubsetHeight;
63 const uint32_t fOffsetLeft;
64 const uint32_t fOffsetTop;
65 const uint32_t fDivisor;
66 const bool fUseCodec;
67 SkAutoTDelete<SkMemoryStream> fStream;
68 typedef Benchmark INHERITED;
69 };
OLDNEW
« no previous file with comments | « no previous file | bench/CodecSubsetBench.cpp » ('j') | bench/CodecSubsetBench.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698