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

Side by Side Diff: bench/AlternatingColorPatternBench.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 | « no previous file | bench/Benchmark.h » ('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 "SkGradientShader.h" 10 #include "SkGradientShader.h"
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 106
107 virtual ~AlternatingColorPatternBench() { 107 virtual ~AlternatingColorPatternBench() {
108 SkSafeUnref(fBmShader); 108 SkSafeUnref(fBmShader);
109 } 109 }
110 110
111 protected: 111 protected:
112 const char* onGetName() override { 112 const char* onGetName() override {
113 return fName.c_str(); 113 return fName.c_str();
114 } 114 }
115 115
116 void onPreDraw() override { 116 void onDelayedSetup() override {
117 int w = 40; 117 int w = 40;
118 int h = 40; 118 int h = 40;
119 makebm(&fBmp, w, h); 119 makebm(&fBmp, w, h);
120 fBmShader = SkShader::CreateBitmapShader(fBmp, 120 fBmShader = SkShader::CreateBitmapShader(fBmp,
121 SkShader::kRepeat_TileMode, 121 SkShader::kRepeat_TileMode,
122 SkShader::kRepeat_TileMode); 122 SkShader::kRepeat_TileMode);
123 int offset = 2; 123 int offset = 2;
124 int count = 0; 124 int count = 0;
125 for (int j = 0; j < NY; ++j) { 125 for (int j = 0; j < NY; ++j) {
126 for (int i = 0; i < NX; ++i) { 126 for (int i = 0; i < NX; ++i) {
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 191
192 DEF_BENCH(return new AlternatingColorPatternBench(kOpaqueBitmap_ColorPattern, 192 DEF_BENCH(return new AlternatingColorPatternBench(kOpaqueBitmap_ColorPattern,
193 kOpaqueBitmap_ColorPattern, 193 kOpaqueBitmap_ColorPattern,
194 kRect_DrawType);) 194 kRect_DrawType);)
195 DEF_BENCH(return new AlternatingColorPatternBench(kAlphaBitmap_ColorPattern, 195 DEF_BENCH(return new AlternatingColorPatternBench(kAlphaBitmap_ColorPattern,
196 kAlphaBitmap_ColorPattern, 196 kAlphaBitmap_ColorPattern,
197 kRect_DrawType);) 197 kRect_DrawType);)
198 DEF_BENCH(return new AlternatingColorPatternBench(kOpaqueBitmap_ColorPattern, 198 DEF_BENCH(return new AlternatingColorPatternBench(kOpaqueBitmap_ColorPattern,
199 kAlphaBitmap_ColorPattern, 199 kAlphaBitmap_ColorPattern,
200 kRect_DrawType);) 200 kRect_DrawType);)
OLDNEW
« no previous file with comments | « no previous file | bench/Benchmark.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698