| 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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 sampleCnt = 0; | 102 sampleCnt = 0; |
| 103 } | 103 } |
| 104 | 104 |
| 105 // We actually only need A8, but it often isn't supported as a | 105 // We actually only need A8, but it often isn't supported as a |
| 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->makeDrawContext(SkBackingFit::kApp
rox, |
| 113 maskRect.width(), | 113 maskRect.width(), |
| 114 maskRect.height(), | 114 maskRect.height(), |
| 115 config, | 115 config, |
| 116 nullptr, | 116 nullptr, |
| 117 sampleCnt)); | 117 sampleCnt)); |
| 118 if (!drawContext) { | 118 if (!drawContext) { |
| 119 return nullptr; | 119 return nullptr; |
| 120 } | 120 } |
| 121 | 121 |
| 122 drawContext->clear(nullptr, 0x0, true); | 122 drawContext->clear(nullptr, 0x0, true); |
| 123 | 123 |
| 124 GrPaint tempPaint; | 124 GrPaint tempPaint; |
| 125 tempPaint.setAntiAlias(doAA); | 125 tempPaint.setAntiAlias(doAA); |
| 126 tempPaint.setCoverageSetOpXPFactory(SkRegion::kReplace_Op); | 126 tempPaint.setCoverageSetOpXPFactory(SkRegion::kReplace_Op); |
| 127 | 127 |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 } | 292 } |
| 293 | 293 |
| 294 if (paint.getMaskFilter()) { | 294 if (paint.getMaskFilter()) { |
| 295 draw_path_with_mask_filter(context, drawContext, clip, &grPaint, viewMat
rix, | 295 draw_path_with_mask_filter(context, drawContext, clip, &grPaint, viewMat
rix, |
| 296 paint.getMaskFilter(), style, | 296 paint.getMaskFilter(), style, |
| 297 path, pathIsMutable); | 297 path, pathIsMutable); |
| 298 } else { | 298 } else { |
| 299 drawContext->drawPath(clip, grPaint, viewMatrix, *path, style); | 299 drawContext->drawPath(clip, grPaint, viewMatrix, *path, style); |
| 300 } | 300 } |
| 301 } | 301 } |
| OLD | NEW |