Bug 1770560 [Linux] Implement GLBlitHelper::Blit(DMABufSurface* surface,...) to blit DMABufSurface directly r=sotaro,jgilbert

Differential Revision: https://phabricator.services.mozilla.com/D146989
This commit is contained in:
stransky 2022-06-06 13:31:03 +00:00
parent 897738dfed
commit b292c031de
2 changed files with 19 additions and 9 deletions

View File

@ -1326,15 +1326,8 @@ bool GLBlitHelper::BlitImage(layers::GPUVideoImage* const srcImage,
// -------------------------------------
#ifdef MOZ_WAYLAND
bool GLBlitHelper::BlitImage(layers::DMABUFSurfaceImage* srcImage,
const gfx::IntSize& destSize,
OriginPos destOrigin) const {
DMABufSurface* surface = srcImage->GetSurface();
if (!surface) {
gfxCriticalError() << "Null DMABUFSurface for GLBlitHelper::BlitImage";
return false;
}
bool GLBlitHelper::Blit(DMABufSurface* surface, const gfx::IntSize& destSize,
OriginPos destOrigin) const {
const auto& srcOrigin = OriginPos::BottomLeft;
DrawBlitProg::BaseArgs baseArgs;
@ -1388,6 +1381,17 @@ bool GLBlitHelper::BlitImage(layers::DMABUFSurfaceImage* srcImage,
return true;
}
bool GLBlitHelper::BlitImage(layers::DMABUFSurfaceImage* srcImage,
const gfx::IntSize& destSize,
OriginPos destOrigin) const {
DMABufSurface* surface = srcImage->GetSurface();
if (!surface) {
gfxCriticalError() << "Null DMABUFSurface for GLBlitHelper::BlitImage";
return false;
}
return Blit(surface, destSize, destOrigin);
}
#endif
} // namespace gl

View File

@ -40,6 +40,10 @@ class MacIOSurface;
# include "mozilla/java/GeckoSurfaceTextureWrappers.h"
#endif
#ifdef MOZ_WAYLAND
class DMABufSurface;
#endif
namespace mozilla {
namespace layers {
@ -190,6 +194,8 @@ class GLBlitHelper final {
const gfx::IntSize& destSize, OriginPos destOrigin) const;
#endif
#ifdef MOZ_WAYLAND
bool Blit(DMABufSurface* surface, const gfx::IntSize& destSize,
OriginPos destOrigin) const;
bool BlitImage(layers::DMABUFSurfaceImage* srcImage,
const gfx::IntSize& destSize, OriginPos destOrigin) const;
#endif