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

Function TEST_F

snap_drawing/test/src/RasterContext_tests.cpp:153–176  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

151};
152
153TEST_F(RasterContextTests, canRasterSimpleScene) {
154 _contentLayer->setBackgroundColor(Color::red());
155
156 auto centerLayer = makeLayer<Layer>(_resources);
157 centerLayer->setBackgroundColor(Color::blue());
158 centerLayer->setFrame(Rect::makeXYWH(1, 1, 2, 2));
159 _contentLayer->addChild(centerLayer);
160 _contentLayer->setFrame(Rect::makeXYWH(0, 0, 4, 4));
161
162 auto result = raster();
163 ASSERT_TRUE(result) << result.description();
164
165 ASSERT_EQ(*result.value(),
166 std::initializer_list<Color>({
167 // clang-format off
168 Color::red(), Color::red(), Color::red(), Color::red(),
169 Color::red(), Color::blue(), Color::blue(), Color::red(),
170 Color::red(), Color::blue(), Color::blue(), Color::red(),
171 Color::red(), Color::red(), Color::red(), Color::red(),
172 // clang-format on
173 }));
174
175 ASSERT_EQ(0, _bitmapFactory->createdBitmapCount);
176}
177
178TEST_F(RasterContextTests, scalesSceneToBitmap) {
179 _contentLayer->setBackgroundColor(Color::red());

Callers

nothing calls this directly

Calls 11

setBackgroundColorMethod · 0.80
descriptionMethod · 0.80
setPixelsMethod · 0.80
setExternalSurfaceMethod · 0.80
setClipsToBoundsMethod · 0.80
getLoggerMethod · 0.80
valueMethod · 0.65
setFrameMethod · 0.45
addChildMethod · 0.45
setScaleXMethod · 0.45
setTranslationXMethod · 0.45

Tested by

no test coverage detected