| 15 | } |
| 16 | |
| 17 | static 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 | |
| 31 | class TestBitmapFactory : public Valdi::IBitmapFactory { |
| 32 | public: |