OLD | NEW |
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 "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkColorFilter.h" | 10 #include "SkColorFilter.h" |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 paint.setImageFilter(imf); | 106 paint.setImageFilter(imf); |
107 paint.setAntiAlias(true); | 107 paint.setAntiAlias(true); |
108 canvas->drawCircle(r.centerX(), r.centerY(), r.width()*2/5, paint); | 108 canvas->drawCircle(r.centerX(), r.centerY(), r.width()*2/5, paint); |
109 } | 109 } |
110 | 110 |
111 static void draw_text(SkCanvas* canvas, const SkRect& r, SkImageFilter* imf) { | 111 static void draw_text(SkCanvas* canvas, const SkRect& r, SkImageFilter* imf) { |
112 SkPaint paint; | 112 SkPaint paint; |
113 paint.setImageFilter(imf); | 113 paint.setImageFilter(imf); |
114 paint.setColor(SK_ColorCYAN); | 114 paint.setColor(SK_ColorCYAN); |
115 paint.setAntiAlias(true); | 115 paint.setAntiAlias(true); |
| 116 sk_tool_utils::set_portable_typeface(&paint); |
116 paint.setTextSize(r.height()/2); | 117 paint.setTextSize(r.height()/2); |
117 paint.setTextAlign(SkPaint::kCenter_Align); | 118 paint.setTextAlign(SkPaint::kCenter_Align); |
118 canvas->drawText("Text", 4, r.centerX(), r.centerY(), paint); | 119 canvas->drawText("Text", 4, r.centerX(), r.centerY(), paint); |
119 } | 120 } |
120 | 121 |
121 static void draw_bitmap(SkCanvas* canvas, const SkRect& r, SkImageFilter* imf) { | 122 static void draw_bitmap(SkCanvas* canvas, const SkRect& r, SkImageFilter* imf) { |
122 SkPaint paint; | 123 SkPaint paint; |
123 paint.setImageFilter(imf); | 124 paint.setImageFilter(imf); |
124 | 125 |
125 SkIRect bounds; | 126 SkIRect bounds; |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 } | 227 } |
227 | 228 |
228 private: | 229 private: |
229 typedef GM INHERITED; | 230 typedef GM INHERITED; |
230 }; | 231 }; |
231 | 232 |
232 /////////////////////////////////////////////////////////////////////////////// | 233 /////////////////////////////////////////////////////////////////////////////// |
233 | 234 |
234 static skiagm::GM* MyFactory(void*) { return new ImageFiltersBaseGM; } | 235 static skiagm::GM* MyFactory(void*) { return new ImageFiltersBaseGM; } |
235 static skiagm::GMRegistry reg(MyFactory); | 236 static skiagm::GMRegistry reg(MyFactory); |
OLD | NEW |