| 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 "GrShape.h" | 8 #include "GrShape.h" |
| 9 | 9 |
| 10 GrShape& GrShape::operator=(const GrShape& that) { | 10 GrShape& GrShape::operator=(const GrShape& that) { |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 SkPath* srcForPathEffect; | 204 SkPath* srcForPathEffect; |
| 205 if (parent.fType == Type::kPath) { | 205 if (parent.fType == Type::kPath) { |
| 206 srcForPathEffect = parent.fPath.get(); | 206 srcForPathEffect = parent.fPath.get(); |
| 207 } else { | 207 } else { |
| 208 srcForPathEffect = tmpPath.init(); | 208 srcForPathEffect = tmpPath.init(); |
| 209 parent.asPath(tmpPath.get()); | 209 parent.asPath(tmpPath.get()); |
| 210 } | 210 } |
| 211 // Should we consider bounds? Would have to include in key, but it'd be
nice to know | 211 // Should we consider bounds? Would have to include in key, but it'd be
nice to know |
| 212 // if the bounds actually modified anything before including in key. | 212 // if the bounds actually modified anything before including in key. |
| 213 SkStrokeRec strokeRec = parent.fStyle.strokeRec(); | 213 SkStrokeRec strokeRec = parent.fStyle.strokeRec(); |
| 214 strokeRec.setResScale(scale); | 214 if (!parent.fStyle.applyPathEffectToPath(fPath.get(), &strokeRec, *srcFo
rPathEffect, |
| 215 if (!pe->filterPath(fPath.get(), *srcForPathEffect, &strokeRec, nullptr)
) { | 215 scale)) { |
| 216 // If the path effect fails then we continue as though there was no
path effect. | 216 // If the path effect fails then we continue as though there was no
path effect. |
| 217 // If the original was a rrect that we couldn't canonicalize because
of the path | 217 // If the original was a rrect that we couldn't canonicalize because
of the path |
| 218 // effect, then do so now. | 218 // effect, then do so now. |
| 219 if (parent.fType == Type::kRRect && (parent.fRRectDir != kDefaultRRe
ctDir || | 219 if (parent.fType == Type::kRRect && (parent.fRRectDir != kDefaultRRe
ctDir || |
| 220 parent.fRRectStart != kDefaultR
RectStart)) { | 220 parent.fRRectStart != kDefaultR
RectStart)) { |
| 221 SkASSERT(srcForPathEffect == tmpPath.get()); | 221 SkASSERT(srcForPathEffect == tmpPath.get()); |
| 222 tmpPath.get()->reset(); | 222 tmpPath.get()->reset(); |
| 223 tmpPath.get()->addRRect(parent.fRRect, kDefaultRRectDir, kDefaul
tRRectDir); | 223 tmpPath.get()->addRRect(parent.fRRect, kDefaultRRectDir, kDefaul
tRRectDir); |
| 224 } | 224 } |
| 225 *fPath.get() = *srcForPathEffect; | 225 *fPath.get() = *srcForPathEffect; |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 // Since there is no path effect the dir and start index is imma
terial. | 349 // Since there is no path effect the dir and start index is imma
terial. |
| 350 *rrectDir = kDefaultRRectDir; | 350 *rrectDir = kDefaultRRectDir; |
| 351 *rrectStart = kDefaultRRectStart; | 351 *rrectStart = kDefaultRRectStart; |
| 352 *rrectIsInverted = rrect_path_is_inverse_filled(path, strokeRec,
pe); | 352 *rrectIsInverted = rrect_path_is_inverse_filled(path, strokeRec,
pe); |
| 353 return Type::kRRect; | 353 return Type::kRRect; |
| 354 } | 354 } |
| 355 } | 355 } |
| 356 } | 356 } |
| 357 return Type::kPath; | 357 return Type::kPath; |
| 358 } | 358 } |
| OLD | NEW |