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

Side by Side Diff: bench/RepeatTileBench.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/RectanizerBench.cpp ('k') | bench/SkipZeroesBench.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 "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 } 101 }
102 fName.printf("repeatTile_%s_%c", 102 fName.printf("repeatTile_%s_%c",
103 sk_tool_utils::colortype_name(ct), kOpaque_SkAlphaType == a t ? 'X' : 'A'); 103 sk_tool_utils::colortype_name(ct), kOpaque_SkAlphaType == a t ? 'X' : 'A');
104 } 104 }
105 105
106 protected: 106 protected:
107 const char* onGetName() override { 107 const char* onGetName() override {
108 return fName.c_str(); 108 return fName.c_str();
109 } 109 }
110 110
111 void onPreDraw() override { 111 void onDelayedSetup() override {
112 fBitmap.allocPixels(); 112 fBitmap.allocPixels();
113 fBitmap.eraseColor(kOpaque_SkAlphaType == fAlphaType ? SK_ColorWHITE : 0 ); 113 fBitmap.eraseColor(kOpaque_SkAlphaType == fAlphaType ? SK_ColorWHITE : 0 );
114 114
115 draw_into_bitmap(fBitmap); 115 draw_into_bitmap(fBitmap);
116 116
117 if (kIndex_8_SkColorType == fColorType) { 117 if (kIndex_8_SkColorType == fColorType) {
118 SkBitmap tmp; 118 SkBitmap tmp;
119 convert_to_index666(fBitmap, &tmp); 119 convert_to_index666(fBitmap, &tmp);
120 fBitmap = tmp; 120 fBitmap = tmp;
121 } 121 }
(...skipping 15 matching lines...) Expand all
137 } 137 }
138 138
139 private: 139 private:
140 typedef Benchmark INHERITED; 140 typedef Benchmark INHERITED;
141 }; 141 };
142 142
143 DEF_BENCH(return new RepeatTileBench(kN32_SkColorType, kOpaque_SkAlphaType)) 143 DEF_BENCH(return new RepeatTileBench(kN32_SkColorType, kOpaque_SkAlphaType))
144 DEF_BENCH(return new RepeatTileBench(kN32_SkColorType, kPremul_SkAlphaType)) 144 DEF_BENCH(return new RepeatTileBench(kN32_SkColorType, kPremul_SkAlphaType))
145 DEF_BENCH(return new RepeatTileBench(kRGB_565_SkColorType, kOpaque_SkAlphaType)) 145 DEF_BENCH(return new RepeatTileBench(kRGB_565_SkColorType, kOpaque_SkAlphaType))
146 DEF_BENCH(return new RepeatTileBench(kIndex_8_SkColorType, kPremul_SkAlphaType)) 146 DEF_BENCH(return new RepeatTileBench(kIndex_8_SkColorType, kPremul_SkAlphaType))
OLDNEW
« no previous file with comments | « bench/RectanizerBench.cpp ('k') | bench/SkipZeroesBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698