MCPcopy Create free account
hub / github.com/Snapchat/Valdi / createMask

Method createMask

snap_drawing/src/snap_drawing/cpp/Layers/Mask/PaintMaskLayer.cpp:46–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44}
45
46Ref<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}

Callers 1

drawMethod · 0.45

Calls 1

isEmptyMethod · 0.45

Tested by

no test coverage detected