Skip to content

Commit

Permalink
Bug 1683108 - Fix typo r=aosmond
Browse files Browse the repository at this point in the history
Fix a typo caused by Bug 1654462. The mistake is made in: https://hg.mozilla.org/mozilla-central/rev/c1478d03a451c946784194a781bb1ec2ef3621a6#l3.52

In Bug 1654462, we move the main logic of `ConvertYCbCrToRGB` to
`ConvertYCbCrToRGBInternal` and leave `gfx::SwizzleData` behind.
The `gfx::SwizzleData` needs a `IntSize` parameter to perform the task.
However, the initial parameter is from a variable that is moved from
`ConvertYCbCrToRGB` to `ConvertYCbCrToRGBInternal`. The `IntSize`
parameter represents the picture size (`PlanarYCbCrData::mPicSize`) of
the picture of the passed image data. which won't be changed after
`ConvertYCbCrToRGBInternal` is performed (see:
https://hg.mozilla.org/mozilla-central/file/301cb0eb1e488475ab9f48210c12b87887d7ae0b/gfx/ycbcr/YCbCrUtils.cpp#l120).
Therefore, we can pass the original picture size of the image data to
the `gfx::SwizzleData`. That should do the same job as before.

Differential Revision: https://phabricator.services.mozilla.com/D100030
  • Loading branch information
ChunMinChang committed Dec 17, 2020
1 parent ed78ad3 commit 2225ffe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gfx/ycbcr/YCbCrUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ void ConvertYCbCrToRGB(const layers::PlanarYCbCrData& aData,
if (aDestFormat != SurfaceFormat::R5G6B5_UINT16)
gfx::SwizzleData(aDestBuffer, aStride, gfx::SurfaceFormat::X8R8G8B8,
aDestBuffer, aStride, gfx::SurfaceFormat::B8G8R8X8,
srcData.mPicSize);
aData.mPicSize);
#endif
}

Expand Down

0 comments on commit 2225ffe

Please sign in to comment.