| 44 | } |
| 45 | |
| 46 | Ref<IMask> PaintMaskLayer::createMask(const Rect& /*bounds*/) { |
| 47 | auto pathBounds = getBounds(); |
| 48 | if (pathBounds.isEmpty()) { |
| 49 | return nullptr; |
| 50 | } |
| 51 | |
| 52 | Paint paint; |
| 53 | // Skia leaves a paint aliased by default, which draws a curved path's edge, such as a ring cut by a maskPath, as |
| 54 | // jagged pixels. A rect region stays aliased, so it erases whole pixels as before. |
| 55 | paint.setAntiAlias(!_path.isEmpty()); |
| 56 | onConfigurePaint(paint, pathBounds); |
| 57 | |
| 58 | return Valdi::makeShared<PaintMask>(paint, _path, _rect); |
| 59 | } |