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

Side by Side Diff: gm/texteffects.cpp

Issue 1244833002: make stroketext textblob* texteffects tileimagefilter gm portable (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 5 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/textblobuseaftergpufree.cpp ('k') | gm/tileimagefilter.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 "gm.h" 8 #include "gm.h"
9 #include "SkBlurMask.h" 9 #include "SkBlurMask.h"
10 #include "SkBlurMaskFilter.h" 10 #include "SkBlurMaskFilter.h"
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 181
182 SkISize onISize() override { 182 SkISize onISize() override {
183 return SkISize::Make(460, 680); 183 return SkISize::Make(460, 680);
184 } 184 }
185 185
186 void onDraw(SkCanvas* canvas) override { 186 void onDraw(SkCanvas* canvas) override {
187 canvas->save(); 187 canvas->save();
188 188
189 SkPaint paint; 189 SkPaint paint;
190 paint.setAntiAlias(true); 190 paint.setAntiAlias(true);
191 sk_tool_utils::set_portable_typeface(&paint); 191 sk_tool_utils::set_portable_typeface_always(&paint);
192 paint.setTextSize(SkIntToScalar(56)); 192 paint.setTextSize(SkIntToScalar(56));
193 193
194 SkScalar x = SkIntToScalar(20); 194 SkScalar x = SkIntToScalar(20);
195 SkScalar y = paint.getTextSize(); 195 SkScalar y = paint.getTextSize();
196 196
197 SkString str("Hamburgefons"); 197 SkString str("Hamburgefons");
198 198
199 for (int i = 0; i < static_cast<int>(SK_ARRAY_COUNT(gRastProcs)); i++) { 199 for (int i = 0; i < static_cast<int>(SK_ARRAY_COUNT(gRastProcs)); i++) {
200 apply_shader(&paint, i); 200 apply_shader(&paint, i);
201 201
202 // paint.setMaskFilter(NULL); 202 // paint.setMaskFilter(NULL);
203 // paint.setColor(SK_ColorBLACK); 203 // paint.setColor(SK_ColorBLACK);
204 204
205 canvas->drawText(str.c_str(), str.size(), x, y, paint); 205 canvas->drawText(str.c_str(), str.size(), x, y, paint);
206 206
207 y += paint.getFontSpacing(); 207 y += paint.getFontSpacing();
208 } 208 }
209 209
210 canvas->restore(); 210 canvas->restore();
211 } 211 }
212 212
213 private: 213 private:
214 typedef skiagm::GM INHERITED; 214 typedef skiagm::GM INHERITED;
215 }; 215 };
216 216
217 ////////////////////////////////////////////////////////////////////////////// 217 //////////////////////////////////////////////////////////////////////////////
218 218
219 static skiagm::GM* MyFactory(void*) { return new TextEffectsGM; } 219 static skiagm::GM* MyFactory(void*) { return new TextEffectsGM; }
220 static skiagm::GMRegistry reg(MyFactory); 220 static skiagm::GMRegistry reg(MyFactory);
OLDNEW
« no previous file with comments | « gm/textblobuseaftergpufree.cpp ('k') | gm/tileimagefilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698