mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-06 14:44:26 +00:00
Bug 824642 - PlanarYCbCrImage::GetAsSurface does not create surface optimized for platform. r=joe, r=nsilva
This commit is contained in:
parent
28db8f365c
commit
ada40fe742
@ -17,6 +17,7 @@
|
|||||||
#include "gfxSharedImageSurface.h"
|
#include "gfxSharedImageSurface.h"
|
||||||
#include "yuv_convert.h"
|
#include "yuv_convert.h"
|
||||||
#include "gfxUtils.h"
|
#include "gfxUtils.h"
|
||||||
|
#include "gfxPlatform.h"
|
||||||
|
|
||||||
#ifdef XP_MACOSX
|
#ifdef XP_MACOSX
|
||||||
#include "mozilla/gfx/QuartzSupport.h"
|
#include "mozilla/gfx/QuartzSupport.h"
|
||||||
@ -477,6 +478,14 @@ PlanarYCbCrImage::SetData(const Data &aData)
|
|||||||
CopyData(aData);
|
CopyData(aData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gfxASurface::gfxImageFormat
|
||||||
|
PlanarYCbCrImage::GetOffscreenFormat()
|
||||||
|
{
|
||||||
|
return mOffscreenFormat != gfxASurface::ImageFormatUnknown ?
|
||||||
|
gfxPlatform::GetPlatform()->GetOffscreenFormat() :
|
||||||
|
mOffscreenFormat;
|
||||||
|
}
|
||||||
|
|
||||||
already_AddRefed<gfxASurface>
|
already_AddRefed<gfxASurface>
|
||||||
PlanarYCbCrImage::GetAsSurface()
|
PlanarYCbCrImage::GetAsSurface()
|
||||||
{
|
{
|
||||||
@ -486,7 +495,6 @@ PlanarYCbCrImage::GetAsSurface()
|
|||||||
}
|
}
|
||||||
|
|
||||||
gfxASurface::gfxImageFormat format = GetOffscreenFormat();
|
gfxASurface::gfxImageFormat format = GetOffscreenFormat();
|
||||||
|
|
||||||
gfxIntSize size(mSize);
|
gfxIntSize size(mSize);
|
||||||
gfxUtils::GetYCbCrToRGBDestFormatAndSize(mData, format, size);
|
gfxUtils::GetYCbCrToRGBDestFormatAndSize(mData, format, size);
|
||||||
if (size.width > PlanarYCbCrImage::MAX_DIMENSION ||
|
if (size.width > PlanarYCbCrImage::MAX_DIMENSION ||
|
||||||
|
@ -722,7 +722,7 @@ protected:
|
|||||||
already_AddRefed<gfxASurface> GetAsSurface();
|
already_AddRefed<gfxASurface> GetAsSurface();
|
||||||
|
|
||||||
void SetOffscreenFormat(gfxASurface::gfxImageFormat aFormat) { mOffscreenFormat = aFormat; }
|
void SetOffscreenFormat(gfxASurface::gfxImageFormat aFormat) { mOffscreenFormat = aFormat; }
|
||||||
gfxASurface::gfxImageFormat GetOffscreenFormat() { return mOffscreenFormat; }
|
gfxASurface::gfxImageFormat GetOffscreenFormat();
|
||||||
|
|
||||||
nsAutoArrayPtr<uint8_t> mBuffer;
|
nsAutoArrayPtr<uint8_t> mBuffer;
|
||||||
uint32_t mBufferSize;
|
uint32_t mBufferSize;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user