Bug 1833354 [Linux] Add surface dump and YUV plane clear debug code to DMABufSurfaceYUV r=emilio DONTBUILD

Differential Revision: https://phabricator.services.mozilla.com/D178623
This commit is contained in:
stransky 2023-05-22 18:00:19 +00:00
parent 2b66fdd01c
commit 262ab63a40

View File

@ -1630,3 +1630,25 @@ DMABufSurfaceYUV::GetAsSourceSurface() {
return source.forget();
}
#if 0
void DMABufSurfaceYUV::ClearPlane(int aPlane) {
if (!MapInternal(0, 0, mWidth[aPlane], mHeight[aPlane], nullptr,
GBM_BO_TRANSFER_WRITE, aPlane)) {
return;
}
if ((int)mMappedRegionStride[aPlane] < mWidth[aPlane]) {
return;
}
memset((char*)mMappedRegion[aPlane], 0,
mMappedRegionStride[aPlane] * mHeight[aPlane]);
Unmap(aPlane);
}
# include "gfxUtils.h"
void DMABufSurfaceYUV::DumpToFile(const char* aFile) {
RefPtr<gfx::DataSourceSurface> surf = GetAsSourceSurface();
gfxUtils::WriteAsPNG(surf, aFile);
}
#endif