| OLD | NEW |
| 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 "SkImageFilter.h" | 9 #include "SkImageFilter.h" |
| 10 #include "SkRandom.h" | 10 #include "SkRandom.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 SkScalarInvert(RESIZE_FACTOR)); | 49 SkScalarInvert(RESIZE_FACTOR)); |
| 50 canvas->saveLayer(NULL, &paint); | 50 canvas->saveLayer(NULL, &paint); |
| 51 const char* str[] = { | 51 const char* str[] = { |
| 52 "The quick", | 52 "The quick", |
| 53 "brown fox", | 53 "brown fox", |
| 54 "jumped over", | 54 "jumped over", |
| 55 "the lazy dog.", | 55 "the lazy dog.", |
| 56 }; | 56 }; |
| 57 SkPaint textPaint; | 57 SkPaint textPaint; |
| 58 textPaint.setAntiAlias(true); | 58 textPaint.setAntiAlias(true); |
| 59 sk_tool_utils::set_portable_typeface(&textPaint); | 59 sk_tool_utils::set_portable_typeface_always(&textPaint); |
| 60 textPaint.setTextSize(SkIntToScalar(100)); | 60 textPaint.setTextSize(SkIntToScalar(100)); |
| 61 int posY = 0; | 61 int posY = 0; |
| 62 for (unsigned i = 0; i < SK_ARRAY_COUNT(str); i++) { | 62 for (unsigned i = 0; i < SK_ARRAY_COUNT(str); i++) { |
| 63 posY += 100; | 63 posY += 100; |
| 64 canvas->drawText(str[i], strlen(str[i]), SkIntToScalar(0), | 64 canvas->drawText(str[i], strlen(str[i]), SkIntToScalar(0), |
| 65 SkIntToScalar(posY), textPaint); | 65 SkIntToScalar(posY), textPaint); |
| 66 } | 66 } |
| 67 canvas->restore(); | 67 canvas->restore(); |
| 68 canvas->restore(); | 68 canvas->restore(); |
| 69 } | 69 } |
| 70 } | 70 } |
| 71 } | 71 } |
| 72 | 72 |
| 73 private: | 73 private: |
| 74 typedef GM INHERITED; | 74 typedef GM INHERITED; |
| 75 }; | 75 }; |
| 76 | 76 |
| 77 ////////////////////////////////////////////////////////////////////////////// | 77 ////////////////////////////////////////////////////////////////////////////// |
| 78 | 78 |
| 79 DEF_GM(return new ImageResizeTiledGM(); ) | 79 DEF_GM(return new ImageResizeTiledGM(); ) |
| 80 | 80 |
| 81 } | 81 } |
| OLD | NEW |