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

Method drawBackground

snap_drawing/src/snap_drawing/cpp/Layers/Layer.cpp:170–188  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

168}
169
170void Layer::drawBackground(Scalar width, Scalar height) {
171 DrawingContext drawingContext(width, height);
172
173 if (_boxShadow != nullptr) {
174 _boxShadow->draw(drawingContext, _borderRadius);
175 }
176
177 if (_gradientWrapper.hasGradient()) {
178 _gradientWrapper.draw(drawingContext, _borderRadius);
179 } else if (_backgroundColor != Color::transparent()) {
180 Paint paint;
181 paint.setColor(_backgroundColor);
182 paint.setAntiAlias(true);
183
184 drawingContext.drawPaint(paint, _borderRadius, _lazyPath);
185 }
186
187 _cachedBackground = drawingContext.finish();
188}
189
190void Layer::drawForeground(Scalar width, Scalar height) {
191 DrawingContext drawingContext(width, height);

Callers

nothing calls this directly

Calls 6

hasGradientMethod · 0.80
setAntiAliasMethod · 0.80
drawPaintMethod · 0.80
drawMethod · 0.65
setColorMethod · 0.45
finishMethod · 0.45

Tested by

no test coverage detected