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

Side by Side Diff: bench/TextBench.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/SortBench.cpp ('k') | bench/TextBlobBench.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 8
9 #include "Benchmark.h" 9 #include "Benchmark.h"
10 #include "Resources.h" 10 #include "Resources.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 fPaint.setLCDRenderText(kLCD == fq); 62 fPaint.setLCDRenderText(kLCD == fq);
63 fPaint.setTextSize(SkIntToScalar(ps)); 63 fPaint.setTextSize(SkIntToScalar(ps));
64 fPaint.setColor(color); 64 fPaint.setColor(color);
65 } 65 }
66 66
67 virtual ~TextBench() { 67 virtual ~TextBench() {
68 delete[] fPos; 68 delete[] fPos;
69 } 69 }
70 70
71 protected: 71 protected:
72 void onPreDraw() override { 72 void onDelayedSetup() override {
73 if (fDoColorEmoji) { 73 if (fDoColorEmoji) {
74 SkASSERT(kBW == fFQ); 74 SkASSERT(kBW == fFQ);
75 fColorEmojiTypeface.reset(GetResourceAsTypeface("/fonts/Funkster.ttf ")); 75 fColorEmojiTypeface.reset(GetResourceAsTypeface("/fonts/Funkster.ttf "));
76 } 76 }
77 77
78 if (fDoPos) { 78 if (fDoPos) {
79 size_t len = fText.size(); 79 size_t len = fText.size();
80 SkScalar* adv = new SkScalar[len]; 80 SkScalar* adv = new SkScalar[len];
81 fPaint.getTextWidths(fText.c_str(), len, adv); 81 fPaint.getTextWidths(fText.c_str(), len, adv);
82 fPos = new SkPoint[len]; 82 fPos = new SkPoint[len];
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 DEF_BENCH( return new TextBench(STR, 16, 0xFFFF0000, kLCD); ) 169 DEF_BENCH( return new TextBench(STR, 16, 0xFFFF0000, kLCD); )
170 DEF_BENCH( return new TextBench(STR, 16, 0x88FF0000, kLCD); ) 170 DEF_BENCH( return new TextBench(STR, 16, 0x88FF0000, kLCD); )
171 171
172 DEF_BENCH( return new TextBench(STR, 16, 0xFFFFFFFF, kBW, true); ) 172 DEF_BENCH( return new TextBench(STR, 16, 0xFFFFFFFF, kBW, true); )
173 DEF_BENCH( return new TextBench(STR, 16, 0xFF000000, kBW, true); ) 173 DEF_BENCH( return new TextBench(STR, 16, 0xFF000000, kBW, true); )
174 DEF_BENCH( return new TextBench(STR, 16, 0xFFFF0000, kBW, true); ) 174 DEF_BENCH( return new TextBench(STR, 16, 0xFFFF0000, kBW, true); )
175 DEF_BENCH( return new TextBench(STR, 16, 0x88FF0000, kBW, true); ) 175 DEF_BENCH( return new TextBench(STR, 16, 0x88FF0000, kBW, true); )
176 176
177 DEF_BENCH( return new TextBench(STR, 16, 0xFF000000, kBW, true, true); ) 177 DEF_BENCH( return new TextBench(STR, 16, 0xFF000000, kBW, true, true); )
178 DEF_BENCH( return new TextBench(STR, 16, 0xFF000000, kAA, false, true); ) 178 DEF_BENCH( return new TextBench(STR, 16, 0xFF000000, kAA, false, true); )
OLDNEW
« no previous file with comments | « bench/SortBench.cpp ('k') | bench/TextBlobBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698