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 "SkCornerPathEffect.h" | 10 #include "SkCornerPathEffect.h" |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 firstStep.set(0, 0); | 104 firstStep.set(0, 0); |
105 break; | 105 break; |
106 case SkPath::kClose_Verb: | 106 case SkPath::kClose_Verb: |
107 if (firstStep.fX || firstStep.fY) { | 107 if (firstStep.fX || firstStep.fY) { |
108 dst->quadTo(lastCorner.fX, lastCorner.fY, | 108 dst->quadTo(lastCorner.fX, lastCorner.fY, |
109 lastCorner.fX + firstStep.fX, | 109 lastCorner.fX + firstStep.fX, |
110 lastCorner.fY + firstStep.fY); | 110 lastCorner.fY + firstStep.fY); |
111 } | 111 } |
112 dst->close(); | 112 dst->close(); |
113 break; | 113 break; |
| 114 case SkPath::kConic_Verb: |
| 115 SkASSERT(0); |
| 116 break; |
114 case SkPath::kDone_Verb: | 117 case SkPath::kDone_Verb: |
115 goto DONE; | 118 goto DONE; |
116 } | 119 } |
117 | 120 |
118 if (SkPath::kMove_Verb == prevVerb) { | 121 if (SkPath::kMove_Verb == prevVerb) { |
119 firstStep = step; | 122 firstStep = step; |
120 } | 123 } |
121 prevVerb = verb; | 124 prevVerb = verb; |
122 } | 125 } |
123 DONE: | 126 DONE: |
124 return true; | 127 return true; |
125 } | 128 } |
126 | 129 |
127 void SkCornerPathEffect::flatten(SkFlattenableWriteBuffer& buffer) const { | 130 void SkCornerPathEffect::flatten(SkFlattenableWriteBuffer& buffer) const { |
128 this->INHERITED::flatten(buffer); | 131 this->INHERITED::flatten(buffer); |
129 buffer.writeScalar(fRadius); | 132 buffer.writeScalar(fRadius); |
130 } | 133 } |
131 | 134 |
132 SkCornerPathEffect::SkCornerPathEffect(SkFlattenableReadBuffer& buffer) { | 135 SkCornerPathEffect::SkCornerPathEffect(SkFlattenableReadBuffer& buffer) { |
133 fRadius = buffer.readScalar(); | 136 fRadius = buffer.readScalar(); |
134 } | 137 } |
OLD | NEW |