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

Side by Side Diff: gm/imageblurtiled.cpp

Issue 407183003: add portable and canonical font support for DM (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add atexit; rename to create_... Created 6 years, 4 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/imageblur.cpp ('k') | gm/imagefiltersbase.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 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 "SkBlurImageFilter.h" 9 #include "SkBlurImageFilter.h"
10 #include "SkRandom.h" 10 #include "SkRandom.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 canvas->clipRect(SkRect::MakeXYWH(x, y, tile_size, tile_size)); 43 canvas->clipRect(SkRect::MakeXYWH(x, y, tile_size, tile_size));
44 canvas->saveLayer(NULL, &paint); 44 canvas->saveLayer(NULL, &paint);
45 const char* str[] = { 45 const char* str[] = {
46 "The quick", 46 "The quick",
47 "brown fox", 47 "brown fox",
48 "jumped over", 48 "jumped over",
49 "the lazy dog.", 49 "the lazy dog.",
50 }; 50 };
51 SkPaint textPaint; 51 SkPaint textPaint;
52 textPaint.setAntiAlias(true); 52 textPaint.setAntiAlias(true);
53 sk_tool_utils::set_portable_typeface(&textPaint);
53 textPaint.setTextSize(SkIntToScalar(100)); 54 textPaint.setTextSize(SkIntToScalar(100));
54 int posY = 0; 55 int posY = 0;
55 for (unsigned i = 0; i < SK_ARRAY_COUNT(str); i++) { 56 for (unsigned i = 0; i < SK_ARRAY_COUNT(str); i++) {
56 posY += 100; 57 posY += 100;
57 canvas->drawText(str[i], strlen(str[i]), SkIntToScalar(0), 58 canvas->drawText(str[i], strlen(str[i]), SkIntToScalar(0),
58 SkIntToScalar(posY), textPaint); 59 SkIntToScalar(posY), textPaint);
59 } 60 }
60 canvas->restore(); 61 canvas->restore();
61 canvas->restore(); 62 canvas->restore();
62 } 63 }
63 } 64 }
64 } 65 }
65 66
66 private: 67 private:
67 SkScalar fSigmaX; 68 SkScalar fSigmaX;
68 SkScalar fSigmaY; 69 SkScalar fSigmaY;
69 70
70 typedef GM INHERITED; 71 typedef GM INHERITED;
71 }; 72 };
72 73
73 ////////////////////////////////////////////////////////////////////////////// 74 //////////////////////////////////////////////////////////////////////////////
74 75
75 static GM* MyFactory1(void*) { return new ImageBlurTiledGM(3.0f, 3.0f); } 76 static GM* MyFactory1(void*) { return new ImageBlurTiledGM(3.0f, 3.0f); }
76 static GMRegistry reg1(MyFactory1); 77 static GMRegistry reg1(MyFactory1);
77 78
78 } 79 }
OLDNEW
« no previous file with comments | « gm/imageblur.cpp ('k') | gm/imagefiltersbase.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698