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

Function TEST

snap_drawing/test/src/Compositor_Tests.cpp:28–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26}
27
28TEST(Compositor, doesNothingWhenNoExternalSurfacesArePresent) {
29 DisplayListBuilder builder(100, 100);
30
31 builder.context(Vector(0, 0), 1.0, [&]() {
32 builder.rectangle(Size(50, 50), 1.0);
33
34 builder.context(Vector(25, 25), 1.0, [&]() { builder.rectangle(Size(10, 10), 1.0); });
35
36 builder.context(Vector(35, 35), 1.0, [&]() { builder.rectangle(Size(50, 50), 1.0); });
37
38 builder.rectangle(Size(25, 25), 1.0);
39 });
40
41 Ref<DisplayList> outputDisplayList;
42 auto planeList = performComposition(builder, &outputDisplayList);
43
44 ASSERT_EQ(static_cast<size_t>(1), planeList.getPlanesCount());
45 ASSERT_EQ(CompositorPlaneTypeDrawable, planeList.getPlaneAtIndex(0).getType());
46 ASSERT_TRUE(planeList.getPlaneAtIndex(0).getExternalSurface() == nullptr);
47
48 ASSERT_EQ(builder.displayList, outputDisplayList);
49}
50
51TEST(Compositor, emitsDedicatedLayerWhenAnExternalSurfaceIsPresent) {
52 DisplayListBuilder builder(100, 100);

Callers

nothing calls this directly

Calls 15

performCompositionFunction · 0.85
rectangleMethod · 0.80
externalSurfaceMethod · 0.80
setTranslateXMethod · 0.80
setTranslateYMethod · 0.80
postRotateDegreesMethod · 0.80
setSkewXMethod · 0.80
setSkewYMethod · 0.80
mapRectMethod · 0.80
addRectMethod · 0.80
conicToMethod · 0.80
removePlaneMethod · 0.80

Tested by

no test coverage detected