diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/SkPaint.cpp | 6 | ||||
-rw-r--r-- | src/core/SkTextBlob.cpp | 7 |
2 files changed, 10 insertions, 3 deletions
diff --git a/src/core/SkPaint.cpp b/src/core/SkPaint.cpp index 2c1745d00b..9f76355aac 100644 --- a/src/core/SkPaint.cpp +++ b/src/core/SkPaint.cpp @@ -1291,9 +1291,9 @@ static bool justAColor(const SkPaint& paint, SkColor* color) { return true; } -static SkColor computeLuminanceColor(const SkPaint& paint) { +SkColor SkPaint::computeLuminanceColor() const { SkColor c; - if (!justAColor(paint, &c)) { + if (!justAColor(*this, &c)) { c = SkColorSetRGB(0x7F, 0x80, 0x7F); } return c; @@ -1463,7 +1463,7 @@ void SkScalerContext::MakeRec(const SkPaint& paint, // these modify fFlags, so do them after assigning fFlags rec->setHinting(computeHinting(paint)); - rec->setLuminanceColor(computeLuminanceColor(paint)); + rec->setLuminanceColor(paint.computeLuminanceColor()); if (NULL == deviceProperties) { rec->setDeviceGamma(SK_GAMMA_EXPONENT); diff --git a/src/core/SkTextBlob.cpp b/src/core/SkTextBlob.cpp index 3d396deba5..6ea081d764 100644 --- a/src/core/SkTextBlob.cpp +++ b/src/core/SkTextBlob.cpp @@ -47,6 +47,9 @@ public: bool operator!=(const RunFont& other) const { return !(*this == other); } + + uint32_t flags() const { return fFlags; } + private: const static uint32_t kFlagsMask = SkPaint::kAntiAlias_Flag | @@ -343,6 +346,10 @@ void SkTextBlob::RunIterator::applyFontToPaint(SkPaint* paint) const { fCurrentRun->font().applyToPaint(paint); } +bool SkTextBlob::RunIterator::isLCD() const { + return SkToBool(fCurrentRun->font().flags() & SkPaint::kLCDRenderText_Flag); +} + SkTextBlobBuilder::SkTextBlobBuilder() : fStorageSize(0) , fStorageUsed(0) |