Bug 877115 - [Moz2Dify] Part 1. Remove ImageFormat typedef from GLContext. (r=nical)

This commit is contained in:
Andreas Pehrson 2013-12-10 17:10:41 +01:00
parent 97b5bcb513
commit c23b8e94f5
2 changed files with 7 additions and 6 deletions

View File

@ -2157,19 +2157,19 @@ GLContext::ReadPixelsIntoImageSurface(gfxImageSurface* dest)
if (DebugMode()) {
NS_WARNING("Needing intermediary surface for ReadPixels. This will be slow!");
}
ImageFormat readFormatGFX;
SurfaceFormat readFormatGFX;
switch (readFormat) {
case LOCAL_GL_RGBA:
case LOCAL_GL_BGRA: {
readFormatGFX = hasAlpha ? gfxImageFormatARGB32
: gfxImageFormatRGB24;
readFormatGFX = hasAlpha ? FORMAT_B8G8R8A8
: FORMAT_B8G8R8X8;
break;
}
case LOCAL_GL_RGB: {
MOZ_ASSERT(readPixelSize == 2);
MOZ_ASSERT(readType == LOCAL_GL_UNSIGNED_SHORT_5_6_5_REV);
readFormatGFX = gfxImageFormatRGB16_565;
readFormatGFX = FORMAT_R5G6B5;
break;
}
default: {
@ -2198,7 +2198,9 @@ GLContext::ReadPixelsIntoImageSurface(gfxImageSurface* dest)
}
}
tempSurf = new gfxImageSurface(dest->GetSize(), readFormatGFX, false);
tempSurf = new gfxImageSurface(dest->GetSize(),
gfxImageFormat(readFormatGFX),
false);
readSurf = tempSurf;
} else {
readPixelSize = destPixelSize;

View File

@ -2377,7 +2377,6 @@ protected:
typedef class gfx::SharedSurface SharedSurface;
typedef gfx::SharedSurfaceType SharedSurfaceType;
typedef gfxImageFormat ImageFormat;
typedef gfx::SurfaceFormat SurfaceFormat;
public: