| 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 26 matching lines...) Expand all Loading... |
| 37 paint.setImageFilter(imf); | 37 paint.setImageFilter(imf); |
| 38 paint.setAntiAlias(true); | 38 paint.setAntiAlias(true); |
| 39 canvas->drawCircle(r.centerX(), r.centerY(), r.width()*2/5, paint); | 39 canvas->drawCircle(r.centerX(), r.centerY(), r.width()*2/5, paint); |
| 40 } | 40 } |
| 41 | 41 |
| 42 static void draw_text(SkCanvas* canvas, const SkRect& r, SkImageFilter* imf) { | 42 static void draw_text(SkCanvas* canvas, const SkRect& r, SkImageFilter* imf) { |
| 43 SkPaint paint; | 43 SkPaint paint; |
| 44 paint.setImageFilter(imf); | 44 paint.setImageFilter(imf); |
| 45 paint.setColor(SK_ColorGREEN); | 45 paint.setColor(SK_ColorGREEN); |
| 46 paint.setAntiAlias(true); | 46 paint.setAntiAlias(true); |
| 47 sk_tool_utils::set_portable_typeface(&paint); | 47 sk_tool_utils::set_portable_typeface_always(&paint); |
| 48 paint.setTextSize(r.height()/2); | 48 paint.setTextSize(r.height()/2); |
| 49 paint.setTextAlign(SkPaint::kCenter_Align); | 49 paint.setTextAlign(SkPaint::kCenter_Align); |
| 50 canvas->drawText("Text", 4, r.centerX(), r.centerY(), paint); | 50 canvas->drawText("Text", 4, r.centerX(), r.centerY(), paint); |
| 51 } | 51 } |
| 52 | 52 |
| 53 static void draw_bitmap(SkCanvas* canvas, const SkRect& r, SkImageFilter* imf) { | 53 static void draw_bitmap(SkCanvas* canvas, const SkRect& r, SkImageFilter* imf) { |
| 54 SkPaint paint; | 54 SkPaint paint; |
| 55 | 55 |
| 56 SkIRect bounds; | 56 SkIRect bounds; |
| 57 r.roundOut(&bounds); | 57 r.roundOut(&bounds); |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 | 193 |
| 194 private: | 194 private: |
| 195 SkBitmap fCheckerboard; | 195 SkBitmap fCheckerboard; |
| 196 typedef GM INHERITED; | 196 typedef GM INHERITED; |
| 197 }; | 197 }; |
| 198 | 198 |
| 199 /////////////////////////////////////////////////////////////////////////////// | 199 /////////////////////////////////////////////////////////////////////////////// |
| 200 | 200 |
| 201 static skiagm::GM* MyFactory(void*) { return new ImageFiltersCroppedGM; } | 201 static skiagm::GM* MyFactory(void*) { return new ImageFiltersCroppedGM; } |
| 202 static skiagm::GMRegistry reg(MyFactory); | 202 static skiagm::GMRegistry reg(MyFactory); |
| OLD | NEW |