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

Side by Side Diff: bench/SKPBench.h

Issue 425393004: SKPs-as-benches in nanobench (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: more %.2g Created 6 years, 4 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/SKPBench.cpp » ('j') | bench/SKPBench.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2014 Google Inc. 2 * Copyright 2014 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 SKPBench_DEFINED
9 #define SKPBench_DEFINED
10
8 #include "Benchmark.h" 11 #include "Benchmark.h"
9 #include "SkCanvas.h" 12 #include "SkCanvas.h"
10 #include "gm.h" 13 #include "SkPicture.h"
11 14
12 /** 15 /**
13 * Runs a GM as a benchmark by repeatedly drawing the GM. 16 * Runs an SkPicture as a benchmark by repeatedly drawing it scaled inside a dev ice clip.
14 */ 17 */
15 class GMBench : public Benchmark { 18 class SKPBench : public Benchmark {
16 public: 19 public:
17 // Constructor takes ownership of the GM param. 20 SKPBench(const char* name, const SkPicture*, const SkIRect& devClip, SkScala r scale);
18 GMBench(skiagm::GM* gm);
19 virtual ~GMBench();
20 21
21 protected: 22 protected:
22 virtual const char* onGetName() SK_OVERRIDE; 23 virtual const char* onGetName() SK_OVERRIDE;
23 virtual bool isSuitableFor(Backend backend) SK_OVERRIDE; 24 virtual bool isSuitableFor(Backend backend) SK_OVERRIDE;
24 virtual void onDraw(const int loops, SkCanvas* canvas) SK_OVERRIDE; 25 virtual void onDraw(const int loops, SkCanvas* canvas) SK_OVERRIDE;
25 virtual SkIPoint onGetSize() SK_OVERRIDE; 26 virtual SkIPoint onGetSize() SK_OVERRIDE;
26 27
27 private: 28 private:
28 skiagm::GM* fGM; 29 SkAutoTUnref<const SkPicture> fPic;
29 SkString fName; 30 const SkIRect fClip;
31 const SkScalar fScale;
32 SkString fName;
33
30 typedef Benchmark INHERITED; 34 typedef Benchmark INHERITED;
31 }; 35 };
36
37 #endif
OLDNEW
« no previous file with comments | « no previous file | bench/SKPBench.cpp » ('j') | bench/SKPBench.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698