Bug 824642 - PlanarYCbCrImage::GetAsSurface does not create surface optimized for platform. r=joe, r=nsilva

This commit is contained in:
Oleg Romashin 2013-01-23 18:08:16 -05:00
parent 18cbda81f3
commit d496a1e052
2 changed files with 10 additions and 2 deletions

View File

@ -17,6 +17,7 @@
#include "gfxSharedImageSurface.h"
#include "yuv_convert.h"
#include "gfxUtils.h"
#include "gfxPlatform.h"
#ifdef XP_MACOSX
#include "mozilla/gfx/QuartzSupport.h"
@ -477,6 +478,14 @@ PlanarYCbCrImage::SetData(const Data &aData)
CopyData(aData);
}
gfxASurface::gfxImageFormat
PlanarYCbCrImage::GetOffscreenFormat()
{
return mOffscreenFormat != gfxASurface::ImageFormatUnknown ?
gfxPlatform::GetPlatform()->GetOffscreenFormat() :
mOffscreenFormat;
}
already_AddRefed<gfxASurface>
PlanarYCbCrImage::GetAsSurface()
{
@ -486,7 +495,6 @@ PlanarYCbCrImage::GetAsSurface()
}
gfxASurface::gfxImageFormat format = GetOffscreenFormat();
gfxIntSize size(mSize);
gfxUtils::GetYCbCrToRGBDestFormatAndSize(mData, format, size);
if (size.width > PlanarYCbCrImage::MAX_DIMENSION ||

View File

@ -722,7 +722,7 @@ protected:
already_AddRefed<gfxASurface> GetAsSurface();
void SetOffscreenFormat(gfxASurface::gfxImageFormat aFormat) { mOffscreenFormat = aFormat; }
gfxASurface::gfxImageFormat GetOffscreenFormat() { return mOffscreenFormat; }
gfxASurface::gfxImageFormat GetOffscreenFormat();
nsAutoArrayPtr<uint8_t> mBuffer;
uint32_t mBufferSize;