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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 desc.fConfig = kAlpha_8_GrPixelConfig; | 115 desc.fConfig = kAlpha_8_GrPixelConfig; |
116 } | 116 } |
117 | 117 |
118 GrTexture* mask = context->textureProvider()->createApproxTexture(desc); | 118 GrTexture* mask = context->textureProvider()->createApproxTexture(desc); |
119 if (nullptr == mask) { | 119 if (nullptr == mask) { |
120 return nullptr; | 120 return nullptr; |
121 } | 121 } |
122 | 122 |
123 SkRect clipRect = SkRect::MakeWH(maskRect.width(), maskRect.height()); | 123 SkRect clipRect = SkRect::MakeWH(maskRect.width(), maskRect.height()); |
124 | 124 |
125 GrDrawContext* drawContext = context->drawContext(); | 125 SkAutoTUnref<GrDrawContext> drawContext(context->drawContext()); |
126 if (!drawContext) { | 126 if (!drawContext) { |
127 return nullptr; | 127 return nullptr; |
128 } | 128 } |
129 | 129 |
130 drawContext->clear(mask->asRenderTarget(), nullptr, 0x0, true); | 130 drawContext->clear(mask->asRenderTarget(), nullptr, 0x0, true); |
131 | 131 |
132 GrPaint tempPaint; | 132 GrPaint tempPaint; |
133 tempPaint.setAntiAlias(doAA); | 133 tempPaint.setAntiAlias(doAA); |
134 tempPaint.setCoverageSetOpXPFactory(SkRegion::kReplace_Op); | 134 tempPaint.setCoverageSetOpXPFactory(SkRegion::kReplace_Op); |
135 | 135 |
(...skipping 150 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 |