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 bool pathIsMutable) { | 149 bool pathIsMutable) { |
150 SkASSERT(maskFilter); | 150 SkASSERT(maskFilter); |
151 | 151 |
152 SkIRect clipBounds; | 152 SkIRect clipBounds; |
153 clip.getConservativeBounds(drawContext->width(), drawContext->height(), &cli
pBounds); | 153 clip.getConservativeBounds(drawContext->width(), drawContext->height(), &cli
pBounds); |
154 SkTLazy<SkPath> tmpPath; | 154 SkTLazy<SkPath> tmpPath; |
155 SkStrokeRec::InitStyle fillOrHairline; | 155 SkStrokeRec::InitStyle fillOrHairline; |
156 | 156 |
157 // We just fully apply the style here. | 157 // We just fully apply the style here. |
158 if (style.applies()) { | 158 if (style.applies()) { |
159 if (!style.applyToPath(tmpPath.init(), &fillOrHairline, *path, | 159 SkScalar scale = GrStyle::MatrixToScaleFactor(viewMatrix); |
160 GrStyle::MatrixToScaleFactor(viewMatrix))) { | 160 if (0 == scale || !style.applyToPath(tmpPath.init(), &fillOrHairline, *p
ath, scale)) { |
161 return; | 161 return; |
162 } | 162 } |
163 pathIsMutable = true; | 163 pathIsMutable = true; |
164 path = tmpPath.get(); | 164 path = tmpPath.get(); |
165 } else if (style.isSimpleHairline()) { | 165 } else if (style.isSimpleHairline()) { |
166 fillOrHairline = SkStrokeRec::kHairline_InitStyle; | 166 fillOrHairline = SkStrokeRec::kHairline_InitStyle; |
167 } else { | 167 } else { |
168 SkASSERT(style.isSimpleFill()); | 168 SkASSERT(style.isSimpleFill()); |
169 fillOrHairline = SkStrokeRec::kFill_InitStyle; | 169 fillOrHairline = SkStrokeRec::kFill_InitStyle; |
170 } | 170 } |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 } | 293 } |
294 | 294 |
295 if (paint.getMaskFilter()) { | 295 if (paint.getMaskFilter()) { |
296 draw_path_with_mask_filter(context, drawContext, clip, &grPaint, viewMat
rix, | 296 draw_path_with_mask_filter(context, drawContext, clip, &grPaint, viewMat
rix, |
297 paint.getMaskFilter(), style, | 297 paint.getMaskFilter(), style, |
298 path, pathIsMutable); | 298 path, pathIsMutable); |
299 } else { | 299 } else { |
300 drawContext->drawPath(clip, grPaint, viewMatrix, *path, style); | 300 drawContext->drawPath(clip, grPaint, viewMatrix, *path, style); |
301 } | 301 } |
302 } | 302 } |
OLD | NEW |