OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 "SkColorFilter.h" | 9 #include "SkColorFilter.h" |
10 | 10 |
(...skipping 21 matching lines...) Expand all Loading... |
32 canvas->clipRect(r); | 32 canvas->clipRect(r); |
33 canvas->drawCircle(r.centerX(), r.centerY(), r.width()/3, paint); | 33 canvas->drawCircle(r.centerX(), r.centerY(), r.width()/3, paint); |
34 canvas->restore(); | 34 canvas->restore(); |
35 } | 35 } |
36 | 36 |
37 static void draw_text(SkCanvas* canvas, const SkRect& r, SkImageFilter* imf) { | 37 static void draw_text(SkCanvas* canvas, const SkRect& r, SkImageFilter* imf) { |
38 SkPaint paint; | 38 SkPaint paint; |
39 paint.setImageFilter(imf); | 39 paint.setImageFilter(imf); |
40 paint.setColor(SK_ColorGREEN); | 40 paint.setColor(SK_ColorGREEN); |
41 paint.setAntiAlias(true); | 41 paint.setAntiAlias(true); |
| 42 sk_tool_utils::set_portable_typeface(&paint); |
42 paint.setTextSize(r.height()/2); | 43 paint.setTextSize(r.height()/2); |
43 paint.setTextAlign(SkPaint::kCenter_Align); | 44 paint.setTextAlign(SkPaint::kCenter_Align); |
44 canvas->save(); | 45 canvas->save(); |
45 canvas->clipRect(r); | 46 canvas->clipRect(r); |
46 canvas->drawText("Text", 4, r.centerX(), r.centerY(), paint); | 47 canvas->drawText("Text", 4, r.centerX(), r.centerY(), paint); |
47 canvas->restore(); | 48 canvas->restore(); |
48 } | 49 } |
49 | 50 |
50 static void draw_bitmap(SkCanvas* canvas, const SkRect& r, SkImageFilter* imf) { | 51 static void draw_bitmap(SkCanvas* canvas, const SkRect& r, SkImageFilter* imf) { |
51 SkPaint paint; | 52 SkPaint paint; |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 } | 164 } |
164 | 165 |
165 private: | 166 private: |
166 typedef GM INHERITED; | 167 typedef GM INHERITED; |
167 }; | 168 }; |
168 | 169 |
169 /////////////////////////////////////////////////////////////////////////////// | 170 /////////////////////////////////////////////////////////////////////////////// |
170 | 171 |
171 static skiagm::GM* MyFactory(void*) { return new DropShadowImageFilterGM; } | 172 static skiagm::GM* MyFactory(void*) { return new DropShadowImageFilterGM; } |
172 static skiagm::GMRegistry reg(MyFactory); | 173 static skiagm::GMRegistry reg(MyFactory); |
OLD | NEW |