| 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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 // render target so default to RGBA_8888 | 106 // render target so default to RGBA_8888 |
| 107 GrPixelConfig config = kRGBA_8888_GrPixelConfig; | 107 GrPixelConfig config = kRGBA_8888_GrPixelConfig; |
| 108 if (context->caps()->isConfigRenderable(kAlpha_8_GrPixelConfig, sampleCnt >
0)) { | 108 if (context->caps()->isConfigRenderable(kAlpha_8_GrPixelConfig, sampleCnt >
0)) { |
| 109 config = kAlpha_8_GrPixelConfig; | 109 config = kAlpha_8_GrPixelConfig; |
| 110 } | 110 } |
| 111 | 111 |
| 112 sk_sp<GrDrawContext> drawContext(context->newDrawContext(SkBackingFit::kAppr
ox, | 112 sk_sp<GrDrawContext> drawContext(context->newDrawContext(SkBackingFit::kAppr
ox, |
| 113 maskRect.width(), | 113 maskRect.width(), |
| 114 maskRect.height(), | 114 maskRect.height(), |
| 115 config, | 115 config, |
| 116 nullptr, |
| 116 sampleCnt)); | 117 sampleCnt)); |
| 117 if (!drawContext) { | 118 if (!drawContext) { |
| 118 return nullptr; | 119 return nullptr; |
| 119 } | 120 } |
| 120 | 121 |
| 121 drawContext->clear(nullptr, 0x0, true); | 122 drawContext->clear(nullptr, 0x0, true); |
| 122 | 123 |
| 123 GrPaint tempPaint; | 124 GrPaint tempPaint; |
| 124 tempPaint.setAntiAlias(doAA); | 125 tempPaint.setAntiAlias(doAA); |
| 125 tempPaint.setCoverageSetOpXPFactory(SkRegion::kReplace_Op); | 126 tempPaint.setCoverageSetOpXPFactory(SkRegion::kReplace_Op); |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 } | 293 } |
| 293 | 294 |
| 294 if (paint.getMaskFilter()) { | 295 if (paint.getMaskFilter()) { |
| 295 draw_path_with_mask_filter(context, drawContext, clip, &grPaint, viewMat
rix, | 296 draw_path_with_mask_filter(context, drawContext, clip, &grPaint, viewMat
rix, |
| 296 paint.getMaskFilter(), style, | 297 paint.getMaskFilter(), style, |
| 297 path, pathIsMutable); | 298 path, pathIsMutable); |
| 298 } else { | 299 } else { |
| 299 drawContext->drawPath(clip, grPaint, viewMatrix, *path, style); | 300 drawContext->drawPath(clip, grPaint, viewMatrix, *path, style); |
| 300 } | 301 } |
| 301 } | 302 } |
| OLD | NEW |