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

Side by Side Diff: bench/PictureNestingBench.cpp

Issue 570303002: Tag recording picture nesting bench as nonrendering. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 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 | gm/convexpolyeffect.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 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 #include "Benchmark.h" 8 #include "Benchmark.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkColor.h" 10 #include "SkColor.h"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 typedef Benchmark INHERITED; 92 typedef Benchmark INHERITED;
93 }; 93 };
94 94
95 class PictureNestingRecording : public PictureNesting { 95 class PictureNestingRecording : public PictureNesting {
96 public: 96 public:
97 PictureNestingRecording(int maxLevel, int maxPictureLevel) 97 PictureNestingRecording(int maxLevel, int maxPictureLevel)
98 : INHERITED("recording", maxLevel, maxPictureLevel) { 98 : INHERITED("recording", maxLevel, maxPictureLevel) {
99 } 99 }
100 100
101 protected: 101 protected:
102 virtual void onDraw(const int loops, SkCanvas* canvas) { 102 virtual bool isSuitableFor(Backend backend) {
103 return backend == kNonRendering_Backend;
104 }
105
106 virtual void onDraw(const int loops, SkCanvas*) {
103 SkIPoint canvasSize = onGetSize(); 107 SkIPoint canvasSize = onGetSize();
104 SkPictureRecorder recorder; 108 SkPictureRecorder recorder;
105 109
106 for (int i = 0; i < loops; i++) { 110 for (int i = 0; i < loops; i++) {
107 SkCanvas* c = recorder.beginRecording(SkIntToScalar(canvasSize.x()), 111 SkCanvas* c = recorder.beginRecording(SkIntToScalar(canvasSize.x()),
108 SkIntToScalar(canvasSize.y())) ; 112 SkIntToScalar(canvasSize.y())) ;
109 this->doDraw(c); 113 this->doDraw(c);
110 SkAutoTUnref<SkPicture> picture(recorder.endRecording()); 114 SkAutoTUnref<SkPicture> picture(recorder.endRecording());
111 } 115 }
112 } 116 }
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 158
155 DEF_BENCH( return new PictureNestingPlayback(8, 0); ) 159 DEF_BENCH( return new PictureNestingPlayback(8, 0); )
156 DEF_BENCH( return new PictureNestingPlayback(8, 1); ) 160 DEF_BENCH( return new PictureNestingPlayback(8, 1); )
157 DEF_BENCH( return new PictureNestingPlayback(8, 2); ) 161 DEF_BENCH( return new PictureNestingPlayback(8, 2); )
158 DEF_BENCH( return new PictureNestingPlayback(8, 3); ) 162 DEF_BENCH( return new PictureNestingPlayback(8, 3); )
159 DEF_BENCH( return new PictureNestingPlayback(8, 4); ) 163 DEF_BENCH( return new PictureNestingPlayback(8, 4); )
160 DEF_BENCH( return new PictureNestingPlayback(8, 5); ) 164 DEF_BENCH( return new PictureNestingPlayback(8, 5); )
161 DEF_BENCH( return new PictureNestingPlayback(8, 6); ) 165 DEF_BENCH( return new PictureNestingPlayback(8, 6); )
162 DEF_BENCH( return new PictureNestingPlayback(8, 7); ) 166 DEF_BENCH( return new PictureNestingPlayback(8, 7); )
163 DEF_BENCH( return new PictureNestingPlayback(8, 8); ) 167 DEF_BENCH( return new PictureNestingPlayback(8, 8); )
OLDNEW
« no previous file with comments | « no previous file | gm/convexpolyeffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698