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

Side by Side Diff: bench/BitmapRegionDecoderBench.h

Issue 1344993003: Add nanobench tests for BitmapRegionDecoder (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Move buildTileIndex to onPreDraw Created 5 years, 3 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/BitmapRegionDecoderBench.cpp » ('j') | no next file with comments »
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 #ifndef BitmapRegionDecoderBench_DEFINED
9 #define BitmapRegionDecoderBench_DEFINED
10
11 #include "Benchmark.h"
12 #include "SkBitmapRegionDecoderInterface.h"
13 #include "SkData.h"
14 #include "SkImageInfo.h"
15 #include "SkRefCnt.h"
16 #include "SkString.h"
17
18 /**
19 * Time SkBitmapRegionDecoder.
scroggo 2015/09/18 15:07:23 I think these comments could be improved. This one
msarett 2015/09/18 17:41:17 You are right these comments are bad and actually
20 *
21 * The aim of this benchmark is not to duplicate the use cases that we test in the SubsetBenches.
22 * Instead we assume that the SubsetBenches give us enough information to choos e an appropriate
23 * approach to subsetting.
24 *
25 * This benchmark combines subsetting with scaling, allowing us to test the spe ed of several
26 * different approaches to scaling while subsetting.
27 */
28 class BitmapRegionDecoderBench : public Benchmark {
scroggo 2015/09/18 15:07:23 If the primary goal here is to time approaches to
msarett 2015/09/18 17:41:17 I'd prefer to stick with the name and improve the
29 public:
30 // Calls encoded->ref()
31 BitmapRegionDecoderBench(const char* basename, SkData* encoded,
32 SkBitmapRegionDecoderInterface::Strategy strategy, SkColorType color Type,
33 uint32_t sampleSize, const SkIRect& subset);
34
35 protected:
36 const char* onGetName() override;
37 bool isSuitableFor(Backend backend) override;
38 void onDraw(const int n, SkCanvas* canvas) override;
39 void onPreDraw() override;
40
41 private:
42 SkString fName;
43 SkAutoTDelete<SkBitmapRegionDecoderInterface> fBRD;
44 SkAutoTUnref<SkData> fData;
45 const SkBitmapRegionDecoderInterface::Strategy fStrategy;
46 const SkColorType fColorType;
47 const uint32_t fSampleSize;
48 const SkIRect fSubset;
49 typedef Benchmark INHERITED;
50 };
51 #endif // BitmapRegionDecoderBench_DEFINED
OLDNEW
« no previous file with comments | « no previous file | bench/BitmapRegionDecoderBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698