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 18 matching lines...) Expand all Loading... |
29 GrRenderTarget* rt, | 29 GrRenderTarget* rt, |
30 const GrClip& clip, | 30 const GrClip& clip, |
31 const SkMatrix& viewMatrix, | 31 const SkMatrix& viewMatrix, |
32 const SkRect& maskRect, | 32 const SkRect& maskRect, |
33 GrPaint* grp, | 33 GrPaint* grp, |
34 GrTexture* mask) { | 34 GrTexture* mask) { |
35 SkMatrix matrix; | 35 SkMatrix matrix; |
36 matrix.setTranslate(-maskRect.fLeft, -maskRect.fTop); | 36 matrix.setTranslate(-maskRect.fLeft, -maskRect.fTop); |
37 matrix.postIDiv(mask->width(), mask->height()); | 37 matrix.postIDiv(mask->width(), mask->height()); |
38 | 38 |
39 grp->addCoverageProcessor(GrSimpleTextureEffect::Create(grp->getProcessorDat
aManager(), | 39 grp->addCoverageFragmentProcessor(GrSimpleTextureEffect::Create(grp->getProc
essorDataManager(), |
40 mask, matrix, | 40 mask, matrix, |
41 kDevice_GrCoordSet))
->unref(); | 41 kDevice_GrCoordSet))
->unref(); |
42 | 42 |
43 SkMatrix inverse; | 43 SkMatrix inverse; |
44 if (!viewMatrix.invert(&inverse)) { | 44 if (!viewMatrix.invert(&inverse)) { |
45 return false; | 45 return false; |
46 } | 46 } |
47 drawContext->drawNonAARectWithLocalMatrix(rt, clip, *grp, SkMatrix::I(), mas
kRect, inverse); | 47 drawContext->drawNonAARectWithLocalMatrix(rt, clip, *grp, SkMatrix::I(), mas
kRect, inverse); |
48 return true; | 48 return true; |
49 } | 49 } |
(...skipping 236 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 |