Bug 1717572 - Remove gfxUtils::ConvertBGRAtoRGBA() call in AndroidCompositorWidget::EndRemoteDrawingInRegion() r=lsalzman,gfx-reviewers

gfxUtils::ConvertBGRAtoRGBA() could be removed. BGRA->RBGA conversion could be done by DrawTargetSkia::CopySurface() in RenderCompositorSWGL::CommitMappedBuffer(). Though DrawTargetCairo::CopySurface() does not do the conversion.

On Android, RenderCompositorSWGL is not expected to be used on release. It is only for testing for now.

Differential Revision: https://phabricator.services.mozilla.com/D118449
This commit is contained in:
sotaro 2021-06-22 23:22:50 +00:00
Родитель 165b6e2e26
Коммит c9240ccd99
1 изменённых файлов: 2 добавлений и 6 удалений

Просмотреть файл

@ -51,9 +51,9 @@ AndroidCompositorWidget::StartRemoteDrawingInRegion(
}
const int bpp = 4;
gfx::SurfaceFormat format = gfx::SurfaceFormat::B8G8R8A8;
gfx::SurfaceFormat format = gfx::SurfaceFormat::R8G8B8A8;
if (mFormat == WINDOW_FORMAT_RGBX_8888) {
format = gfx::SurfaceFormat::B8G8R8X8;
format = gfx::SurfaceFormat::R8G8B8X8;
}
RefPtr<gfx::DrawTarget> dt = gfx::Factory::CreateDrawTargetForData(
@ -66,10 +66,6 @@ AndroidCompositorWidget::StartRemoteDrawingInRegion(
void AndroidCompositorWidget::EndRemoteDrawingInRegion(
gfx::DrawTarget* aDrawTarget, const LayoutDeviceIntRegion& aInvalidRegion) {
// XXX Needs convert BGRA to RGBA. RGBA is not supported by sw-wr
const int bpp = 4;
gfxUtils::ConvertBGRAtoRGBA((uint8_t*)mBuffer.bits,
mBuffer.stride * mBuffer.height * bpp);
ANativeWindow_unlockAndPost(mNativeWindow);
}