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

Function expectBitmapIsRed

snap_drawing/test/src/SVGImage_tests.cpp:17–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15}
16
17static void expectBitmapIsRed(const Ref<Image>& image) {
18 TestBitmap bitmap(image->width(), image->height());
19 auto info = bitmap.getInfo();
20 auto* bytes = bitmap.lockBytes();
21 image->draw(info, bytes);
22 bitmap.unlockBytes();
23
24 for (int y = 0; y < image->height(); y++) {
25 for (int x = 0; x < image->width(); x++) {
26 EXPECT_EQ(Color::red(), bitmap.getPixel(x, y)) << "at (" << x << ", " << y << ")";
27 }
28 }
29}
30
31class TestBitmapFactory : public Valdi::IBitmapFactory {
32public:

Callers 1

TESTFunction · 0.70

Calls 7

getPixelMethod · 0.80
getInfoMethod · 0.65
drawMethod · 0.65
widthMethod · 0.45
heightMethod · 0.45
lockBytesMethod · 0.45
unlockBytesMethod · 0.45

Tested by

no test coverage detected