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

Side by Side Diff: bench/PicturePlaybackBench.cpp

Issue 1379853003: Fix for nexus 5 crashing in GL benches (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: tweaks Created 5 years, 2 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/PictureNestingBench.cpp ('k') | bench/PremulAndUnpremulAlphaOpsBench.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 2011 Google Inc. 2 * Copyright 2011 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 #include "Benchmark.h" 7 #include "Benchmark.h"
8 #include "SkCanvas.h" 8 #include "SkCanvas.h"
9 #include "SkColor.h" 9 #include "SkColor.h"
10 #include "SkPaint.h" 10 #include "SkPaint.h"
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 } 155 }
156 switch (fMode) { 156 switch (fMode) {
157 case kTiled: fName.append("_tiled" ); break; 157 case kTiled: fName.append("_tiled" ); break;
158 case kRandom: fName.append("_random"); break; 158 case kRandom: fName.append("_random"); break;
159 } 159 }
160 } 160 }
161 161
162 const char* onGetName() override { return fName.c_str(); } 162 const char* onGetName() override { return fName.c_str(); }
163 SkIPoint onGetSize() override { return SkIPoint::Make(1024,1024); } 163 SkIPoint onGetSize() override { return SkIPoint::Make(1024,1024); }
164 164
165 void onPreDraw() override { 165 void onDelayedSetup() override {
166 SkAutoTDelete<SkBBHFactory> factory; 166 SkAutoTDelete<SkBBHFactory> factory;
167 switch (fBBH) { 167 switch (fBBH) {
168 case kNone: break; 168 case kNone: break;
169 case kRTree: factory.reset(new SkRTreeFactory); break; 169 case kRTree: factory.reset(new SkRTreeFactory); break;
170 } 170 }
171 171
172 SkPictureRecorder recorder; 172 SkPictureRecorder recorder;
173 SkCanvas* canvas = recorder.beginRecording(1024, 1024, factory); 173 SkCanvas* canvas = recorder.beginRecording(1024, 1024, factory);
174 SkRandom rand; 174 SkRandom rand;
175 for (int i = 0; i < 10000; i++) { 175 for (int i = 0; i < 10000; i++) {
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 BBH fBBH; 210 BBH fBBH;
211 Mode fMode; 211 Mode fMode;
212 SkString fName; 212 SkString fName;
213 SkAutoTUnref<SkPicture> fPic; 213 SkAutoTUnref<SkPicture> fPic;
214 }; 214 };
215 215
216 DEF_BENCH( return new TiledPlaybackBench(kNone, kRandom); ) 216 DEF_BENCH( return new TiledPlaybackBench(kNone, kRandom); )
217 DEF_BENCH( return new TiledPlaybackBench(kNone, kTiled ); ) 217 DEF_BENCH( return new TiledPlaybackBench(kNone, kTiled ); )
218 DEF_BENCH( return new TiledPlaybackBench(kRTree, kRandom); ) 218 DEF_BENCH( return new TiledPlaybackBench(kRTree, kRandom); )
219 DEF_BENCH( return new TiledPlaybackBench(kRTree, kTiled ); ) 219 DEF_BENCH( return new TiledPlaybackBench(kRTree, kTiled ); )
OLDNEW
« no previous file with comments | « bench/PictureNestingBench.cpp ('k') | bench/PremulAndUnpremulAlphaOpsBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698