Bug 987311 - 3/6 - Make TextureFlags a typed enum, final manual changes - r=nical

This commit is contained in:
Benoit Jacob
2014-04-25 22:34:05 -04:00
parent 1960158bd9
commit dc2f2c47c0
24 changed files with 74 additions and 56 deletions

View File

@@ -19,8 +19,9 @@ using namespace android;
static gfx::SurfaceFormat
SurfaceFormatForAndroidPixelFormat(android::PixelFormat aFormat,
bool swapRB = false)
TextureFlags aFlags)
{
bool swapRB = bool(aFlags & TextureFlags::RB_SWAPPED);
switch (aFormat) {
case android::PIXEL_FORMAT_BGRA_8888:
return swapRB ? gfx::SurfaceFormat::R8G8B8A8 : gfx::SurfaceFormat::B8G8R8A8;
@@ -290,7 +291,7 @@ GrallocTextureHostOGL::GrallocTextureHostOGL(TextureFlags aFlags,
if (graphicBuffer) {
format =
SurfaceFormatForAndroidPixelFormat(graphicBuffer->getPixelFormat(),
aFlags & TextureFlags::RB_SWAPPED);
aFlags);
}
mTextureSource = new GrallocTextureSourceOGL(nullptr,
graphicBuffer,