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

Side by Side Diff: bench/SKPAnimationBench.h

Issue 1203193002: Add loopSKP flag to nanobench (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase 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 | « bench/Benchmark.h ('k') | bench/SKPAnimationBench.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 SKPAnimationBench_DEFINED 8 #ifndef SKPAnimationBench_DEFINED
9 #define SKPAnimationBench_DEFINED 9 #define SKPAnimationBench_DEFINED
10 10
11 #include "SKPBench.h" 11 #include "SKPBench.h"
12 12
13 /** 13 /**
14 * Runs an SkPicture as a benchmark by repeatedly drawing it, first centering th e picture and 14 * Runs an SkPicture as a benchmark by repeatedly drawing it, first centering th e picture and
15 * for each step it concats the passed in matrix 15 * for each step it concats the passed in matrix
16 */ 16 */
17 class SKPAnimationBench : public SKPBench { 17 class SKPAnimationBench : public SKPBench {
18 public: 18 public:
19 SKPAnimationBench(const char* name, const SkPicture*, const SkIRect& devClip , 19 SKPAnimationBench(const char* name, const SkPicture*, const SkIRect& devClip ,
20 SkMatrix viewMatrix, int steps); 20 SkMatrix viewMatrix, int steps, bool doLooping);
21 21
22 protected: 22 protected:
23 const char* onGetName() override; 23 const char* onGetName() override;
24 const char* onGetUniqueName() override; 24 const char* onGetUniqueName() override;
25 void onPerCanvasPreDraw(SkCanvas* canvas) override; 25 void onPerCanvasPreDraw(SkCanvas* canvas) override;
26 26
27 void drawMPDPicture() override { 27 void drawMPDPicture() override {
28 SkFAIL("MPD not supported\n"); 28 SkFAIL("MPD not supported\n");
29 } 29 }
30 void drawPicture() override; 30 void drawPicture() override;
31 31
32 private: 32 private:
33 int fSteps; 33 int fSteps;
34 SkMatrix fAnimationMatrix; 34 SkMatrix fAnimationMatrix;
35 SkString fName; 35 SkString fName;
36 SkString fUniqueName; 36 SkString fUniqueName;
37 SkPoint fCenter; 37 SkPoint fCenter;
38 38
39 typedef SKPBench INHERITED; 39 typedef SKPBench INHERITED;
40 }; 40 };
41 41
42 #endif 42 #endif
OLDNEW
« no previous file with comments | « bench/Benchmark.h ('k') | bench/SKPAnimationBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698