Chromium Code Reviews| 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 "SkRefCnt.h" | 8 #include "SkRefCnt.h" |
| 9 #include "SkScalar.h" | 9 #include "SkScalar.h" |
|
f(malita)
2014/05/30 15:02:44
Should these be inside the include guard?
reed1
2014/05/30 15:07:14
Done.
| |
| 10 | 10 |
| 11 #ifndef SkFont_DEFINED | |
| 12 #define SkFont_DEFINED | |
| 13 | |
| 11 class SkPaint; | 14 class SkPaint; |
| 12 class SkTypeface; | 15 class SkTypeface; |
| 13 | 16 |
| 14 enum SkTextEncoding { | 17 enum SkTextEncoding { |
| 15 kUTF8_SkTextEncoding, | 18 kUTF8_SkTextEncoding, |
| 16 kUTF16_SkTextEncoding, | 19 kUTF16_SkTextEncoding, |
| 17 kUTF32_SkTextEncoding, | 20 kUTF32_SkTextEncoding, |
| 18 kGlyphID_SkTextEncoding, | 21 kGlyphID_SkTextEncoding, |
| 19 }; | 22 }; |
| 20 | 23 |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 118 */ | 121 */ |
| 119 SkFont* cloneWithSize(SkScalar size) const; | 122 SkFont* cloneWithSize(SkScalar size) const; |
| 120 | 123 |
| 121 SkTypeface* getTypeface() const { return fTypeface; } | 124 SkTypeface* getTypeface() const { return fTypeface; } |
| 122 SkScalar getSize() const { return fSize; } | 125 SkScalar getSize() const { return fSize; } |
| 123 SkScalar getScaleX() const { return fScaleX; } | 126 SkScalar getScaleX() const { return fScaleX; } |
| 124 SkScalar getSkewX() const { return fSkewX; } | 127 SkScalar getSkewX() const { return fSkewX; } |
| 125 uint32_t getFlags() const { return fFlags; } | 128 uint32_t getFlags() const { return fFlags; } |
| 126 MaskType getMaskType() const { return (MaskType)fMaskType; } | 129 MaskType getMaskType() const { return (MaskType)fMaskType; } |
| 127 | 130 |
| 131 bool isVertical() const { return SkToBool(fFlags & kVertical_Flag); } | |
| 132 bool isEmbolden() const { return SkToBool(fFlags & kEmbolden_Flag); } | |
| 133 bool isEnableAutoHints() const { return SkToBool(fFlags & kEnableAutoHints_F lag); } | |
| 134 bool isEnableByteCodeHints() const { return SkToBool(fFlags & kEnableByteCod eHints_Flag); } | |
| 135 bool isUseNonLinearMetrics() const { return SkToBool(fFlags & kUseNonlinearM etrics_Flag); } | |
| 136 | |
| 128 int textToGlyphs(const void* text, size_t byteLength, SkTextEncoding, | 137 int textToGlyphs(const void* text, size_t byteLength, SkTextEncoding, |
| 129 uint16_t glyphs[], int maxGlyphCount) const; | 138 uint16_t glyphs[], int maxGlyphCount) const; |
| 130 | 139 |
| 131 SkScalar measureText(const void* text, size_t byteLength, SkTextEncoding) co nst; | 140 SkScalar measureText(const void* text, size_t byteLength, SkTextEncoding) co nst; |
| 132 | 141 |
| 133 static SkFont* Testing_CreateFromPaint(const SkPaint&); | 142 static SkFont* Testing_CreateFromPaint(const SkPaint&); |
| 134 | 143 |
| 135 private: | 144 private: |
| 136 enum { | 145 enum { |
| 137 kAllFlags = 0xFF, | 146 kAllFlags = 0xFF, |
| 138 }; | 147 }; |
| 139 | 148 |
| 140 SkFont(SkTypeface*, SkScalar size, SkScalar scaleX, SkScalar skewX, MaskType , uint32_t flags); | 149 SkFont(SkTypeface*, SkScalar size, SkScalar scaleX, SkScalar skewX, MaskType , uint32_t flags); |
| 141 virtual ~SkFont(); | 150 virtual ~SkFont(); |
| 142 | 151 |
| 143 SkTypeface* fTypeface; | 152 SkTypeface* fTypeface; |
| 144 SkScalar fSize; | 153 SkScalar fSize; |
| 145 SkScalar fScaleX; | 154 SkScalar fScaleX; |
| 146 SkScalar fSkewX; | 155 SkScalar fSkewX; |
| 147 uint16_t fFlags; | 156 uint16_t fFlags; |
| 148 uint8_t fMaskType; | 157 uint8_t fMaskType; |
| 149 // uint8_t fPad; | 158 // uint8_t fPad; |
| 150 }; | 159 }; |
| 160 | |
| 161 #endif | |
| OLD | NEW |