MCPcopy Create free account
hub / github.com/Tencent/tgfx / ClearPixels

Function ClearPixels

src/core/utils/ClearPixels.cpp:22–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20
21namespace tgfx {
22void 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

Callers 3

onExecuteMethod · 0.85
onReadPixelsMethod · 0.85
readPixelsMethod · 0.85

Calls 4

minRowBytesMethod · 0.80
rowBytesMethod · 0.45
byteSizeMethod · 0.45
heightMethod · 0.45

Tested by

no test coverage detected