| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 "GrBlurUtils.h" | 8 #include "GrBlurUtils.h" |
| 9 #include "GrDrawContext.h" | 9 #include "GrDrawContext.h" |
| 10 #include "GrCaps.h" | 10 #include "GrCaps.h" |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 const GrClip& clip, | 149 const GrClip& clip, |
| 150 const SkPath& origSrcPath, | 150 const SkPath& origSrcPath, |
| 151 const SkPaint& paint, | 151 const SkPaint& paint, |
| 152 const SkMatrix& origViewMatrix, | 152 const SkMatrix& origViewMatrix, |
| 153 const SkMatrix* prePathMatrix, | 153 const SkMatrix* prePathMatrix, |
| 154 const SkIRect& clipBounds, | 154 const SkIRect& clipBounds, |
| 155 bool pathIsMutable) { | 155 bool pathIsMutable) { |
| 156 SkASSERT(!pathIsMutable || origSrcPath.isVolatile()); | 156 SkASSERT(!pathIsMutable || origSrcPath.isVolatile()); |
| 157 | 157 |
| 158 GrStrokeInfo strokeInfo(paint); | 158 GrStrokeInfo strokeInfo(paint); |
| 159 GrStrokeInfo origStrokeInfo(strokeInfo); |
| 159 | 160 |
| 160 // If we have a prematrix, apply it to the path, optimizing for the case | 161 // If we have a prematrix, apply it to the path, optimizing for the case |
| 161 // where the original path can in fact be modified in place (even though | 162 // where the original path can in fact be modified in place (even though |
| 162 // its parameter type is const). | 163 // its parameter type is const). |
| 163 SkPath* pathPtr = const_cast<SkPath*>(&origSrcPath); | 164 SkPath* pathPtr = const_cast<SkPath*>(&origSrcPath); |
| 164 SkTLazy<SkPath> tmpPath; | 165 SkTLazy<SkPath> tmpPath; |
| 165 SkTLazy<SkPath> effectPath; | 166 SkTLazy<SkPath> effectPath; |
| 166 SkPathEffect* pathEffect = paint.getPathEffect(); | 167 SkPathEffect* pathEffect = paint.getPathEffect(); |
| 167 | 168 |
| 168 SkMatrix viewMatrix = origViewMatrix; | 169 SkMatrix viewMatrix = origViewMatrix; |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 // draw the mask on the CPU - this is a fallthrough path in case the | 284 // draw the mask on the CPU - this is a fallthrough path in case the |
| 284 // GPU path fails | 285 // GPU path fails |
| 285 SkPaint::Style style = strokeInfo.isHairlineStyle() ? SkPaint::kStroke_S
tyle : | 286 SkPaint::Style style = strokeInfo.isHairlineStyle() ? SkPaint::kStroke_S
tyle : |
| 286 SkPaint::kFill_Sty
le; | 287 SkPaint::kFill_Sty
le; |
| 287 draw_with_mask_filter(drawContext, context->textureProvider(), renderTar
get, | 288 draw_with_mask_filter(drawContext, context->textureProvider(), renderTar
get, |
| 288 clip, viewMatrix, *devPathPtr, | 289 clip, viewMatrix, *devPathPtr, |
| 289 paint.getMaskFilter(), clipBounds, &grPaint, style
); | 290 paint.getMaskFilter(), clipBounds, &grPaint, style
); |
| 290 return; | 291 return; |
| 291 } | 292 } |
| 292 | 293 |
| 293 drawContext->drawPath(renderTarget, clip, grPaint, viewMatrix, *pathPtr, str
okeInfo); | 294 drawContext->drawPath(renderTarget, clip, grPaint, viewMatrix, *pathPtr, str
okeInfo, &origSrcPath, &origStrokeInfo); |
| 294 } | 295 } |
| 295 | 296 |
| OLD | NEW |