| 20 | |
| 21 | namespace tgfx { |
| 22 | void ClearPixels(const ImageInfo& dstInfo, void* dstPixels) { |
| 23 | if (dstInfo.rowBytes() == dstInfo.minRowBytes()) { |
| 24 | memset(dstPixels, 0, dstInfo.byteSize()); |
| 25 | return; |
| 26 | } |
| 27 | auto height = static_cast<size_t>(dstInfo.height()); |
| 28 | for (size_t y = 0; y < height; ++y) { |
| 29 | auto row = static_cast<uint8_t*>(dstPixels) + y * dstInfo.rowBytes(); |
| 30 | memset(row, 0, dstInfo.minRowBytes()); |
| 31 | } |
| 32 | } |
| 33 | } // namespace tgfx |
no test coverage detected