From 14451703f1a53d0ff14ffe4f44436526383a5fd4 Mon Sep 17 00:00:00 2001 From: "commit-bot@chromium.org" Date: Thu, 9 May 2013 20:54:20 +0000 Subject: 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 --- src/core/SkPaint.cpp | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'src/core/SkPaint.cpp') 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); } -- cgit v1.2.3