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