| 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 | 8 |
| 9 #include "gm.h" | 9 #include "gm.h" |
| 10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 | 50 |
| 51 protected: | 51 protected: |
| 52 virtual uint32_t onGetFlags() const SK_OVERRIDE { | 52 virtual uint32_t onGetFlags() const SK_OVERRIDE { |
| 53 return kSkipTiled_Flag; | 53 return kSkipTiled_Flag; |
| 54 } | 54 } |
| 55 | 55 |
| 56 SkString onShortName() { | 56 SkString onShortName() { |
| 57 return SkString("verttext"); | 57 return SkString("verttext"); |
| 58 } | 58 } |
| 59 | 59 |
| 60 SkISize onISize() { return make_isize(640, 480); } | 60 SkISize onISize() { return SkISize::Make(640, 480); } |
| 61 | 61 |
| 62 static void drawBaseline(SkCanvas* canvas, const SkPaint& paint, | 62 static void drawBaseline(SkCanvas* canvas, const SkPaint& paint, |
| 63 SkScalar x, SkScalar y) { | 63 SkScalar x, SkScalar y) { |
| 64 SkScalar total = paint.measureText(gText, gLen); | 64 SkScalar total = paint.measureText(gText, gLen); |
| 65 | 65 |
| 66 SkPaint p; | 66 SkPaint p; |
| 67 p.setAntiAlias(true); | 67 p.setAntiAlias(true); |
| 68 p.setColor(0x80FF0000); | 68 p.setColor(0x80FF0000); |
| 69 canvas->drawLine(x, y, | 69 canvas->drawLine(x, y, |
| 70 paint.isVerticalText() ? x : x + total, | 70 paint.isVerticalText() ? x : x + total, |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 private: | 114 private: |
| 115 typedef GM INHERITED; | 115 typedef GM INHERITED; |
| 116 }; | 116 }; |
| 117 | 117 |
| 118 /////////////////////////////////////////////////////////////////////////////// | 118 /////////////////////////////////////////////////////////////////////////////// |
| 119 | 119 |
| 120 static GM* MyFactory(void*) { return new VertTextGM; } | 120 static GM* MyFactory(void*) { return new VertTextGM; } |
| 121 static GMRegistry reg(MyFactory); | 121 static GMRegistry reg(MyFactory); |
| 122 | 122 |
| 123 } | 123 } |
| OLD | NEW |