| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2006-2012 The Android Open Source Project | 2 * Copyright 2006-2012 The Android Open Source Project |
| 3 * Copyright 2012 Mozilla Foundation | 3 * Copyright 2012 Mozilla Foundation |
| 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 #ifndef SKFONTHOST_FREETYPE_COMMON_H_ | 9 #ifndef SKFONTHOST_FREETYPE_COMMON_H_ |
| 10 #define SKFONTHOST_FREETYPE_COMMON_H_ | 10 #define SKFONTHOST_FREETYPE_COMMON_H_ |
| 11 | 11 |
| 12 #include "SkGlyph.h" | 12 #include "SkGlyph.h" |
| 13 #include "SkScalerContext.h" | 13 #include "SkScalerContext.h" |
| 14 #include "SkTypeface.h" | 14 #include "SkTypeface.h" |
| 15 #include "SkTypes.h" | 15 #include "SkTypes.h" |
| 16 | 16 |
| 17 #include <ft2build.h> | 17 #include <ft2build.h> |
| 18 #include FT_FREETYPE_H | 18 #include FT_FREETYPE_H |
| 19 | 19 |
| 20 #ifdef SK_DEBUG | |
| 21 #define SkASSERT_CONTINUE(pred)
\ | |
| 22 do {
\ | |
| 23 if (!(pred))
\ | |
| 24 SkDebugf("file %s:%d: assert failed '" #pred "'\n", __FILE__, __
LINE__); \ | |
| 25 } while (false) | |
| 26 #else | |
| 27 #define SkASSERT_CONTINUE(pred) | |
| 28 #endif | |
| 29 | |
| 30 class SkScalerContext_FreeType_Base : public SkScalerContext { | 20 class SkScalerContext_FreeType_Base : public SkScalerContext { |
| 31 protected: | 21 protected: |
| 32 // See http://freetype.sourceforge.net/freetype2/docs/reference/ft2-bitmap_h
andling.html#FT_Bitmap_Embolden | 22 // See http://freetype.sourceforge.net/freetype2/docs/reference/ft2-bitmap_h
andling.html#FT_Bitmap_Embolden |
| 33 // This value was chosen by eyeballing the result in Firefox and trying to m
atch it. | 23 // This value was chosen by eyeballing the result in Firefox and trying to m
atch it. |
| 34 static const FT_Pos kBitmapEmboldenStrength = 1 << 6; | 24 static const FT_Pos kBitmapEmboldenStrength = 1 << 6; |
| 35 | 25 |
| 36 SkScalerContext_FreeType_Base(SkTypeface* typeface, const SkDescriptor *desc
) | 26 SkScalerContext_FreeType_Base(SkTypeface* typeface, const SkDescriptor *desc
) |
| 37 : INHERITED(typeface, desc) | 27 : INHERITED(typeface, desc) |
| 38 {} | 28 {} |
| 39 | 29 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 virtual size_t onGetTableData(SkFontTableTag, size_t offset, | 77 virtual size_t onGetTableData(SkFontTableTag, size_t offset, |
| 88 size_t length, void* data) const SK_OVERRIDE; | 78 size_t length, void* data) const SK_OVERRIDE; |
| 89 | 79 |
| 90 private: | 80 private: |
| 91 mutable int fGlyphCount; | 81 mutable int fGlyphCount; |
| 92 | 82 |
| 93 typedef SkTypeface INHERITED; | 83 typedef SkTypeface INHERITED; |
| 94 }; | 84 }; |
| 95 | 85 |
| 96 #endif // SKFONTHOST_FREETYPE_COMMON_H_ | 86 #endif // SKFONTHOST_FREETYPE_COMMON_H_ |
| OLD | NEW |