| OLD | NEW |
| 1 | |
| 2 /* | 1 /* |
| 3 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
| 4 * | 3 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 7 */ | 6 */ |
| 8 | 7 |
| 9 #include "SkPaint.h" | 8 #include "SkPaint.h" |
| 10 #include "SkAnnotation.h" | 9 #include "SkAnnotation.h" |
| 11 #include "SkAutoKern.h" | 10 #include "SkAutoKern.h" |
| (...skipping 2163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2175 const uint32_t* pod = reinterpret_cast<const uint32_t*>(podData); | 2174 const uint32_t* pod = reinterpret_cast<const uint32_t*>(podData); |
| 2176 | 2175 |
| 2177 // the order we read must match the order we wrote in flatten() | 2176 // the order we read must match the order we wrote in flatten() |
| 2178 this->setTextSize(read_scalar(pod)); | 2177 this->setTextSize(read_scalar(pod)); |
| 2179 this->setTextScaleX(read_scalar(pod)); | 2178 this->setTextScaleX(read_scalar(pod)); |
| 2180 this->setTextSkewX(read_scalar(pod)); | 2179 this->setTextSkewX(read_scalar(pod)); |
| 2181 this->setStrokeWidth(read_scalar(pod)); | 2180 this->setStrokeWidth(read_scalar(pod)); |
| 2182 this->setStrokeMiter(read_scalar(pod)); | 2181 this->setStrokeMiter(read_scalar(pod)); |
| 2183 this->setColor(*pod++); | 2182 this->setColor(*pod++); |
| 2184 | 2183 |
| 2185 const int picVer = buffer.pictureVersion(); | |
| 2186 unsigned flatFlags = 0; | 2184 unsigned flatFlags = 0; |
| 2187 if (picVer > 0 && picVer <= 22) { | 2185 if (buffer.pictureVersionLT(SkReadBuffer::kFilterLevelIsEnum_PictureVersion)
) { |
| 2188 flatFlags = unpack_paint_flags_v22(this, *pod++); | 2186 flatFlags = unpack_paint_flags_v22(this, *pod++); |
| 2189 } else { | 2187 } else { |
| 2190 flatFlags = unpack_paint_flags(this, *pod++); | 2188 flatFlags = unpack_paint_flags(this, *pod++); |
| 2191 } | 2189 } |
| 2192 | 2190 |
| 2193 uint32_t tmp = *pod++; | 2191 uint32_t tmp = *pod++; |
| 2194 this->setStrokeCap(static_cast<Cap>((tmp >> 24) & 0xFF)); | 2192 this->setStrokeCap(static_cast<Cap>((tmp >> 24) & 0xFF)); |
| 2195 this->setStrokeJoin(static_cast<Join>((tmp >> 16) & 0xFF)); | 2193 this->setStrokeJoin(static_cast<Join>((tmp >> 16) & 0xFF)); |
| 2196 this->setStyle(static_cast<Style>((tmp >> 8) & 0xFF)); | 2194 this->setStyle(static_cast<Style>((tmp >> 8) & 0xFF)); |
| 2197 this->setTextEncoding(static_cast<TextEncoding>((tmp >> 0) & 0xFF)); | 2195 this->setTextEncoding(static_cast<TextEncoding>((tmp >> 0) & 0xFF)); |
| (...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2736 } | 2734 } |
| 2737 #ifdef SK_BUILD_FOR_ANDROID | 2735 #ifdef SK_BUILD_FOR_ANDROID |
| 2738 if (dirty & kPaintOptionsAndroid_DirtyBit) { | 2736 if (dirty & kPaintOptionsAndroid_DirtyBit) { |
| 2739 SkPaintOptionsAndroid options; | 2737 SkPaintOptionsAndroid options; |
| 2740 options.unflatten(buffer); | 2738 options.unflatten(buffer); |
| 2741 paint->setPaintOptionsAndroid(options); | 2739 paint->setPaintOptionsAndroid(options); |
| 2742 } | 2740 } |
| 2743 #endif | 2741 #endif |
| 2744 SkASSERT(dirty == paint->fDirtyBits); | 2742 SkASSERT(dirty == paint->fDirtyBits); |
| 2745 } | 2743 } |
| OLD | NEW |