diff --git a/gfx/layers/ImageContainer.cpp b/gfx/layers/ImageContainer.cpp index eed298f0222a..2e0689f3da69 100644 --- a/gfx/layers/ImageContainer.cpp +++ b/gfx/layers/ImageContainer.cpp @@ -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 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 || diff --git a/gfx/layers/ImageContainer.h b/gfx/layers/ImageContainer.h index a86e4dc16f1d..d7b92a8f5b60 100644 --- a/gfx/layers/ImageContainer.h +++ b/gfx/layers/ImageContainer.h @@ -722,7 +722,7 @@ protected: already_AddRefed GetAsSurface(); void SetOffscreenFormat(gfxASurface::gfxImageFormat aFormat) { mOffscreenFormat = aFormat; } - gfxASurface::gfxImageFormat GetOffscreenFormat() { return mOffscreenFormat; } + gfxASurface::gfxImageFormat GetOffscreenFormat(); nsAutoArrayPtr mBuffer; uint32_t mBufferSize;