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

Side by Side Diff: bench/RectBench.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/RTreeBench.cpp ('k') | bench/RectanizerBench.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 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 #include "Benchmark.h" 8 #include "Benchmark.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkCommandLineFlags.h" 10 #include "SkCommandLineFlags.h"
(...skipping 30 matching lines...) Expand all
41 41
42 bool isVisual() override { return true; } 42 bool isVisual() override { return true; }
43 43
44 protected: 44 protected:
45 virtual void drawThisRect(SkCanvas* c, const SkRect& r, const SkPaint& p) { 45 virtual void drawThisRect(SkCanvas* c, const SkRect& r, const SkPaint& p) {
46 c->drawRect(r, p); 46 c->drawRect(r, p);
47 } 47 }
48 48
49 const char* onGetName() override { return computeName("rects"); } 49 const char* onGetName() override { return computeName("rects"); }
50 50
51 void onPreDraw() override { 51 void onDelayedSetup() override {
52 SkRandom rand; 52 SkRandom rand;
53 const SkScalar offset = SK_Scalar1/3; 53 const SkScalar offset = SK_Scalar1/3;
54 for (int i = 0; i < N; i++) { 54 for (int i = 0; i < N; i++) {
55 int x = rand.nextU() % W; 55 int x = rand.nextU() % W;
56 int y = rand.nextU() % H; 56 int y = rand.nextU() % H;
57 int w = rand.nextU() % W; 57 int w = rand.nextU() % W;
58 int h = rand.nextU() % H; 58 int h = rand.nextU() % H;
59 w >>= fShift; 59 w >>= fShift;
60 h >>= fShift; 60 h >>= fShift;
61 x -= w/2; 61 x -= w/2;
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 "maskopaque");) 302 "maskopaque");)
303 DEF_BENCH(return new BlitMaskBench(SkCanvas::kPoints_PointMode, 303 DEF_BENCH(return new BlitMaskBench(SkCanvas::kPoints_PointMode,
304 BlitMaskBench::kMaskBlack, 304 BlitMaskBench::kMaskBlack,
305 "maskblack");) 305 "maskblack");)
306 DEF_BENCH(return new BlitMaskBench(SkCanvas::kPoints_PointMode, 306 DEF_BENCH(return new BlitMaskBench(SkCanvas::kPoints_PointMode,
307 BlitMaskBench::kMaskColor, 307 BlitMaskBench::kMaskColor,
308 "maskcolor");) 308 "maskcolor");)
309 DEF_BENCH(return new BlitMaskBench(SkCanvas::kPoints_PointMode, 309 DEF_BENCH(return new BlitMaskBench(SkCanvas::kPoints_PointMode,
310 BlitMaskBench::KMaskShader, 310 BlitMaskBench::KMaskShader,
311 "maskshader");) 311 "maskshader");)
OLDNEW
« no previous file with comments | « bench/RTreeBench.cpp ('k') | bench/RectanizerBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698