mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-27 06:43:32 +00:00
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:
parent
2b66fdd01c
commit
262ab63a40
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user