| 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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 return nullptr; | 124 return nullptr; |
| 125 } | 125 } |
| 126 | 126 |
| 127 drawContext->clear(nullptr, 0x0, true); | 127 drawContext->clear(nullptr, 0x0, true); |
| 128 | 128 |
| 129 GrPaint tempPaint; | 129 GrPaint tempPaint; |
| 130 tempPaint.setAntiAlias(doAA); | 130 tempPaint.setAntiAlias(doAA); |
| 131 tempPaint.setCoverageSetOpXPFactory(SkRegion::kReplace_Op); | 131 tempPaint.setCoverageSetOpXPFactory(SkRegion::kReplace_Op); |
| 132 | 132 |
| 133 // setup new clip | 133 // setup new clip |
| 134 const SkRect clipRect = SkRect::MakeWH(maskRect->width(), maskRect->height()
); | 134 GrFixedClip clip; |
| 135 GrClip clip(clipRect); | 135 clip.resetNonAA(SkRect::MakeWH(maskRect->width(), maskRect->height())); |
| 136 | 136 |
| 137 // Draw the mask into maskTexture with the path's integerized top-left at | 137 // Draw the mask into maskTexture with the path's integerized top-left at |
| 138 // the origin using tempPaint. | 138 // the origin using tempPaint. |
| 139 SkMatrix translate; | 139 SkMatrix translate; |
| 140 translate.setTranslate(-maskRect->fLeft, -maskRect->fTop); | 140 translate.setTranslate(-maskRect->fLeft, -maskRect->fTop); |
| 141 drawContext->drawPath(clip, tempPaint, translate, devPath, GrStyle(fillOrHai
rline)); | 141 drawContext->drawPath(clip, tempPaint, translate, devPath, GrStyle(fillOrHai
rline)); |
| 142 return drawContext->asTexture();; | 142 return drawContext->asTexture();; |
| 143 } | 143 } |
| 144 | 144 |
| 145 static void draw_path_with_mask_filter(GrContext* context, | 145 static void draw_path_with_mask_filter(GrContext* context, |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 } | 295 } |
| 296 | 296 |
| 297 if (paint.getMaskFilter()) { | 297 if (paint.getMaskFilter()) { |
| 298 draw_path_with_mask_filter(context, drawContext, clip, &grPaint, viewMat
rix, | 298 draw_path_with_mask_filter(context, drawContext, clip, &grPaint, viewMat
rix, |
| 299 paint.getMaskFilter(), style, | 299 paint.getMaskFilter(), style, |
| 300 path, pathIsMutable); | 300 path, pathIsMutable); |
| 301 } else { | 301 } else { |
| 302 drawContext->drawPath(clip, grPaint, viewMatrix, *path, style); | 302 drawContext->drawPath(clip, grPaint, viewMatrix, *path, style); |
| 303 } | 303 } |
| 304 } | 304 } |
| OLD | NEW |