aboutsummaryrefslogtreecommitdiffstats
path: root/src/core/SkPaint.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/SkPaint.cpp')
-rw-r--r--src/core/SkPaint.cpp29
1 files changed, 24 insertions, 5 deletions
diff --git a/src/core/SkPaint.cpp b/src/core/SkPaint.cpp
index 52b0163..a607424 100644
--- a/src/core/SkPaint.cpp
+++ b/src/core/SkPaint.cpp
@@ -1303,17 +1303,36 @@ void SkScalerContext::MakeRec(const SkPaint& paint,
}
rec->fMaskFormat = SkToU8(computeMaskFormat(paint));
- rec->fFlags = SkToU8(flags);
- rec->setHinting(computeHinting(paint));
+
+ if (SkMask::kLCD16_Format == rec->fMaskFormat) {
+ SkFontHost::LCDOrder order = SkFontHost::GetSubpixelOrder();
+ SkFontHost::LCDOrientation orient = SkFontHost::GetSubpixelOrientation();
+ if (SkFontHost::kNONE_LCDOrder == order) {
+ // eeek, can't support LCD
+ rec->fMaskFormat = SkMask::kA8_Format;
+ } else {
+ if (SkFontHost::kVertical_LCDOrientation == orient) {
+ flags |= SkScalerContext::kLCD_Vertical_Flag;
+ }
+ if (SkFontHost::kBGR_LCDOrder == order) {
+ flags |= SkScalerContext::kLCD_BGROrder_Flag;
+ }
+ }
+ }
+
if (paint.isEmbeddedBitmapText()) {
- rec->fFlags |= SkScalerContext::kEmbeddedBitmapText_Flag;
+ flags |= SkScalerContext::kEmbeddedBitmapText_Flag;
}
if (paint.isSubpixelText()) {
- rec->fFlags |= SkScalerContext::kSubpixelPositioning_Flag;
+ flags |= SkScalerContext::kSubpixelPositioning_Flag;
}
if (paint.isAutohinted()) {
- rec->fFlags |= SkScalerContext::kAutohinting_Flag;
+ flags |= SkScalerContext::kAutohinting_Flag;
}
+ rec->fFlags = SkToU16(flags);
+
+ // setHinting modifies fFlags, so do this last
+ rec->setHinting(computeHinting(paint));
/* Allow the fonthost to modify our rec before we use it as a key into the
cache. This way if we're asking for something that they will ignore,