diff options
author | 2013-05-09 20:54:20 +0000 | |
---|---|---|
committer | 2013-05-09 20:54:20 +0000 | |
commit | 14451703f1a53d0ff14ffe4f44436526383a5fd4 (patch) | |
tree | 768b16530b1f97d6e1c9ddca4b14fca1c1268c71 /src/core/SkPaint.cpp | |
parent | 4a8084ced3fa5c73a364f96cadfa1fbfbea24ff6 (diff) |
API modifications needed to upstream Android font changes.
R=reed@google.com
Author: djsollen@google.com
Review URL: https://chromiumcodereview.appspot.com/14761003
git-svn-id: http://skia.googlecode.com/svn/trunk@9083 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/core/SkPaint.cpp')
-rw-r--r-- | src/core/SkPaint.cpp | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/core/SkPaint.cpp b/src/core/SkPaint.cpp index 6c16428d81..18cf651616 100644 --- a/src/core/SkPaint.cpp +++ b/src/core/SkPaint.cpp @@ -180,14 +180,19 @@ uint32_t SkPaint::getGenerationID() const { void SkPaint::setGenerationID(uint32_t generationID) { fGenerationID = generationID; } -#endif -#ifdef SK_BUILD_FOR_ANDROID unsigned SkPaint::getBaseGlyphCount(SkUnichar text) const { SkAutoGlyphCache autoCache(*this, NULL, NULL); SkGlyphCache* cache = autoCache.getCache(); return cache->getBaseGlyphCount(text); } + +void SkPaint::setPaintOptionsAndroid(const SkPaintOptionsAndroid& options) { + if(!memcmp(&fPaintOptionsAndroid, &options, sizeof(SkPaintOptionsAndroid))) { + fPaintOptionsAndroid = options; + GEN_ID_INC; + } +} #endif void SkPaint::setHinting(Hinting hintingLevel) { @@ -1806,6 +1811,13 @@ void SkPaint::descriptorProc(const SkDeviceProperties* deviceProperties, rec.fMaskFormat = SkMask::kA8_Format; // force antialiasing when we do the scan conversion } +#ifdef SK_BUILD_FOR_ANDROID + SkOrderedWriteBuffer androidBuffer(128); + fPaintOptionsAndroid.flatten(androidBuffer); + descSize += androidBuffer.size(); + entryCount += 1; +#endif + /////////////////////////////////////////////////////////////////////////// // Now that we're done tweaking the rec, call the PostMakeRec cleanup SkScalerContext::PostMakeRec(*this, &rec); @@ -1818,6 +1830,10 @@ void SkPaint::descriptorProc(const SkDeviceProperties* deviceProperties, desc->init(); desc->addEntry(kRec_SkDescriptorTag, sizeof(rec), &rec); +#ifdef SK_BUILD_FOR_ANDROID + add_flattenable(desc, kAndroidOpts_SkDescriptorTag, &androidBuffer); +#endif + if (pe) { add_flattenable(desc, kPathEffect_SkDescriptorTag, &peBuffer); } |