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 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 const GrClip& clip, | 280 const GrClip& clip, |
281 const SkPath& origSrcPath, | 281 const SkPath& origSrcPath, |
282 const SkPaint& paint, | 282 const SkPaint& paint, |
283 const SkMatrix& origViewMatrix, | 283 const SkMatrix& origViewMatrix, |
284 const SkMatrix* prePathMatrix, | 284 const SkMatrix* prePathMatrix, |
285 const SkIRect& clipBounds, | 285 const SkIRect& clipBounds, |
286 bool pathIsMutable) { | 286 bool pathIsMutable) { |
287 SkASSERT(!pathIsMutable || origSrcPath.isVolatile()); | 287 SkASSERT(!pathIsMutable || origSrcPath.isVolatile()); |
288 | 288 |
289 GrStrokeInfo strokeInfo(paint); | 289 GrStrokeInfo strokeInfo(paint); |
| 290 strokeInfo.setResScale(SkDraw::ComputeResScaleForStroking(origViewMatrix)); |
290 | 291 |
291 // If we have a prematrix, apply it to the path, optimizing for the case | 292 // If we have a prematrix, apply it to the path, optimizing for the case |
292 // where the original path can in fact be modified in place (even though | 293 // where the original path can in fact be modified in place (even though |
293 // its parameter type is const). | 294 // its parameter type is const). |
294 SkPath* pathPtr = const_cast<SkPath*>(&origSrcPath); | 295 SkPath* pathPtr = const_cast<SkPath*>(&origSrcPath); |
295 SkTLazy<SkPath> tmpPath; | 296 SkTLazy<SkPath> tmpPath; |
296 SkTLazy<SkPath> effectPath; | 297 SkTLazy<SkPath> effectPath; |
297 SkPathEffect* pathEffect = paint.getPathEffect(); | 298 SkPathEffect* pathEffect = paint.getPathEffect(); |
298 | 299 |
299 SkMatrix viewMatrix = origViewMatrix; | 300 SkMatrix viewMatrix = origViewMatrix; |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 | 339 |
339 if (paint.getMaskFilter()) { | 340 if (paint.getMaskFilter()) { |
340 draw_path_with_mask_filter(context, drawContext, clip, &grPaint, viewMat
rix, | 341 draw_path_with_mask_filter(context, drawContext, clip, &grPaint, viewMat
rix, |
341 paint.getMaskFilter(), pathEffect, strokeInfo
, | 342 paint.getMaskFilter(), pathEffect, strokeInfo
, |
342 pathPtr, pathIsMutable); | 343 pathPtr, pathIsMutable); |
343 } else { | 344 } else { |
344 drawContext->drawPath(clip, grPaint, viewMatrix, *pathPtr, strokeInfo); | 345 drawContext->drawPath(clip, grPaint, viewMatrix, *pathPtr, strokeInfo); |
345 } | 346 } |
346 } | 347 } |
347 | 348 |
OLD | NEW |