| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 #include "SkPaint.h" | 9 #include "SkPaint.h" |
| 10 #include "SkAnnotation.h" | 10 #include "SkAnnotation.h" |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 } | 173 } |
| 174 | 174 |
| 175 #ifdef SK_BUILD_FOR_ANDROID | 175 #ifdef SK_BUILD_FOR_ANDROID |
| 176 uint32_t SkPaint::getGenerationID() const { | 176 uint32_t SkPaint::getGenerationID() const { |
| 177 return fGenerationID; | 177 return fGenerationID; |
| 178 } | 178 } |
| 179 | 179 |
| 180 void SkPaint::setGenerationID(uint32_t generationID) { | 180 void SkPaint::setGenerationID(uint32_t generationID) { |
| 181 fGenerationID = generationID; | 181 fGenerationID = generationID; |
| 182 } | 182 } |
| 183 #endif | |
| 184 | 183 |
| 185 #ifdef SK_BUILD_FOR_ANDROID | |
| 186 unsigned SkPaint::getBaseGlyphCount(SkUnichar text) const { | 184 unsigned SkPaint::getBaseGlyphCount(SkUnichar text) const { |
| 187 SkAutoGlyphCache autoCache(*this, NULL, NULL); | 185 SkAutoGlyphCache autoCache(*this, NULL, NULL); |
| 188 SkGlyphCache* cache = autoCache.getCache(); | 186 SkGlyphCache* cache = autoCache.getCache(); |
| 189 return cache->getBaseGlyphCount(text); | 187 return cache->getBaseGlyphCount(text); |
| 190 } | 188 } |
| 189 |
| 190 void SkPaint::setPaintOptionsAndroid(const SkPaintOptionsAndroid& options) { |
| 191 if(!memcmp(&fPaintOptionsAndroid, &options, sizeof(SkPaintOptionsAndroid)))
{ |
| 192 fPaintOptionsAndroid = options; |
| 193 GEN_ID_INC; |
| 194 } |
| 195 } |
| 191 #endif | 196 #endif |
| 192 | 197 |
| 193 void SkPaint::setHinting(Hinting hintingLevel) { | 198 void SkPaint::setHinting(Hinting hintingLevel) { |
| 194 GEN_ID_INC_EVAL((unsigned) hintingLevel != fHinting); | 199 GEN_ID_INC_EVAL((unsigned) hintingLevel != fHinting); |
| 195 fHinting = hintingLevel; | 200 fHinting = hintingLevel; |
| 196 } | 201 } |
| 197 | 202 |
| 198 void SkPaint::setFlags(uint32_t flags) { | 203 void SkPaint::setFlags(uint32_t flags) { |
| 199 GEN_ID_INC_EVAL(fFlags != flags); | 204 GEN_ID_INC_EVAL(fFlags != flags); |
| 200 fFlags = flags; | 205 fFlags = flags; |
| (...skipping 1443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1644 /** | 1649 /** |
| 1645 * A value of 0.5 for SK_GAMMA_CONTRAST appears to be a good compromise. | 1650 * A value of 0.5 for SK_GAMMA_CONTRAST appears to be a good compromise. |
| 1646 * With lower values small text appears washed out (though correctly so). | 1651 * With lower values small text appears washed out (though correctly so). |
| 1647 * With higher values lcd fringing is worse and the smoothing effect of | 1652 * With higher values lcd fringing is worse and the smoothing effect of |
| 1648 * partial coverage is diminished. | 1653 * partial coverage is diminished. |
| 1649 */ | 1654 */ |
| 1650 rec->setContrast(SkFloatToScalar(0.5f)); | 1655 rec->setContrast(SkFloatToScalar(0.5f)); |
| 1651 #endif | 1656 #endif |
| 1652 | 1657 |
| 1653 rec->fReservedAlign = 0; | 1658 rec->fReservedAlign = 0; |
| 1659 |
| 1660 #ifdef SK_BUILD_FOR_ANDROID |
| 1661 rec->fPaintOptionsAndroid = paint.getPaintOptionsAndroid(); |
| 1662 #endif //SK_BUILD_FOR_ANDROID |
| 1654 | 1663 |
| 1655 /* Allow the fonthost to modify our rec before we use it as a key into the | 1664 /* Allow the fonthost to modify our rec before we use it as a key into the |
| 1656 cache. This way if we're asking for something that they will ignore, | 1665 cache. This way if we're asking for something that they will ignore, |
| 1657 they can modify our rec up front, so we don't create duplicate cache | 1666 they can modify our rec up front, so we don't create duplicate cache |
| 1658 entries. | 1667 entries. |
| 1659 */ | 1668 */ |
| 1660 typeface->onFilterRec(rec); | 1669 typeface->onFilterRec(rec); |
| 1661 | 1670 |
| 1662 // be sure to call PostMakeRec(rec) before you actually use it! | 1671 // be sure to call PostMakeRec(rec) before you actually use it! |
| 1663 } | 1672 } |
| (...skipping 903 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2567 if (firstTime) { | 2576 if (firstTime) { |
| 2568 *dst = r; | 2577 *dst = r; |
| 2569 } else { | 2578 } else { |
| 2570 dst->join(r); | 2579 dst->join(r); |
| 2571 } | 2580 } |
| 2572 } else { | 2581 } else { |
| 2573 break; | 2582 break; |
| 2574 } | 2583 } |
| 2575 } | 2584 } |
| 2576 } | 2585 } |
| OLD | NEW |