| 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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 desc.fConfig = kAlpha_8_GrPixelConfig; | 117 desc.fConfig = kAlpha_8_GrPixelConfig; |
| 118 } | 118 } |
| 119 | 119 |
| 120 GrTexture* mask = context->textureProvider()->createApproxTexture(desc); | 120 GrTexture* mask = context->textureProvider()->createApproxTexture(desc); |
| 121 if (nullptr == mask) { | 121 if (nullptr == mask) { |
| 122 return nullptr; | 122 return nullptr; |
| 123 } | 123 } |
| 124 | 124 |
| 125 SkRect clipRect = SkRect::MakeWH(maskRect->width(), maskRect->height()); | 125 SkRect clipRect = SkRect::MakeWH(maskRect->width(), maskRect->height()); |
| 126 | 126 |
| 127 SkAutoTUnref<GrDrawContext> drawContext(context->drawContext(mask->asRenderT
arget())); | 127 sk_sp<GrDrawContext> drawContext(context->drawContext(sk_ref_sp(mask->asRend
erTarget()))); |
| 128 if (!drawContext) { | 128 if (!drawContext) { |
| 129 return nullptr; | 129 return nullptr; |
| 130 } | 130 } |
| 131 | 131 |
| 132 drawContext->clear(nullptr, 0x0, true); | 132 drawContext->clear(nullptr, 0x0, true); |
| 133 | 133 |
| 134 GrPaint tempPaint; | 134 GrPaint tempPaint; |
| 135 tempPaint.setAntiAlias(doAA); | 135 tempPaint.setAntiAlias(doAA); |
| 136 tempPaint.setCoverageSetOpXPFactory(SkRegion::kReplace_Op); | 136 tempPaint.setCoverageSetOpXPFactory(SkRegion::kReplace_Op); |
| 137 | 137 |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 } | 341 } |
| 342 | 342 |
| 343 if (paint.getMaskFilter()) { | 343 if (paint.getMaskFilter()) { |
| 344 draw_path_with_mask_filter(context, drawContext, clip, &grPaint, viewMat
rix, | 344 draw_path_with_mask_filter(context, drawContext, clip, &grPaint, viewMat
rix, |
| 345 paint.getMaskFilter(), pathEffect, strokeInfo
, | 345 paint.getMaskFilter(), pathEffect, strokeInfo
, |
| 346 pathPtr, pathIsMutable); | 346 pathPtr, pathIsMutable); |
| 347 } else { | 347 } else { |
| 348 drawContext->drawPath(clip, grPaint, viewMatrix, *pathPtr, strokeInfo); | 348 drawContext->drawPath(clip, grPaint, viewMatrix, *pathPtr, strokeInfo); |
| 349 } | 349 } |
| 350 } | 350 } |
| OLD | NEW |