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 24 matching lines...) Expand all Loading... |
35 matrix.setTranslate(-maskRect.fLeft, -maskRect.fTop); | 35 matrix.setTranslate(-maskRect.fLeft, -maskRect.fTop); |
36 matrix.postIDiv(mask->width(), mask->height()); | 36 matrix.postIDiv(mask->width(), mask->height()); |
37 | 37 |
38 grp->addCoverageFragmentProcessor(GrSimpleTextureEffect::Create(mask, matrix
, | 38 grp->addCoverageFragmentProcessor(GrSimpleTextureEffect::Create(mask, matrix
, |
39 kDevice_GrCo
ordSet))->unref(); | 39 kDevice_GrCo
ordSet))->unref(); |
40 | 40 |
41 SkMatrix inverse; | 41 SkMatrix inverse; |
42 if (!viewMatrix.invert(&inverse)) { | 42 if (!viewMatrix.invert(&inverse)) { |
43 return false; | 43 return false; |
44 } | 44 } |
45 drawContext->drawNonAARectWithLocalMatrix(clip, *grp, SkMatrix::I(), maskRec
t, inverse); | 45 drawContext->fillRectWithLocalMatrix(clip, *grp, SkMatrix::I(), maskRect, in
verse); |
46 return true; | 46 return true; |
47 } | 47 } |
48 | 48 |
49 static bool draw_with_mask_filter(GrDrawContext* drawContext, | 49 static bool draw_with_mask_filter(GrDrawContext* drawContext, |
50 GrTextureProvider* textureProvider, | 50 GrTextureProvider* textureProvider, |
51 const GrClip& clipData, | 51 const GrClip& clipData, |
52 const SkMatrix& viewMatrix, | 52 const SkMatrix& viewMatrix, |
53 const SkPath& devPath, | 53 const SkPath& devPath, |
54 SkMaskFilter* filter, | 54 SkMaskFilter* filter, |
55 const SkIRect& clipBounds, | 55 const SkIRect& clipBounds, |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 SkPaint::kFill_Sty
le; | 287 SkPaint::kFill_Sty
le; |
288 draw_with_mask_filter(drawContext, context->textureProvider(), | 288 draw_with_mask_filter(drawContext, context->textureProvider(), |
289 clip, viewMatrix, *devPathPtr, | 289 clip, viewMatrix, *devPathPtr, |
290 paint.getMaskFilter(), clipBounds, &grPaint, style
); | 290 paint.getMaskFilter(), clipBounds, &grPaint, style
); |
291 return; | 291 return; |
292 } | 292 } |
293 | 293 |
294 drawContext->drawPath(clip, grPaint, viewMatrix, *pathPtr, strokeInfo); | 294 drawContext->drawPath(clip, grPaint, viewMatrix, *pathPtr, strokeInfo); |
295 } | 295 } |
296 | 296 |
OLD | NEW |