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

Side by Side Diff: bench/BitmapBench.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/BigPathBench.cpp ('k') | bench/BitmapRectBench.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 7
8 #include "Benchmark.h" 8 #include "Benchmark.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 if (fForceUpdate) { 103 if (fForceUpdate) {
104 fName.append("_update"); 104 fName.append("_update");
105 } 105 }
106 if (fIsVolatile) { 106 if (fIsVolatile) {
107 fName.append("_volatile"); 107 fName.append("_volatile");
108 } 108 }
109 109
110 return fName.c_str(); 110 return fName.c_str();
111 } 111 }
112 112
113 void onPreDraw() override { 113 void onDelayedSetup() override {
114 SkBitmap bm; 114 SkBitmap bm;
115 115
116 if (kIndex_8_SkColorType == fColorType) { 116 if (kIndex_8_SkColorType == fColorType) {
117 bm.allocPixels(SkImageInfo::MakeN32(W, H, fAlphaType)); 117 bm.allocPixels(SkImageInfo::MakeN32(W, H, fAlphaType));
118 } else { 118 } else {
119 bm.allocPixels(SkImageInfo::Make(W, H, fColorType, fAlphaType)); 119 bm.allocPixels(SkImageInfo::Make(W, H, fColorType, fAlphaType));
120 } 120 }
121 bm.eraseColor(kOpaque_SkAlphaType == fAlphaType ? SK_ColorBLACK : 0); 121 bm.eraseColor(kOpaque_SkAlphaType == fAlphaType ? SK_ColorBLACK : 0);
122 122
123 this->onDrawIntoBitmap(bm); 123 this->onDrawIntoBitmap(bm);
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 DEF_BENCH( return new FilterBitmapBench(kN32_SkColorType, kOpaque_SkAlphaType, t rue, false, kScale_Flag | kRotate_Flag | kBilerp_Flag); ) 381 DEF_BENCH( return new FilterBitmapBench(kN32_SkColorType, kOpaque_SkAlphaType, t rue, false, kScale_Flag | kRotate_Flag | kBilerp_Flag); )
382 382
383 DEF_BENCH( return new FilterBitmapBench(kN32_SkColorType, kPremul_SkAlphaType, f alse, false, kScale_Flag | kBilerp_Flag | kBicubic_Flag); ) 383 DEF_BENCH( return new FilterBitmapBench(kN32_SkColorType, kPremul_SkAlphaType, f alse, false, kScale_Flag | kBilerp_Flag | kBicubic_Flag); )
384 DEF_BENCH( return new FilterBitmapBench(kN32_SkColorType, kPremul_SkAlphaType, f alse, false, kScale_Flag | kRotate_Flag | kBilerp_Flag | kBicubic_Flag); ) 384 DEF_BENCH( return new FilterBitmapBench(kN32_SkColorType, kPremul_SkAlphaType, f alse, false, kScale_Flag | kRotate_Flag | kBilerp_Flag | kBicubic_Flag); )
385 385
386 // source alpha tests -> S32A_Opaque_BlitRow32_{arm,neon} 386 // source alpha tests -> S32A_Opaque_BlitRow32_{arm,neon}
387 DEF_BENCH( return new SourceAlphaBitmapBench(SourceAlphaBitmapBench::kOpaque_Sou rceAlpha, kN32_SkColorType); ) 387 DEF_BENCH( return new SourceAlphaBitmapBench(SourceAlphaBitmapBench::kOpaque_Sou rceAlpha, kN32_SkColorType); )
388 DEF_BENCH( return new SourceAlphaBitmapBench(SourceAlphaBitmapBench::kTransparen t_SourceAlpha, kN32_SkColorType); ) 388 DEF_BENCH( return new SourceAlphaBitmapBench(SourceAlphaBitmapBench::kTransparen t_SourceAlpha, kN32_SkColorType); )
389 DEF_BENCH( return new SourceAlphaBitmapBench(SourceAlphaBitmapBench::kTwoStripes _SourceAlpha, kN32_SkColorType); ) 389 DEF_BENCH( return new SourceAlphaBitmapBench(SourceAlphaBitmapBench::kTwoStripes _SourceAlpha, kN32_SkColorType); )
390 DEF_BENCH( return new SourceAlphaBitmapBench(SourceAlphaBitmapBench::kThreeStrip es_SourceAlpha, kN32_SkColorType); ) 390 DEF_BENCH( return new SourceAlphaBitmapBench(SourceAlphaBitmapBench::kThreeStrip es_SourceAlpha, kN32_SkColorType); )
OLDNEW
« no previous file with comments | « bench/BigPathBench.cpp ('k') | bench/BitmapRectBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698