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 | 9 |
10 #include "Sk1DPathEffect.h" | 10 #include "Sk1DPathEffect.h" |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 case SkPath::kClose_Verb: | 140 case SkPath::kClose_Verb: |
141 dst->close(); | 141 dst->close(); |
142 break; | 142 break; |
143 default: | 143 default: |
144 SkDEBUGFAIL("unknown verb"); | 144 SkDEBUGFAIL("unknown verb"); |
145 break; | 145 break; |
146 } | 146 } |
147 } | 147 } |
148 } | 148 } |
149 | 149 |
| 150 #ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING |
| 151 SkPath1DPathEffect::SkPath1DPathEffect(SkReadBuffer& buffer) { |
| 152 fAdvance = buffer.readScalar(); |
| 153 if (fAdvance > 0) { |
| 154 buffer.readPath(&fPath); |
| 155 fInitialOffset = buffer.readScalar(); |
| 156 fStyle = (Style) buffer.readUInt(); |
| 157 } else { |
| 158 SkDEBUGF(("SkPath1DPathEffect can't use advance <= 0\n")); |
| 159 // Make Coverity happy. |
| 160 fInitialOffset = 0; |
| 161 fStyle = kStyleCount; |
| 162 } |
| 163 } |
| 164 #endif |
| 165 |
150 SkScalar SkPath1DPathEffect::begin(SkScalar contourLength) const { | 166 SkScalar SkPath1DPathEffect::begin(SkScalar contourLength) const { |
151 return fInitialOffset; | 167 return fInitialOffset; |
152 } | 168 } |
153 | 169 |
154 SkFlattenable* SkPath1DPathEffect::CreateProc(SkReadBuffer& buffer) { | 170 SkFlattenable* SkPath1DPathEffect::CreateProc(SkReadBuffer& buffer) { |
155 SkScalar advance = buffer.readScalar(); | 171 SkScalar advance = buffer.readScalar(); |
156 if (advance > 0) { | 172 if (advance > 0) { |
157 SkPath path; | 173 SkPath path; |
158 buffer.readPath(&path); | 174 buffer.readPath(&path); |
159 SkScalar phase = buffer.readScalar(); | 175 SkScalar phase = buffer.readScalar(); |
(...skipping 29 matching lines...) Expand all Loading... |
189 } break; | 205 } break; |
190 case kMorph_Style: | 206 case kMorph_Style: |
191 morphpath(dst, fPath, meas, distance); | 207 morphpath(dst, fPath, meas, distance); |
192 break; | 208 break; |
193 default: | 209 default: |
194 SkDEBUGFAIL("unknown Style enum"); | 210 SkDEBUGFAIL("unknown Style enum"); |
195 break; | 211 break; |
196 } | 212 } |
197 return fAdvance; | 213 return fAdvance; |
198 } | 214 } |
OLD | NEW |