diff options
Diffstat (limited to 'include/core')
-rw-r--r-- | include/core/SkDrawFilter.h | 2 | ||||
-rw-r--r-- | include/core/SkFixed.h | 3 | ||||
-rw-r--r-- | include/core/SkFontHost.h | 24 | ||||
-rw-r--r-- | include/core/SkScalar.h | 2 | ||||
-rw-r--r-- | include/core/SkScalerContext.h | 1 |
5 files changed, 22 insertions, 10 deletions
diff --git a/include/core/SkDrawFilter.h b/include/core/SkDrawFilter.h index 1434391..c8af187 100644 --- a/include/core/SkDrawFilter.h +++ b/include/core/SkDrawFilter.h @@ -44,7 +44,7 @@ public: * Called with the paint that will be used to draw the specified type. * The implementation may modify the paint as they wish. */ - virtual void filter(SkPaint*, Type) {} + virtual void filter(SkPaint*, Type) = 0; }; #endif diff --git a/include/core/SkFixed.h b/include/core/SkFixed.h index c58c6de..8b56c50 100644 --- a/include/core/SkFixed.h +++ b/include/core/SkFixed.h @@ -111,6 +111,9 @@ inline SkFixed SkFixedFraction(SkFixed x) #define SkFixedAbs(x) SkAbs32(x) #define SkFixedAve(a, b) (((a) + (b)) >> 1) +// The same as SkIntToFixed(SkFixedFloor(x)) +#define SkFixedFloorToFixed(x) ((x) & ~0xFFFF) + SkFixed SkFixedMul_portable(SkFixed, SkFixed); SkFract SkFractMul_portable(SkFract, SkFract); inline SkFixed SkFixedSquare_portable(SkFixed value) diff --git a/include/core/SkFontHost.h b/include/core/SkFontHost.h index d0f7c65..e20ea05 100644 --- a/include/core/SkFontHost.h +++ b/include/core/SkFontHost.h @@ -150,14 +150,22 @@ public: */ static SkScalerContext* CreateScalerContext(const SkDescriptor* desc); - /** Given a "current" fontID, return the next logical fontID to use - when searching fonts for a given unicode value. Typically the caller - will query a given font, and if a unicode value is not supported, they - will call this, and if 0 is not returned, will search that font, and so - on. This process must be finite, and when the fonthost sees a - font with no logical successor, it must return 0. - */ - static uint32_t NextLogicalFont(SkFontID fontID); + /** + * Given a "current" fontID, return the next logical fontID to use + * when searching fonts for a given unicode value. Typically the caller + * will query a given font, and if a unicode value is not supported, they + * will call this, and if 0 is not returned, will search that font, and so + * on. This process must be finite, and when the fonthost sees a + * font with no logical successor, it must return 0. + * + * The original fontID is also provided. This is the initial font that was + * stored in the typeface of the caller. It is provided as an aid to choose + * the best next logical font. e.g. If the original font was bold or serif, + * but the 2nd in the logical chain was plain, then a subsequent call to + * get the 3rd can still inspect the original, and try to match its + * stylistic attributes. + */ + static SkFontID NextLogicalFont(SkFontID currFontID, SkFontID origFontID); /////////////////////////////////////////////////////////////////////////// diff --git a/include/core/SkScalar.h b/include/core/SkScalar.h index 5dbf684..ba113f4 100644 --- a/include/core/SkScalar.h +++ b/include/core/SkScalar.h @@ -18,6 +18,7 @@ #define SkScalar_DEFINED #include "SkFixed.h" +#include "SkFloatingPoint.h" /** \file SkScalar.h @@ -29,7 +30,6 @@ */ #ifdef SK_SCALAR_IS_FLOAT - #include "SkFloatingPoint.h" /** SkScalar is our type for fractional values and coordinates. Depending on compile configurations, it is either represented as an IEEE float, or diff --git a/include/core/SkScalerContext.h b/include/core/SkScalerContext.h index 3f818a3..cbbbdf0 100644 --- a/include/core/SkScalerContext.h +++ b/include/core/SkScalerContext.h @@ -189,6 +189,7 @@ private: }; public: struct Rec { + uint32_t fOrigFontID; uint32_t fFontID; SkScalar fTextSize, fPreScaleX, fPreSkewX; SkScalar fPost2x2[2][2]; |