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

Side by Side Diff: dm/DMBenchTask.h

Issue 178473006: DM: also run benches once. (Closed) Base URL: https://skia.googlesource.com/skia.git@dm
Patch Set: add note Created 6 years, 10 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 | « dm/DM.cpp ('k') | dm/DMBenchTask.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 #ifndef DMBenchTask_DEFINED
2 #define DMBenchTask_DEFINED
3
4 #include "DMReporter.h"
5 #include "DMTask.h"
6 #include "DMTaskRunner.h"
7 #include "SkBenchmark.h"
8 #include "SkString.h"
9 #include "SkTemplates.h"
10
11 // Tasks that run an SkBenchmark once as a check that it doesn't crash.
12
13 namespace DM {
14
15 class NonRenderingBenchTask : public Task {
16 public:
17 NonRenderingBenchTask(const char* config, Reporter*, TaskRunner*, BenchRegis try::Factory);
18
19 virtual void draw() SK_OVERRIDE;
20 virtual bool usesGpu() const SK_OVERRIDE { return false; }
21 virtual bool shouldSkip() const SK_OVERRIDE;
22 virtual SkString name() const SK_OVERRIDE { return fName; }
23
24 private:
25 SkAutoTDelete<SkBenchmark> fBench;
26 const SkString fName;
27 };
28
29 class CpuBenchTask : public Task {
30 public:
31 CpuBenchTask(const char* config, Reporter*, TaskRunner*, BenchRegistry::Fact ory, SkColorType);
32
33 virtual void draw() SK_OVERRIDE;
34 virtual bool usesGpu() const SK_OVERRIDE { return false; }
35 virtual bool shouldSkip() const SK_OVERRIDE;
36 virtual SkString name() const SK_OVERRIDE { return fName; }
37
38 private:
39 SkAutoTDelete<SkBenchmark> fBench;
40 const SkString fName;
41 const SkColorType fColorType;
42 };
43
44 class GpuBenchTask : public Task {
45 public:
46 GpuBenchTask(const char* config,
47 Reporter*,
48 TaskRunner*,
49 BenchRegistry::Factory,
50 GrContextFactory::GLContextType,
51 int sampleCount);
52
53 virtual void draw() SK_OVERRIDE;
54 virtual bool usesGpu() const SK_OVERRIDE { return true; }
55 virtual bool shouldSkip() const SK_OVERRIDE;
56 virtual SkString name() const SK_OVERRIDE { return fName; }
57
58 private:
59 SkAutoTDelete<SkBenchmark> fBench;
60 const SkString fName;
61 const GrContextFactory::GLContextType fContextType;
62 int fSampleCount;
63 };
64
65 } // namespace DM
66
67 #endif // DMBenchTask_DEFINED
OLDNEW
« no previous file with comments | « dm/DM.cpp ('k') | dm/DMBenchTask.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698