diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-03-01 22:32:51 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-03-01 22:32:51 +0000 |
commit | 10d2d4d1062ef56526f187e6716c5e747689b598 (patch) | |
tree | a5c9ca79855fcd77d5b6118f08b555bec3f7ad7a /src/core | |
parent | b665a6b148826eecb4f425c57e8a0df0ec63f016 (diff) |
move the post cleanup of the rec until after we wack it for maskfilter
git-svn-id: http://skia.googlecode.com/svn/trunk@3297 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/SkPaint.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/core/SkPaint.cpp b/src/core/SkPaint.cpp index 52d771e8e3..47743bd239 100644 --- a/src/core/SkPaint.cpp +++ b/src/core/SkPaint.cpp @@ -1509,6 +1509,19 @@ void SkScalerContext::MakeRec(const SkPaint& paint, */ SkFontHost::FilterRec(rec); + // be sure to call PostMakeRec(rec) before you actually use it! +} + +/** + * We ensure that the rec is self-consistent and efficient (where possible) + */ +void SkScalerContext::PostMakeRec(SkScalerContext::Rec* rec) { + + /** + * If we're asking for A8, we force the colorlum to be gray, since that + * that limits the number of unique entries, and the scaler will only + * look at the lum of one of them. + */ switch (rec->fMaskFormat) { case SkMask::kLCD16_Format: case SkMask::kLCD32_Format: { @@ -1600,6 +1613,11 @@ void SkPaint::descriptorProc(const SkMatrix* deviceMatrix, entryCount += 1; rec.fMaskFormat = SkMask::kA8_Format; // force antialiasing when we do the scan conversion } + + /////////////////////////////////////////////////////////////////////////// + // Now that we're done tweaking the rec, call the PostMakeRec cleanup + SkScalerContext::PostMakeRec(&rec); + descSize += SkDescriptor::ComputeOverhead(entryCount); SkAutoDescriptor ad(descSize); |