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

Side by Side Diff: gm/variedtext.cpp

Issue 873753002: Spin off GM::runAsBench() from flags. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 11 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 | « gm/multipicturedraw.cpp ('k') | no next file » | 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 "gm.h" 8 #include "gm.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkPath.h" 10 #include "SkPath.h"
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 wirePaint.setStyle(SkPaint::kStroke_Style); 132 wirePaint.setStyle(SkPaint::kStroke_Style);
133 for (int i = 0; i < kCnt; ++i) { 133 for (int i = 0; i < kCnt; ++i) {
134 canvas->drawRect(fClipRects[i], wirePaint); 134 canvas->drawRect(fClipRects[i], wirePaint);
135 } 135 }
136 } 136 }
137 } 137 }
138 138
139 uint32_t onGetFlags() const SK_OVERRIDE { 139 uint32_t onGetFlags() const SK_OVERRIDE {
140 // The aa hairline stroked rects used to visualize the clip draw slightl y differently in 140 // The aa hairline stroked rects used to visualize the clip draw slightl y differently in
141 // quilt mode in dm. 141 // quilt mode in dm.
142 return kAsBench_Flag | kSkipTiled_Flag; 142 return kSkipTiled_Flag;
143 } 143 }
144 bool runAsBench() const SK_OVERRIDE { return true; }
144 145
145 private: 146 private:
146 static const int kCnt = 30; 147 static const int kCnt = 30;
147 static const int kMinLength = 15; 148 static const int kMinLength = 15;
148 static const int kMaxLength = 40; 149 static const int kMaxLength = 40;
149 150
150 bool fEffectiveClip; 151 bool fEffectiveClip;
151 bool fLCD; 152 bool fLCD;
152 SkTypeface* fTypefacesToUnref[4]; 153 SkTypeface* fTypefacesToUnref[4];
153 SkPaint fPaint; 154 SkPaint fPaint;
154 155
155 // precomputed for each text draw 156 // precomputed for each text draw
156 SkString fStrings[kCnt]; 157 SkString fStrings[kCnt];
157 SkColor fColors[kCnt]; 158 SkColor fColors[kCnt];
158 SkScalar fPtSizes[kCnt]; 159 SkScalar fPtSizes[kCnt];
159 SkTypeface* fTypefaces[kCnt]; 160 SkTypeface* fTypefaces[kCnt];
160 SkPoint fPositions[kCnt]; 161 SkPoint fPositions[kCnt];
161 SkRect fClipRects[kCnt]; 162 SkRect fClipRects[kCnt];
162 163
163 typedef skiagm::GM INHERITED; 164 typedef skiagm::GM INHERITED;
164 }; 165 };
165 166
166 DEF_GM( return SkNEW(VariedTextGM(false, false)); ) 167 DEF_GM( return SkNEW(VariedTextGM(false, false)); )
167 DEF_GM( return SkNEW(VariedTextGM(true, false)); ) 168 DEF_GM( return SkNEW(VariedTextGM(true, false)); )
168 DEF_GM( return SkNEW(VariedTextGM(false, true)); ) 169 DEF_GM( return SkNEW(VariedTextGM(false, true)); )
169 DEF_GM( return SkNEW(VariedTextGM(true, true)); ) 170 DEF_GM( return SkNEW(VariedTextGM(true, true)); )
OLDNEW
« no previous file with comments | « gm/multipicturedraw.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698