ws fixes
use enum in getHinting() function, rather than hard-coded constants git-svn-id: http://skia.googlecode.com/svn/trunk@290 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
parent
e4d0bc0b57
commit
e2ca20740b
@ -138,13 +138,13 @@ public:
|
||||
what will actually be done. This is an optimization so that the font
|
||||
cache does not contain different recs (i.e. keys) that in reality map to
|
||||
the same output.
|
||||
|
||||
|
||||
A lazy (but valid) fonthost can do nothing in its FilterRec routine.
|
||||
*/
|
||||
static void FilterRec(SkScalerContext::Rec* rec);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
/** Return the number of tables in the font
|
||||
*/
|
||||
static int CountTables(SkFontID);
|
||||
|
@ -126,7 +126,7 @@ struct SkMask {
|
||||
kJustRenderImage_CreateMode, //!< render into preallocate mask
|
||||
kComputeBoundsAndRenderImage_CreateMode //!< compute bounds, alloc image and render into it
|
||||
};
|
||||
|
||||
|
||||
static bool FormatIsLCD(Format fm) {
|
||||
return kHorizontalLCD_Format == fm || kVerticalLCD_Format == fm;
|
||||
}
|
||||
|
@ -155,6 +155,11 @@ public:
|
||||
kHintingBit1_Flag = 0x10,
|
||||
kHintingBit2_Flag = 0x20,
|
||||
};
|
||||
private:
|
||||
enum {
|
||||
kHintingMask = kHintingBit1_Flag | kHintingBit2_Flag
|
||||
};
|
||||
public:
|
||||
struct Rec {
|
||||
uint32_t fFontID;
|
||||
SkScalar fTextSize, fPreScaleX, fPreSkewX;
|
||||
@ -170,12 +175,11 @@ public:
|
||||
void getSingleMatrix(SkMatrix*) const;
|
||||
|
||||
SkPaint::Hinting getHinting() const {
|
||||
return static_cast<SkPaint::Hinting>((fFlags >> 4) & 3);
|
||||
return static_cast<SkPaint::Hinting>((fFlags & kHintingMask) >> 4);
|
||||
}
|
||||
|
||||
void setHinting(SkPaint::Hinting hinting) {
|
||||
fFlags = (fFlags & ~(kHintingBit1_Flag | kHintingBit2_Flag)) |
|
||||
(static_cast<int>(hinting) << 4);
|
||||
fFlags = (fFlags & ~kHintingMask) | (hinting << 4);
|
||||
}
|
||||
|
||||
SkMask::Format getFormat() const {
|
||||
|
Loading…
Reference in New Issue
Block a user