| 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 #include "gm.h" | 7 #include "gm.h" |
| 8 #include "Resources.h" | 8 #include "Resources.h" |
| 9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
| 10 #include "SkStream.h" | 10 #include "SkStream.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 } | 43 } |
| 44 | 44 |
| 45 static void rotate_about(SkCanvas* canvas, | 45 static void rotate_about(SkCanvas* canvas, |
| 46 SkScalar degrees, | 46 SkScalar degrees, |
| 47 SkScalar px, SkScalar py) { | 47 SkScalar px, SkScalar py) { |
| 48 canvas->translate(px, py); | 48 canvas->translate(px, py); |
| 49 canvas->rotate(degrees); | 49 canvas->rotate(degrees); |
| 50 canvas->translate(-px, -py); | 50 canvas->translate(-px, -py); |
| 51 } | 51 } |
| 52 | 52 |
| 53 virtual void onDraw(SkCanvas* inputCanvas) { | 53 virtual void onDraw(SkCanvas* inputCanvas) SK_OVERRIDE { |
| 54 #ifdef SK_BUILD_FOR_ANDROID | 54 #ifdef SK_BUILD_FOR_ANDROID |
| 55 SkScalar textSizes[] = { 9.0f, 9.0f*2.0f, 9.0f*5.0f, 9.0f*2.0f*5.0f }; | 55 SkScalar textSizes[] = { 9.0f, 9.0f*2.0f, 9.0f*5.0f, 9.0f*2.0f*5.0f }; |
| 56 #else | 56 #else |
| 57 SkScalar textSizes[] = { 11.0f, 11.0f*2.0f, 11.0f*5.0f, 11.0f*2.0f*5.0f
}; | 57 SkScalar textSizes[] = { 11.0f, 11.0f*2.0f, 11.0f*5.0f, 11.0f*2.0f*5.0f
}; |
| 58 #endif | 58 #endif |
| 59 SkScalar scales[] = { 2.0f*5.0f, 5.0f, 2.0f, 1.0f }; | 59 SkScalar scales[] = { 2.0f*5.0f, 5.0f, 2.0f, 1.0f }; |
| 60 | 60 |
| 61 // set up offscreen rendering with distance field text | 61 // set up offscreen rendering with distance field text |
| 62 #if SK_SUPPORT_GPU | 62 #if SK_SUPPORT_GPU |
| 63 GrContext* ctx = inputCanvas->getGrContext(); | 63 GrContext* ctx = inputCanvas->getGrContext(); |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 #endif | 213 #endif |
| 214 } | 214 } |
| 215 | 215 |
| 216 private: | 216 private: |
| 217 SkTypeface* fTypeface; | 217 SkTypeface* fTypeface; |
| 218 | 218 |
| 219 typedef skiagm::GM INHERITED; | 219 typedef skiagm::GM INHERITED; |
| 220 }; | 220 }; |
| 221 | 221 |
| 222 DEF_GM( return SkNEW(DFTextGM); ) | 222 DEF_GM( return SkNEW(DFTextGM); ) |
| OLD | NEW |