mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-14 14:02:47 +00:00
Bug 1359155, part 3 - Convert BasicPlanarYCbCrImage::CopyData to use Moz2D's StrideForFormatAndWidth. r=mstange
MozReview-Commit-ID: F8EyjjQ0sX9
This commit is contained in:
parent
5ca294eae0
commit
cb165b4a0a
@ -21,6 +21,7 @@
|
||||
#include "nsISupportsImpl.h" // for Image::Release, etc
|
||||
#include "nsThreadUtils.h" // for NS_IsMainThread
|
||||
#include "mozilla/gfx/Point.h" // for IntSize
|
||||
#include "mozilla/gfx/DataSurfaceHelpers.h"
|
||||
#include "gfx2DGlue.h"
|
||||
#include "YCbCrUtils.h" // for YCbCr conversions
|
||||
|
||||
@ -110,8 +111,7 @@ BasicPlanarYCbCrImage::CopyData(const Data& aData)
|
||||
return false;
|
||||
}
|
||||
|
||||
gfxImageFormat iFormat = gfx::SurfaceFormatToImageFormat(format);
|
||||
mStride = gfxASurface::FormatStrideForWidth(iFormat, size.width);
|
||||
mStride = gfx::StrideForFormatAndWidth(format, size.width);
|
||||
mozilla::CheckedInt32 requiredBytes =
|
||||
mozilla::CheckedInt32(size.height) * mozilla::CheckedInt32(mStride);
|
||||
if (!requiredBytes.isValid()) {
|
||||
@ -125,7 +125,7 @@ BasicPlanarYCbCrImage::CopyData(const Data& aData)
|
||||
}
|
||||
|
||||
gfx::ConvertYCbCrToRGB(aData, format, size, mDecodedBuffer.get(), mStride);
|
||||
SetOffscreenFormat(iFormat);
|
||||
SetOffscreenFormat(gfx::SurfaceFormatToImageFormat(format));
|
||||
mSize = size;
|
||||
|
||||
return true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user