From 5166929d97c934c9585cfae87e18060409ecf542 Mon Sep 17 00:00:00 2001 From: Jean-Yves Avenard Date: Tue, 28 Nov 2017 15:53:54 +0100 Subject: [PATCH] Bug 1421187 - P2. Properly set bytesPerPixel in MappedYCbCrTextureData. r=mattwoodrow MozReview-Commit-ID: 891mPTv2Npj --HG-- extra : rebase_source : 774360db3b03d8e57f5563cce2eb79421e17cd14 --- gfx/layers/BufferTexture.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gfx/layers/BufferTexture.cpp b/gfx/layers/BufferTexture.cpp index a204a406e895..d78d4e308bee 100644 --- a/gfx/layers/BufferTexture.cpp +++ b/gfx/layers/BufferTexture.cpp @@ -371,21 +371,25 @@ BufferTextureData::BorrowMappedYCbCrData(MappedYCbCrTextureData& aMap) aMap.stereoMode = desc.stereoMode(); aMap.metadata = nullptr; + uint32_t bytesPerPixel = desc.bitDepth() > 8 ? 2 : 1; aMap.y.data = data + desc.yOffset(); aMap.y.size = ySize; aMap.y.stride = desc.yStride(); aMap.y.skip = 0; + aMap.y.bytesPerPixel = bytesPerPixel; aMap.cb.data = data + desc.cbOffset(); aMap.cb.size = cbCrSize; aMap.cb.stride = desc.cbCrStride(); aMap.cb.skip = 0; + aMap.cb.bytesPerPixel = bytesPerPixel; aMap.cr.data = data + desc.crOffset(); aMap.cr.size = cbCrSize; aMap.cr.stride = desc.cbCrStride(); aMap.cr.skip = 0; + aMap.cr.bytesPerPixel = bytesPerPixel; return true; }