OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 "SkStrokeRec.h" | 8 #include "SkStrokeRec.h" |
9 #include "SkPaintDefaults.h" | 9 #include "SkPaintDefaults.h" |
10 | 10 |
(...skipping 26 matching lines...) Expand all Loading... |
37 if (0 == paint.getStrokeWidth()) { | 37 if (0 == paint.getStrokeWidth()) { |
38 // hairline+fill == fill | 38 // hairline+fill == fill |
39 fWidth = kStrokeRec_FillStyleWidth; | 39 fWidth = kStrokeRec_FillStyleWidth; |
40 fStrokeAndFill = false; | 40 fStrokeAndFill = false; |
41 } else { | 41 } else { |
42 fWidth = paint.getStrokeWidth(); | 42 fWidth = paint.getStrokeWidth(); |
43 fStrokeAndFill = true; | 43 fStrokeAndFill = true; |
44 } | 44 } |
45 break; | 45 break; |
46 default: | 46 default: |
47 SkASSERT(!"unknown paint style"); | 47 SkDEBUGFAIL("unknown paint style"); |
48 // fall back on just fill | 48 // fall back on just fill |
49 fWidth = kStrokeRec_FillStyleWidth; | 49 fWidth = kStrokeRec_FillStyleWidth; |
50 fStrokeAndFill = false; | 50 fStrokeAndFill = false; |
51 break; | 51 break; |
52 } | 52 } |
53 | 53 |
54 // copy these from the paint, regardless of our "style" | 54 // copy these from the paint, regardless of our "style" |
55 fMiterLimit = paint.getStrokeMiter(); | 55 fMiterLimit = paint.getStrokeMiter(); |
56 fCap = paint.getStrokeCap(); | 56 fCap = paint.getStrokeCap(); |
57 fJoin = paint.getStrokeJoin(); | 57 fJoin = paint.getStrokeJoin(); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 | 96 |
97 SkStroke stroker; | 97 SkStroke stroker; |
98 stroker.setCap(fCap); | 98 stroker.setCap(fCap); |
99 stroker.setJoin(fJoin); | 99 stroker.setJoin(fJoin); |
100 stroker.setMiterLimit(fMiterLimit); | 100 stroker.setMiterLimit(fMiterLimit); |
101 stroker.setWidth(fWidth); | 101 stroker.setWidth(fWidth); |
102 stroker.setDoFill(fStrokeAndFill); | 102 stroker.setDoFill(fStrokeAndFill); |
103 stroker.strokePath(src, dst); | 103 stroker.strokePath(src, dst); |
104 return true; | 104 return true; |
105 } | 105 } |
OLD | NEW |