OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 Google Inc. |
3 * | 3 * |
4 * 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 |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "SkRecordOpts.h" | 8 #include "SkRecordOpts.h" |
9 | 9 |
10 #include "SkRecordPattern.h" | 10 #include "SkRecordPattern.h" |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 SK_COMPILE_ASSERT(sizeof(SkPoint) == 2 * sizeof(SkScalar), SquintingIsNo
tSafe); | 180 SK_COMPILE_ASSERT(sizeof(SkPoint) == 2 * sizeof(SkScalar), SquintingIsNo
tSafe); |
181 SkScalar* scalars = &draw->pos[0].fX; | 181 SkScalar* scalars = &draw->pos[0].fX; |
182 for (unsigned i = 0; i < 2*points; i += 2) { | 182 for (unsigned i = 0; i < 2*points; i += 2) { |
183 scalars[i/2] = scalars[i]; | 183 scalars[i/2] = scalars[i]; |
184 } | 184 } |
185 | 185 |
186 // Extend lifetime of draw to the end of the loop so we can copy its pai
nt. | 186 // Extend lifetime of draw to the end of the loop so we can copy its pai
nt. |
187 Adopted<DrawPosText> adopted(draw); | 187 Adopted<DrawPosText> adopted(draw); |
188 SkNEW_PLACEMENT_ARGS(record->replace<DrawPosTextH>(begin, adopted), | 188 SkNEW_PLACEMENT_ARGS(record->replace<DrawPosTextH>(begin, adopted), |
189 DrawPosTextH, | 189 DrawPosTextH, |
190 (draw->text, draw->byteLength, scalars, firstY, dra
w->paint)); | 190 (draw->paint, draw->text, draw->byteLength, scalars
, firstY)); |
191 return true; | 191 return true; |
192 } | 192 } |
193 }; | 193 }; |
194 void SkRecordReduceDrawPosTextStrength(SkRecord* record) { | 194 void SkRecordReduceDrawPosTextStrength(SkRecord* record) { |
195 StrengthReducer pass; | 195 StrengthReducer pass; |
196 apply(&pass, record); | 196 apply(&pass, record); |
197 } | 197 } |
198 | 198 |
199 // Tries to replace DrawPosTextH with BoundedDrawPosTextH, which knows conservat
ive upper and lower | 199 // Tries to replace DrawPosTextH with BoundedDrawPosTextH, which knows conservat
ive upper and lower |
200 // bounds to use with SkCanvas::quickRejectY. | 200 // bounds to use with SkCanvas::quickRejectY. |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 }; | 275 }; |
276 | 276 |
277 SkTDArray<Pair> fPushStack; | 277 SkTDArray<Pair> fPushStack; |
278 SkRecord* fRecord; | 278 SkRecord* fRecord; |
279 unsigned fIndex; | 279 unsigned fIndex; |
280 }; | 280 }; |
281 void SkRecordAnnotateCullingPairs(SkRecord* record) { | 281 void SkRecordAnnotateCullingPairs(SkRecord* record) { |
282 CullAnnotator pass; | 282 CullAnnotator pass; |
283 pass.apply(record); | 283 pass.apply(record); |
284 } | 284 } |
OLD | NEW |