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 2260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2271 this->getMaskFilter()->computeFastBounds(*storage, storage); | 2271 this->getMaskFilter()->computeFastBounds(*storage, storage); |
2272 } | 2272 } |
2273 | 2273 |
2274 if (this->getImageFilter()) { | 2274 if (this->getImageFilter()) { |
2275 this->getImageFilter()->computeFastBounds(*storage, storage); | 2275 this->getImageFilter()->computeFastBounds(*storage, storage); |
2276 } | 2276 } |
2277 | 2277 |
2278 return *storage; | 2278 return *storage; |
2279 } | 2279 } |
2280 | 2280 |
2281 #ifdef SK_DEVELOPER | 2281 #ifndef SK_IGNORE_TO_STRING |
2282 void SkPaint::toString(SkString* str) const { | 2282 void SkPaint::toString(SkString* str) const { |
2283 str->append("<dl><dt>SkPaint:</dt><dd><dl>"); | 2283 str->append("<dl><dt>SkPaint:</dt><dd><dl>"); |
2284 | 2284 |
2285 SkTypeface* typeface = this->getTypeface(); | 2285 SkTypeface* typeface = this->getTypeface(); |
2286 if (NULL != typeface) { | 2286 if (NULL != typeface) { |
2287 SkDynamicMemoryWStream ostream; | 2287 SkDynamicMemoryWStream ostream; |
2288 typeface->serialize(&ostream); | 2288 typeface->serialize(&ostream); |
2289 SkAutoTUnref<SkData> data(ostream.copyToData()); | 2289 SkAutoTUnref<SkData> data(ostream.copyToData()); |
2290 | 2290 |
2291 SkMemoryStream stream(data); | 2291 SkMemoryStream stream(data); |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2441 | 2441 |
2442 str->append("<dt>Hinting:</dt><dd>"); | 2442 str->append("<dt>Hinting:</dt><dd>"); |
2443 static const char* gHintingStrings[] = { "None", "Slight", "Normal", "Full"
}; | 2443 static const char* gHintingStrings[] = { "None", "Slight", "Normal", "Full"
}; |
2444 str->append(gHintingStrings[this->getHinting()]); | 2444 str->append(gHintingStrings[this->getHinting()]); |
2445 str->append("</dd>"); | 2445 str->append("</dd>"); |
2446 | 2446 |
2447 str->append("</dd></dl></dl>"); | 2447 str->append("</dd></dl></dl>"); |
2448 } | 2448 } |
2449 #endif | 2449 #endif |
2450 | 2450 |
2451 | |
2452 /////////////////////////////////////////////////////////////////////////////// | 2451 /////////////////////////////////////////////////////////////////////////////// |
2453 | 2452 |
2454 static bool has_thick_frame(const SkPaint& paint) { | 2453 static bool has_thick_frame(const SkPaint& paint) { |
2455 return paint.getStrokeWidth() > 0 && | 2454 return paint.getStrokeWidth() > 0 && |
2456 paint.getStyle() != SkPaint::kFill_Style; | 2455 paint.getStyle() != SkPaint::kFill_Style; |
2457 } | 2456 } |
2458 | 2457 |
2459 SkTextToPathIter::SkTextToPathIter( const char text[], size_t length, | 2458 SkTextToPathIter::SkTextToPathIter( const char text[], size_t length, |
2460 const SkPaint& paint, | 2459 const SkPaint& paint, |
2461 bool applyStrokeAndPathEffects) | 2460 bool applyStrokeAndPathEffects) |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2658 } | 2657 } |
2659 #ifdef SK_BUILD_FOR_ANDROID | 2658 #ifdef SK_BUILD_FOR_ANDROID |
2660 if (dirty & kPaintOptionsAndroid_DirtyBit) { | 2659 if (dirty & kPaintOptionsAndroid_DirtyBit) { |
2661 SkPaintOptionsAndroid options; | 2660 SkPaintOptionsAndroid options; |
2662 options.unflatten(buffer); | 2661 options.unflatten(buffer); |
2663 paint->setPaintOptionsAndroid(options); | 2662 paint->setPaintOptionsAndroid(options); |
2664 } | 2663 } |
2665 #endif | 2664 #endif |
2666 SkASSERT(dirty == paint->fDirtyBits); | 2665 SkASSERT(dirty == paint->fDirtyBits); |
2667 } | 2666 } |
OLD | NEW |