| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 | 9 |
| 10 /* Tests text vertical text rendering with different fonts and centering. | 10 /* Tests text vertical text rendering with different fonts and centering. |
| 11 */ | 11 */ |
| 12 | 12 |
| 13 #include "gm.h" | 13 #include "gm.h" |
| 14 #include "SkCanvas.h" | 14 #include "SkCanvas.h" |
| 15 #include "SkTypeface.h" | 15 #include "SkTypeface.h" |
| 16 | 16 |
| 17 namespace skiagm { | 17 namespace skiagm { |
| 18 | 18 |
| 19 class VertText2GM : public GM { | 19 class VertText2GM : public GM { |
| 20 public: | 20 public: |
| 21 VertText2GM() { | 21 VertText2GM() { |
| 22 const int pointSize = 24; | 22 const int pointSize = 24; |
| 23 textHeight = SkIntToScalar(pointSize); | 23 textHeight = SkIntToScalar(pointSize); |
| 24 fProp = SkTypeface::CreateFromName("Helvetica", SkTypeface::kNormal); | 24 fProp = sk_tool_utils::create_portable_typeface("Helvetica", SkTypeface:
:kNormal); |
| 25 fMono = SkTypeface::CreateFromName("Courier New", SkTypeface::kNormal); | 25 fMono = sk_tool_utils::create_portable_typeface("Courier New", SkTypefac
e::kNormal); |
| 26 } | 26 } |
| 27 | 27 |
| 28 virtual ~VertText2GM() { | 28 virtual ~VertText2GM() { |
| 29 SkSafeUnref(fProp); | 29 SkSafeUnref(fProp); |
| 30 SkSafeUnref(fMono); | 30 SkSafeUnref(fMono); |
| 31 } | 31 } |
| 32 | 32 |
| 33 protected: | 33 protected: |
| 34 virtual uint32_t onGetFlags() const SK_OVERRIDE { | 34 virtual uint32_t onGetFlags() const SK_OVERRIDE { |
| 35 return kSkipTiled_Flag; | 35 return kSkipTiled_Flag; |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 SkTypeface* fProp; | 93 SkTypeface* fProp; |
| 94 SkTypeface* fMono; | 94 SkTypeface* fMono; |
| 95 }; | 95 }; |
| 96 | 96 |
| 97 /////////////////////////////////////////////////////////////////////////////// | 97 /////////////////////////////////////////////////////////////////////////////// |
| 98 | 98 |
| 99 static GM* MyFactory(void*) { return new VertText2GM; } | 99 static GM* MyFactory(void*) { return new VertText2GM; } |
| 100 static GMRegistry reg(MyFactory); | 100 static GMRegistry reg(MyFactory); |
| 101 | 101 |
| 102 } | 102 } |
| OLD | NEW |