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 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 // avoid possibly allocating a new path in transform if we can | 228 // avoid possibly allocating a new path in transform if we can |
229 SkPath* devPathPtr = pathIsMutable ? pathPtr : tmpPath.init(); | 229 SkPath* devPathPtr = pathIsMutable ? pathPtr : tmpPath.init(); |
230 if (!pathIsMutable) { | 230 if (!pathIsMutable) { |
231 devPathPtr->setIsVolatile(true); | 231 devPathPtr->setIsVolatile(true); |
232 } | 232 } |
233 | 233 |
234 // transform the path into device space | 234 // transform the path into device space |
235 pathPtr->transform(viewMatrix, devPathPtr); | 235 pathPtr->transform(viewMatrix, devPathPtr); |
236 | 236 |
237 SkRect maskRect; | 237 SkRect maskRect; |
238 if (paint.getMaskFilter()->canFilterMaskGPU(devPathPtr->getBounds(), | 238 if (paint.getMaskFilter()->canFilterMaskGPU(SkRRect::MakeRect(devPathPtr
->getBounds()), |
239 clipBounds, | 239 clipBounds, |
240 viewMatrix, | 240 viewMatrix, |
241 &maskRect)) { | 241 &maskRect)) { |
242 SkIRect finalIRect; | 242 SkIRect finalIRect; |
243 maskRect.roundOut(&finalIRect); | 243 maskRect.roundOut(&finalIRect); |
244 if (clip_bounds_quick_reject(clipBounds, finalIRect)) { | 244 if (clip_bounds_quick_reject(clipBounds, finalIRect)) { |
245 // clipped out | 245 // clipped out |
246 return; | 246 return; |
247 } | 247 } |
248 | 248 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 SkPaint::kFill_Sty
le; | 292 SkPaint::kFill_Sty
le; |
293 draw_with_mask_filter(drawContext, context->textureProvider(), renderTar
get, | 293 draw_with_mask_filter(drawContext, context->textureProvider(), renderTar
get, |
294 clip, viewMatrix, *devPathPtr, | 294 clip, viewMatrix, *devPathPtr, |
295 paint.getMaskFilter(), clipBounds, &grPaint, style
); | 295 paint.getMaskFilter(), clipBounds, &grPaint, style
); |
296 return; | 296 return; |
297 } | 297 } |
298 | 298 |
299 drawContext->drawPath(renderTarget, clip, grPaint, viewMatrix, *pathPtr, str
okeInfo); | 299 drawContext->drawPath(renderTarget, clip, grPaint, viewMatrix, *pathPtr, str
okeInfo); |
300 } | 300 } |
301 | 301 |
OLD | NEW |