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

Side by Side Diff: bench/GeometryBench.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/GameBench.cpp ('k') | bench/GrResourceCacheBench.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 "SkGeometry.h" 9 #include "SkGeometry.h"
10 #include "SkRandom.h" 10 #include "SkRandom.h"
(...skipping 28 matching lines...) Expand all
39 SkString fName; 39 SkString fName;
40 }; 40 };
41 41
42 class GeoRectBench : public GeometryBench { 42 class GeoRectBench : public GeometryBench {
43 public: 43 public:
44 GeoRectBench(const char suffix[]) : GeometryBench(suffix) {} 44 GeoRectBench(const char suffix[]) : GeometryBench(suffix) {}
45 45
46 protected: 46 protected:
47 SkRect fRects[2048]; 47 SkRect fRects[2048];
48 48
49 virtual void onPreDraw() { 49 virtual void onDelayedSetup() {
50 const SkScalar min = -100; 50 const SkScalar min = -100;
51 const SkScalar max = 100; 51 const SkScalar max = 100;
52 SkRandom rand; 52 SkRandom rand;
53 for (size_t i = 0; i < SK_ARRAY_COUNT(fRects); ++i) { 53 for (size_t i = 0; i < SK_ARRAY_COUNT(fRects); ++i) {
54 SkScalar x = rand.nextRangeScalar(min, max); 54 SkScalar x = rand.nextRangeScalar(min, max);
55 SkScalar y = rand.nextRangeScalar(min, max); 55 SkScalar y = rand.nextRangeScalar(min, max);
56 SkScalar w = rand.nextRangeScalar(min, max); 56 SkScalar w = rand.nextRangeScalar(min, max);
57 SkScalar h = rand.nextRangeScalar(min, max); 57 SkScalar h = rand.nextRangeScalar(min, max);
58 fRects[i].setXYWH(x, y, w, h); 58 fRects[i].setXYWH(x, y, w, h);
59 } 59 }
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 for (int outer = 0; outer < loops; ++outer) { 237 for (int outer = 0; outer < loops; ++outer) {
238 SkChopCubicAt(fPts, dst, 0.5f); 238 SkChopCubicAt(fPts, dst, 0.5f);
239 SkChopCubicAt(fPts, dst, 0.5f); 239 SkChopCubicAt(fPts, dst, 0.5f);
240 SkChopCubicAt(fPts, dst, 0.5f); 240 SkChopCubicAt(fPts, dst, 0.5f);
241 SkChopCubicAt(fPts, dst, 0.5f); 241 SkChopCubicAt(fPts, dst, 0.5f);
242 } 242 }
243 } 243 }
244 }; 244 };
245 DEF_BENCH( return new ChopCubicAt; ) 245 DEF_BENCH( return new ChopCubicAt; )
246 246
OLDNEW
« no previous file with comments | « bench/GameBench.cpp ('k') | bench/GrResourceCacheBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698