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

Function drawArc

snap_drawing/src/snap_drawing/cpp/Layers/SpinnerLayer.cpp:82–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

80SpinnerLayer::~SpinnerLayer() = default;
81
82static void drawArc(
83 DrawingContext& drawingContext, const Rect& arcBounds, const Paint& paint, LazyPath& lazyPath, Scalar rotation) {
84 auto drawWidth = drawingContext.drawBounds().width();
85 auto drawHeight = drawingContext.drawBounds().height();
86
87 auto saveCount = drawingContext.save();
88
89 Matrix matrix;
90 matrix.postRotate(rotation, drawWidth / 2.0f, drawHeight / 2.0f);
91 drawingContext.concat(matrix);
92
93 if (lazyPath.update(drawWidth, drawHeight)) {
94 lazyPath.path().arcTo(arcBounds, 360.0f, 360.0f * kLineSweepRatio);
95 }
96
97 drawingContext.drawPaint(paint, lazyPath.path());
98
99 drawingContext.restore(saveCount);
100}
101
102void SpinnerLayer::onDraw(DrawingContext& drawingContext) {
103 Layer::onDraw(drawingContext);

Callers 1

onDrawMethod · 0.85

Calls 10

postRotateMethod · 0.80
pathMethod · 0.80
drawPaintMethod · 0.80
restoreMethod · 0.80
saveMethod · 0.65
updateMethod · 0.65
widthMethod · 0.45
heightMethod · 0.45
concatMethod · 0.45
arcToMethod · 0.45

Tested by

no test coverage detected