| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 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 "GrStyle.h" | 8 #include "GrStyle.h" |
| 9 | 9 |
| 10 int GrStyle::KeySize(const GrStyle &style, Apply apply, uint32_t flags) { | 10 int GrStyle::KeySize(const GrStyle &style, Apply apply, uint32_t flags) { |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 | 99 |
| 100 void GrStyle::initPathEffect(SkPathEffect* pe) { | 100 void GrStyle::initPathEffect(SkPathEffect* pe) { |
| 101 SkASSERT(!fPathEffect) | 101 SkASSERT(!fPathEffect) |
| 102 SkASSERT(SkPathEffect::kNone_DashType == fDashInfo.fType); | 102 SkASSERT(SkPathEffect::kNone_DashType == fDashInfo.fType); |
| 103 SkASSERT(0 == fDashInfo.fIntervals.count()); | 103 SkASSERT(0 == fDashInfo.fIntervals.count()); |
| 104 if (!pe) { | 104 if (!pe) { |
| 105 return; | 105 return; |
| 106 } | 106 } |
| 107 SkPathEffect::DashInfo info; | 107 SkPathEffect::DashInfo info; |
| 108 if (SkPathEffect::kDash_DashType == pe->asADash(&info)) { | 108 if (SkPathEffect::kDash_DashType == pe->asADash(&info)) { |
| 109 if (fStrokeRec.getStyle() != SkStrokeRec::kFill_Style) { | 109 SkStrokeRec::Style recStyle = fStrokeRec.getStyle(); |
| 110 if (recStyle != SkStrokeRec::kFill_Style && recStyle != SkStrokeRec::kSt
rokeAndFill_Style) { |
| 110 fDashInfo.fType = SkPathEffect::kDash_DashType; | 111 fDashInfo.fType = SkPathEffect::kDash_DashType; |
| 111 fDashInfo.fIntervals.reset(info.fCount); | 112 fDashInfo.fIntervals.reset(info.fCount); |
| 112 fDashInfo.fPhase = info.fPhase; | 113 fDashInfo.fPhase = info.fPhase; |
| 113 info.fIntervals = fDashInfo.fIntervals.get(); | 114 info.fIntervals = fDashInfo.fIntervals.get(); |
| 114 pe->asADash(&info); | 115 pe->asADash(&info); |
| 115 fPathEffect.reset(SkSafeRef(pe)); | 116 fPathEffect.reset(SkSafeRef(pe)); |
| 116 } | 117 } |
| 117 } else { | 118 } else { |
| 118 fPathEffect.reset(SkSafeRef(pe)); | 119 fPathEffect.reset(SkSafeRef(pe)); |
| 119 } | 120 } |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 return false; | 166 return false; |
| 166 } else { | 167 } else { |
| 167 SkASSERT(SkStrokeRec::kFill_Style == strokeRec.getStyle() || | 168 SkASSERT(SkStrokeRec::kFill_Style == strokeRec.getStyle() || |
| 168 SkStrokeRec::kHairline_Style == strokeRec.getStyle()); | 169 SkStrokeRec::kHairline_Style == strokeRec.getStyle()); |
| 169 *style = strokeRec.getStyle() == SkStrokeRec::kFill_Style | 170 *style = strokeRec.getStyle() == SkStrokeRec::kFill_Style |
| 170 ? SkStrokeRec::kFill_InitStyle | 171 ? SkStrokeRec::kFill_InitStyle |
| 171 : SkStrokeRec::kHairline_InitStyle; | 172 : SkStrokeRec::kHairline_InitStyle; |
| 172 } | 173 } |
| 173 return true; | 174 return true; |
| 174 } | 175 } |
| OLD | NEW |