diff --git a/dom/canvas/CanvasRenderingContext2D.cpp b/dom/canvas/CanvasRenderingContext2D.cpp index 47e15a9aa90..d59236870ed 100644 --- a/dom/canvas/CanvasRenderingContext2D.cpp +++ b/dom/canvas/CanvasRenderingContext2D.cpp @@ -4497,7 +4497,7 @@ CanvasRenderingContext2D::DrawImage(const CanvasImageSource& image, if (ok) { NativeSurface texSurf; texSurf.mType = NativeSurfaceType::OPENGL_TEXTURE; - texSurf.mFormat = SurfaceFormat::R5G6B5; + texSurf.mFormat = SurfaceFormat::R5G6B5_UINT16; texSurf.mSize.width = mCurrentVideoSize.width; texSurf.mSize.height = mCurrentVideoSize.height; texSurf.mSurface = (void*)((uintptr_t)mVideoTexture); diff --git a/dom/canvas/WebGLContextGL.cpp b/dom/canvas/WebGLContextGL.cpp index f1fc22d0553..ad3ad3d04ee 100644 --- a/dom/canvas/WebGLContextGL.cpp +++ b/dom/canvas/WebGLContextGL.cpp @@ -1943,7 +1943,7 @@ WebGLContext::SurfaceFromElementResultToImageSurface(nsLayoutUtils::SurfaceFromE case SurfaceFormat::A8: *format = WebGLTexelFormat::A8; break; - case SurfaceFormat::R5G6B5: + case SurfaceFormat::R5G6B5_UINT16: *format = WebGLTexelFormat::RGB565; break; default: diff --git a/dom/media/encoder/VP8TrackEncoder.cpp b/dom/media/encoder/VP8TrackEncoder.cpp index b8acd48405d..f318cc9ca47 100644 --- a/dom/media/encoder/VP8TrackEncoder.cpp +++ b/dom/media/encoder/VP8TrackEncoder.cpp @@ -403,7 +403,7 @@ nsresult VP8TrackEncoder::PrepareRawFrame(VideoChunk &aChunk) cr, halfWidth, mFrameWidth, mFrameHeight); break; - case SurfaceFormat::R5G6B5: + case SurfaceFormat::R5G6B5_UINT16: rv = libyuv::RGB565ToI420(static_cast(map.GetData()), map.GetStride(), y, mFrameWidth, diff --git a/gfx/2d/DrawTargetCairo.cpp b/gfx/2d/DrawTargetCairo.cpp index a5234326b98..ee0fffb7a47 100644 --- a/gfx/2d/DrawTargetCairo.cpp +++ b/gfx/2d/DrawTargetCairo.cpp @@ -671,7 +671,7 @@ GfxFormatForCairoSurface(cairo_surface_t* surface) // xlib is currently the only Cairo backend that creates 16bpp surfaces if (type == CAIRO_SURFACE_TYPE_XLIB && cairo_xlib_surface_get_depth(surface) == 16) { - return SurfaceFormat::R5G6B5; + return SurfaceFormat::R5G6B5_UINT16; } #endif return CairoContentToGfxFormat(cairo_surface_get_content(surface)); diff --git a/gfx/2d/HelpersCairo.h b/gfx/2d/HelpersCairo.h index 7f753d01555..997716ee18d 100644 --- a/gfx/2d/HelpersCairo.h +++ b/gfx/2d/HelpersCairo.h @@ -153,7 +153,7 @@ GfxFormatToCairoFormat(SurfaceFormat format) return CAIRO_FORMAT_RGB24; case SurfaceFormat::A8: return CAIRO_FORMAT_A8; - case SurfaceFormat::R5G6B5: + case SurfaceFormat::R5G6B5_UINT16: return CAIRO_FORMAT_RGB16_565; default: gfxCriticalError() << "Unknown image format " << (int)format; @@ -169,7 +169,7 @@ GfxFormatToCairoContent(SurfaceFormat format) case SurfaceFormat::B8G8R8A8: return CAIRO_CONTENT_COLOR_ALPHA; case SurfaceFormat::B8G8R8X8: - case SurfaceFormat::R5G6B5: //fall through + case SurfaceFormat::R5G6B5_UINT16: //fall through return CAIRO_CONTENT_COLOR; case SurfaceFormat::A8: return CAIRO_CONTENT_ALPHA; @@ -241,7 +241,7 @@ CairoFormatToGfxFormat(cairo_format_t format) case CAIRO_FORMAT_A8: return SurfaceFormat::A8; case CAIRO_FORMAT_RGB16_565: - return SurfaceFormat::R5G6B5; + return SurfaceFormat::R5G6B5_UINT16; default: gfxCriticalError() << "Unknown cairo format " << format; return SurfaceFormat::UNKNOWN; diff --git a/gfx/2d/HelpersSkia.h b/gfx/2d/HelpersSkia.h index d7bb0f963e6..8caa2f85927 100644 --- a/gfx/2d/HelpersSkia.h +++ b/gfx/2d/HelpersSkia.h @@ -30,7 +30,7 @@ GfxFormatToSkiaColorType(SurfaceFormat format) case SurfaceFormat::B8G8R8X8: // We probably need to do something here. return kBGRA_8888_SkColorType; - case SurfaceFormat::R5G6B5: + case SurfaceFormat::R5G6B5_UINT16: return kRGB_565_SkColorType; case SurfaceFormat::A8: return kAlpha_8_SkColorType; @@ -47,7 +47,7 @@ SkiaColorTypeToGfxFormat(SkColorType type) case kBGRA_8888_SkColorType: return SurfaceFormat::B8G8R8A8; case kRGB_565_SkColorType: - return SurfaceFormat::R5G6B5; + return SurfaceFormat::R5G6B5_UINT16; case kAlpha_8_SkColorType: return SurfaceFormat::A8; default: @@ -66,7 +66,7 @@ GfxFormatToGrConfig(SurfaceFormat format) case SurfaceFormat::B8G8R8X8: // We probably need to do something here. return kBGRA_8888_GrPixelConfig; - case SurfaceFormat::R5G6B5: + case SurfaceFormat::R5G6B5_UINT16: return kRGB_565_GrPixelConfig; case SurfaceFormat::A8: return kAlpha_8_GrPixelConfig; diff --git a/gfx/2d/Logging.h b/gfx/2d/Logging.h index 04e070982fd..10440188d2f 100644 --- a/gfx/2d/Logging.h +++ b/gfx/2d/Logging.h @@ -399,8 +399,8 @@ public: case SurfaceFormat::R8G8B8X8: mMessage << "SurfaceFormat::R8G8B8X8"; break; - case SurfaceFormat::R5G6B5: - mMessage << "SurfaceFormat::R5G6B5"; + case SurfaceFormat::R5G6B5_UINT16: + mMessage << "SurfaceFormat::R5G6B5_UINT16"; break; case SurfaceFormat::A8: mMessage << "SurfaceFormat::A8"; diff --git a/gfx/2d/Tools.h b/gfx/2d/Tools.h index c4b95d50135..1a141452b3c 100644 --- a/gfx/2d/Tools.h +++ b/gfx/2d/Tools.h @@ -86,7 +86,7 @@ BytesPerPixel(SurfaceFormat aFormat) switch (aFormat) { case SurfaceFormat::A8: return 1; - case SurfaceFormat::R5G6B5: + case SurfaceFormat::R5G6B5_UINT16: return 2; default: return 4; diff --git a/gfx/2d/Types.h b/gfx/2d/Types.h index d41417a8c86..18614800498 100644 --- a/gfx/2d/Types.h +++ b/gfx/2d/Types.h @@ -34,7 +34,7 @@ enum class SurfaceFormat : int8_t { B8G8R8X8, R8G8B8A8, R8G8B8X8, - R5G6B5, + R5G6B5_UINT16, A8, YUV, NV12, @@ -46,7 +46,7 @@ inline bool IsOpaque(SurfaceFormat aFormat) switch (aFormat) { case SurfaceFormat::B8G8R8X8: case SurfaceFormat::R8G8B8X8: - case SurfaceFormat::R5G6B5: + case SurfaceFormat::R5G6B5_UINT16: case SurfaceFormat::YUV: case SurfaceFormat::NV12: return true; diff --git a/gfx/gl/GLReadTexImageHelper.cpp b/gfx/gl/GLReadTexImageHelper.cpp index 7e43d8b350b..c539c21fec7 100644 --- a/gfx/gl/GLReadTexImageHelper.cpp +++ b/gfx/gl/GLReadTexImageHelper.cpp @@ -274,7 +274,7 @@ CopyDataSourceSurface(DataSourceSurface* aSource, aDest->GetFormat() == SurfaceFormat::R8G8B8X8 || aDest->GetFormat() == SurfaceFormat::B8G8R8A8 || aDest->GetFormat() == SurfaceFormat::B8G8R8X8 || - aDest->GetFormat() == SurfaceFormat::R5G6B5); + aDest->GetFormat() == SurfaceFormat::R5G6B5_UINT16); const bool isSrcBGR = aSource->GetFormat() == SurfaceFormat::B8G8R8A8 || aSource->GetFormat() == SurfaceFormat::B8G8R8X8; @@ -288,7 +288,7 @@ CopyDataSourceSurface(DataSourceSurface* aSource, aDest->GetFormat() == SurfaceFormat::B8G8R8A8; const bool needsAlphaMask = !srcHasAlpha && destHasAlpha; - const bool needsConvertTo16Bits = aDest->GetFormat() == SurfaceFormat::R5G6B5; + const bool needsConvertTo16Bits = aDest->GetFormat() == SurfaceFormat::R5G6B5_UINT16; DataSourceSurface::MappedSurface srcMap; DataSourceSurface::MappedSurface destMap; @@ -394,7 +394,7 @@ ReadPixelsIntoDataSurface(GLContext* gl, DataSourceSurface* dest) destFormat = LOCAL_GL_RGBA; destType = LOCAL_GL_UNSIGNED_BYTE; break; - case SurfaceFormat::R5G6B5: + case SurfaceFormat::R5G6B5_UINT16: destFormat = LOCAL_GL_RGB; destType = LOCAL_GL_UNSIGNED_SHORT_5_6_5_REV; break; @@ -438,7 +438,7 @@ ReadPixelsIntoDataSurface(GLContext* gl, DataSourceSurface* dest) case LOCAL_GL_RGB: { MOZ_ASSERT(destPixelSize == 2); MOZ_ASSERT(readType == LOCAL_GL_UNSIGNED_SHORT_5_6_5_REV); - readFormatGFX = SurfaceFormat::R5G6B5; + readFormatGFX = SurfaceFormat::R5G6B5_UINT16; break; } default: { diff --git a/gfx/gl/GLUploadHelpers.cpp b/gfx/gl/GLUploadHelpers.cpp index 78867db529b..0a650419844 100644 --- a/gfx/gl/GLUploadHelpers.cpp +++ b/gfx/gl/GLUploadHelpers.cpp @@ -486,10 +486,10 @@ UploadImageDataToTexture(GLContext* gl, } internalFormat = LOCAL_GL_RGBA; break; - case SurfaceFormat::R5G6B5: + case SurfaceFormat::R5G6B5_UINT16: internalFormat = format = LOCAL_GL_RGB; type = LOCAL_GL_UNSIGNED_SHORT_5_6_5; - surfaceFormat = SurfaceFormat::R5G6B5; + surfaceFormat = SurfaceFormat::R5G6B5_UINT16; break; case SurfaceFormat::A8: internalFormat = format = LOCAL_GL_LUMINANCE; diff --git a/gfx/gl/TextureImageEGL.cpp b/gfx/gl/TextureImageEGL.cpp index 95a4fae8db4..1f4323b60e6 100644 --- a/gfx/gl/TextureImageEGL.cpp +++ b/gfx/gl/TextureImageEGL.cpp @@ -20,7 +20,7 @@ GLFormatForImage(gfx::SurfaceFormat aFormat) case gfx::SurfaceFormat::B8G8R8A8: case gfx::SurfaceFormat::B8G8R8X8: return LOCAL_GL_RGBA; - case gfx::SurfaceFormat::R5G6B5: + case gfx::SurfaceFormat::R5G6B5_UINT16: return LOCAL_GL_RGB; case gfx::SurfaceFormat::A8: return LOCAL_GL_LUMINANCE; @@ -38,7 +38,7 @@ GLTypeForImage(gfx::SurfaceFormat aFormat) case gfx::SurfaceFormat::B8G8R8X8: case gfx::SurfaceFormat::A8: return LOCAL_GL_UNSIGNED_BYTE; - case gfx::SurfaceFormat::R5G6B5: + case gfx::SurfaceFormat::R5G6B5_UINT16: return LOCAL_GL_UNSIGNED_SHORT_5_6_5; default: NS_WARNING("Unknown GL format for Surface format"); @@ -69,7 +69,7 @@ TextureImageEGL::TextureImageEGL(GLuint aTexture, gfxPlatform::GetPlatform()->Optimal2DFormatForContent(GetContentType()); } - if (mUpdateFormat == gfx::SurfaceFormat::R5G6B5) { + if (mUpdateFormat == gfx::SurfaceFormat::R5G6B5_UINT16) { mTextureFormat = gfx::SurfaceFormat::R8G8B8X8; } else if (mUpdateFormat == gfx::SurfaceFormat::B8G8R8X8) { mTextureFormat = gfx::SurfaceFormat::B8G8R8X8; diff --git a/gfx/layers/Effects.h b/gfx/layers/Effects.h index 8ae40100e63..2bea06d8a36 100644 --- a/gfx/layers/Effects.h +++ b/gfx/layers/Effects.h @@ -267,7 +267,7 @@ CreateTexturedEffect(gfx::SurfaceFormat aFormat, case gfx::SurfaceFormat::B8G8R8A8: case gfx::SurfaceFormat::B8G8R8X8: case gfx::SurfaceFormat::R8G8B8X8: - case gfx::SurfaceFormat::R5G6B5: + case gfx::SurfaceFormat::R5G6B5_UINT16: case gfx::SurfaceFormat::R8G8B8A8: result = new EffectRGB(aSource, isAlphaPremultiplied, aFilter); break; diff --git a/gfx/layers/GrallocImages.cpp b/gfx/layers/GrallocImages.cpp index 364b13498a4..4058a1039a4 100644 --- a/gfx/layers/GrallocImages.cpp +++ b/gfx/layers/GrallocImages.cpp @@ -384,7 +384,7 @@ ConvertOmxYUVFormatToRGB565(android::sp& aBuffer, return BAD_VALUE; } - uint32_t pixelStride = aMappedSurface->mStride/gfx::BytesPerPixel(gfx::SurfaceFormat::R5G6B5); + uint32_t pixelStride = aMappedSurface->mStride/gfx::BytesPerPixel(gfx::SurfaceFormat::R5G6B5_UINT16); rv = colorConverter.convert(buffer, width, height, 0, 0, width - 1, height - 1 /* source crop */, aMappedSurface->mData, pixelStride, height, diff --git a/gfx/layers/LayersLogging.cpp b/gfx/layers/LayersLogging.cpp index c9862ebc218..ca8a8ad9c7a 100644 --- a/gfx/layers/LayersLogging.cpp +++ b/gfx/layers/LayersLogging.cpp @@ -316,7 +316,8 @@ AppendToString(std::stringstream& aStream, mozilla::gfx::SurfaceFormat format, case SurfaceFormat::B8G8R8X8: aStream << "SurfaceFormat::B8G8R8X8"; break; case SurfaceFormat::R8G8B8A8: aStream << "SurfaceFormat::R8G8B8A8"; break; case SurfaceFormat::R8G8B8X8: aStream << "SurfaceFormat::R8G8B8X8"; break; - case SurfaceFormat::R5G6B5: aStream << "SurfaceFormat::R5G6B5"; break; + case SurfaceFormat::R5G6B5_UINT16: + aStream << "SurfaceFormat::R5G6B5_UINT16"; break; case SurfaceFormat::A8: aStream << "SurfaceFormat::A8"; break; case SurfaceFormat::YUV: aStream << "SurfaceFormat::YUV"; break; case SurfaceFormat::NV12: aStream << "SurfaceFormat::NV12"; break; diff --git a/gfx/layers/opengl/CompositorOGL.cpp b/gfx/layers/opengl/CompositorOGL.cpp index e2f1b386d72..256e0915d0f 100644 --- a/gfx/layers/opengl/CompositorOGL.cpp +++ b/gfx/layers/opengl/CompositorOGL.cpp @@ -833,7 +833,7 @@ CompositorOGL::GetShaderConfigFor(Effect *aEffect, MOZ_ASSERT_IF(source->GetTextureTarget() == LOCAL_GL_TEXTURE_RECTANGLE_ARB, source->GetFormat() == gfx::SurfaceFormat::R8G8B8A8 || source->GetFormat() == gfx::SurfaceFormat::R8G8B8X8 || - source->GetFormat() == gfx::SurfaceFormat::R5G6B5); + source->GetFormat() == gfx::SurfaceFormat::R5G6B5_UINT16); config = ShaderConfigFromTargetAndFormat(source->GetTextureTarget(), source->GetFormat()); break; diff --git a/gfx/layers/opengl/GrallocTextureClient.cpp b/gfx/layers/opengl/GrallocTextureClient.cpp index 78bb32060e1..f55c53a404d 100644 --- a/gfx/layers/opengl/GrallocTextureClient.cpp +++ b/gfx/layers/opengl/GrallocTextureClient.cpp @@ -181,7 +181,7 @@ SurfaceFormatForPixelFormat(android::PixelFormat aFormat) case PIXEL_FORMAT_RGBX_8888: return gfx::SurfaceFormat::R8G8B8X8; case PIXEL_FORMAT_RGB_565: - return gfx::SurfaceFormat::R5G6B5; + return gfx::SurfaceFormat::R5G6B5_UINT16; case HAL_PIXEL_FORMAT_YV12: return gfx::SurfaceFormat::YUV; default: @@ -284,7 +284,7 @@ GrallocTextureClientOGL::AllocateForSurface(gfx::IntSize aSize, format = android::PIXEL_FORMAT_RGBX_8888; mFlags |= TextureFlags::RB_SWAPPED; break; - case gfx::SurfaceFormat::R5G6B5: + case gfx::SurfaceFormat::R5G6B5_UINT16: format = android::PIXEL_FORMAT_RGB_565; break; case gfx::SurfaceFormat::YUV: @@ -329,7 +329,7 @@ GrallocTextureClientOGL::AllocateForGLRendering(gfx::IntSize aSize) // there is no android BGRX format? format = android::PIXEL_FORMAT_RGBX_8888; break; - case gfx::SurfaceFormat::R5G6B5: + case gfx::SurfaceFormat::R5G6B5_UINT16: format = android::PIXEL_FORMAT_RGB_565; break; default: diff --git a/gfx/layers/opengl/GrallocTextureHost.cpp b/gfx/layers/opengl/GrallocTextureHost.cpp index 19b58fa6cff..28cea35c5c1 100644 --- a/gfx/layers/opengl/GrallocTextureHost.cpp +++ b/gfx/layers/opengl/GrallocTextureHost.cpp @@ -35,7 +35,7 @@ SurfaceFormatForAndroidPixelFormat(android::PixelFormat aFormat, case android::PIXEL_FORMAT_RGBX_8888: return swapRB ? gfx::SurfaceFormat::B8G8R8X8 : gfx::SurfaceFormat::R8G8B8X8; case android::PIXEL_FORMAT_RGB_565: - return gfx::SurfaceFormat::R5G6B5; + return gfx::SurfaceFormat::R5G6B5_UINT16; case HAL_PIXEL_FORMAT_YCbCr_422_SP: case HAL_PIXEL_FORMAT_YCrCb_420_SP: case HAL_PIXEL_FORMAT_YCbCr_422_I: diff --git a/gfx/layers/opengl/OGLShaderProgram.h b/gfx/layers/opengl/OGLShaderProgram.h index f1d5ae1b70e..f0243c53bde 100644 --- a/gfx/layers/opengl/OGLShaderProgram.h +++ b/gfx/layers/opengl/OGLShaderProgram.h @@ -249,7 +249,7 @@ ShaderConfigFromTargetAndFormat(GLenum aTarget, aFormat == gfx::SurfaceFormat::B8G8R8X8); config.SetNoAlpha(aFormat == gfx::SurfaceFormat::B8G8R8X8 || aFormat == gfx::SurfaceFormat::R8G8B8X8 || - aFormat == gfx::SurfaceFormat::R5G6B5); + aFormat == gfx::SurfaceFormat::R5G6B5_UINT16); return config; } diff --git a/gfx/thebes/gfx2DGlue.h b/gfx/thebes/gfx2DGlue.h index 5c79a951a3f..214e997f258 100644 --- a/gfx/thebes/gfx2DGlue.h +++ b/gfx/thebes/gfx2DGlue.h @@ -88,7 +88,7 @@ inline gfxImageFormat SurfaceFormatToImageFormat(SurfaceFormat aFormat) return gfxImageFormat::ARGB32; case SurfaceFormat::B8G8R8X8: return gfxImageFormat::RGB24; - case SurfaceFormat::R5G6B5: + case SurfaceFormat::R5G6B5_UINT16: return gfxImageFormat::RGB16_565; case SurfaceFormat::A8: return gfxImageFormat::A8; @@ -105,7 +105,7 @@ inline SurfaceFormat ImageFormatToSurfaceFormat(gfxImageFormat aFormat) case gfxImageFormat::RGB24: return SurfaceFormat::B8G8R8X8; case gfxImageFormat::RGB16_565: - return SurfaceFormat::R5G6B5; + return SurfaceFormat::R5G6B5_UINT16; case gfxImageFormat::A8: return SurfaceFormat::A8; default: @@ -117,7 +117,7 @@ inline SurfaceFormat ImageFormatToSurfaceFormat(gfxImageFormat aFormat) inline gfxContentType ContentForFormat(const SurfaceFormat &aFormat) { switch (aFormat) { - case SurfaceFormat::R5G6B5: + case SurfaceFormat::R5G6B5_UINT16: case SurfaceFormat::B8G8R8X8: case SurfaceFormat::R8G8B8X8: return gfxContentType::COLOR; diff --git a/gfx/thebes/gfxPlatform.cpp b/gfx/thebes/gfxPlatform.cpp index 9b138b7096e..819cbafd06e 100644 --- a/gfx/thebes/gfxPlatform.cpp +++ b/gfx/thebes/gfxPlatform.cpp @@ -1852,7 +1852,7 @@ gfxPlatform::Optimal2DFormatForContent(gfxContentType aContent) case gfxImageFormat::RGB24: return mozilla::gfx::SurfaceFormat::B8G8R8X8; case gfxImageFormat::RGB16_565: - return mozilla::gfx::SurfaceFormat::R5G6B5; + return mozilla::gfx::SurfaceFormat::R5G6B5_UINT16; default: NS_NOTREACHED("unknown gfxImageFormat for gfxContentType::COLOR"); return mozilla::gfx::SurfaceFormat::B8G8R8A8; diff --git a/gfx/thebes/gfxUtils.cpp b/gfx/thebes/gfxUtils.cpp index ec66f494898..e6f71c6d05e 100644 --- a/gfx/thebes/gfxUtils.cpp +++ b/gfx/thebes/gfxUtils.cpp @@ -73,7 +73,7 @@ void mozilla_dump_image(void* bytes, int width, int height, int bytepp, // TODO more flexible; parse string? switch (bytepp) { case 2: - format = SurfaceFormat::R5G6B5; + format = SurfaceFormat::R5G6B5_UINT16; break; case 4: default: diff --git a/gfx/ycbcr/YCbCrUtils.cpp b/gfx/ycbcr/YCbCrUtils.cpp index ea3fb7c8f44..024520c7880 100644 --- a/gfx/ycbcr/YCbCrUtils.cpp +++ b/gfx/ycbcr/YCbCrUtils.cpp @@ -28,7 +28,7 @@ GetYCbCrToRGBDestFormatAndSize(const layers::PlanarYCbCrData& aData, bool prescale = aSuggestedSize.width > 0 && aSuggestedSize.height > 0 && aSuggestedSize != aData.mPicSize; - if (aSuggestedFormat == SurfaceFormat::R5G6B5) { + if (aSuggestedFormat == SurfaceFormat::R5G6B5_UINT16) { #if defined(HAVE_YCBCR_TO_RGB565) if (prescale && !IsScaleYCbCrToRGB565Fast(aData.mPicX, @@ -88,7 +88,7 @@ ConvertYCbCrToRGB(const layers::PlanarYCbCrData& aData, // Convert from YCbCr to RGB now, scaling the image if needed. if (aDestSize != aData.mPicSize) { #if defined(HAVE_YCBCR_TO_RGB565) - if (aDestFormat == SurfaceFormat::R5G6B5) { + if (aDestFormat == SurfaceFormat::R5G6B5_UINT16) { ScaleYCbCrToRGB565(aData.mYChannel, aData.mCbChannel, aData.mCrChannel, @@ -122,7 +122,7 @@ ConvertYCbCrToRGB(const layers::PlanarYCbCrData& aData, FILTER_BILINEAR); } else { // no prescale #if defined(HAVE_YCBCR_TO_RGB565) - if (aDestFormat == SurfaceFormat::R5G6B5) { + if (aDestFormat == SurfaceFormat::R5G6B5_UINT16) { ConvertYCbCrToRGB565(aData.mYChannel, aData.mCbChannel, aData.mCrChannel, diff --git a/image/imgFrame.cpp b/image/imgFrame.cpp index d5535344284..c25acb822d7 100644 --- a/image/imgFrame.cpp +++ b/image/imgFrame.cpp @@ -396,7 +396,7 @@ imgFrame::Optimize() ->Optimal2DFormatForContent(gfxContentType::COLOR); if (mFormat != SurfaceFormat::B8G8R8A8 && - optFormat == SurfaceFormat::R5G6B5) { + optFormat == SurfaceFormat::R5G6B5_UINT16) { RefPtr buf = AllocateBufferForImage(mSize, optFormat); if (!buf) { diff --git a/media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp b/media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp index adb52fb8038..3b95009ed96 100644 --- a/media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp +++ b/media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp @@ -1205,7 +1205,7 @@ void MediaPipelineTransmit::PipelineListener::ProcessVideoChunk( yuv + cr_offset, half_width, size.width, size.height); break; - case SurfaceFormat::R5G6B5: + case SurfaceFormat::R5G6B5_UINT16: rv = libyuv::RGB565ToI420(static_cast(map.GetData()), map.GetStride(), yuv, size.width, diff --git a/widget/android/AndroidBridge.cpp b/widget/android/AndroidBridge.cpp index d90db1b138a..7e793677d56 100644 --- a/widget/android/AndroidBridge.cpp +++ b/widget/android/AndroidBridge.cpp @@ -1861,7 +1861,7 @@ AndroidBridge::CaptureZoomedView(nsIDOMWindow *window, nsIntRect zoomedViewRect, presContext->DevPixelsToAppUnits(zoomedViewRect.height / scaleFactor )); bool is24bit = (GetScreenDepth() == 24); - SurfaceFormat format = is24bit ? SurfaceFormat::B8G8R8X8 : SurfaceFormat::R5G6B5; + SurfaceFormat format = is24bit ? SurfaceFormat::B8G8R8X8 : SurfaceFormat::R5G6B5_UINT16; gfxImageFormat iFormat = gfx::SurfaceFormatToImageFormat(format); uint32_t stride = gfxASurface::FormatStrideForWidth(iFormat, zoomedViewRect.width); @@ -1980,7 +1980,7 @@ nsresult AndroidBridge::CaptureThumbnail(nsIDOMWindow *window, int32_t bufW, int IntSize(bufW, bufH), stride, is24bit ? SurfaceFormat::B8G8R8X8 : - SurfaceFormat::R5G6B5); + SurfaceFormat::R5G6B5_UINT16); if (!dt) { ALOG_BRIDGE("Error creating DrawTarget"); return NS_ERROR_FAILURE; diff --git a/widget/gonk/nsWindow.cpp b/widget/gonk/nsWindow.cpp index f0f86146234..df84969ba0d 100644 --- a/widget/gonk/nsWindow.cpp +++ b/widget/gonk/nsWindow.cpp @@ -642,7 +642,7 @@ HalFormatToSurfaceFormat(int aHalFormat) case HAL_PIXEL_FORMAT_BGRA_8888: return SurfaceFormat::B8G8R8A8; case HAL_PIXEL_FORMAT_RGB_565: - return SurfaceFormat::R5G6B5; + return SurfaceFormat::R5G6B5_UINT16; default: MOZ_CRASH("Unhandled HAL pixel format"); return SurfaceFormat::UNKNOWN; // not reached diff --git a/widget/nsShmImage.cpp b/widget/nsShmImage.cpp index 9bf4f941a54..88571fda82b 100644 --- a/widget/nsShmImage.cpp +++ b/widget/nsShmImage.cpp @@ -112,7 +112,7 @@ nsShmImage::Create(const IntSize& aSize, } goto unsupported; case 16: - shm->mFormat = SurfaceFormat::R5G6B5; + shm->mFormat = SurfaceFormat::R5G6B5_UINT16; break; unsupported: default: diff --git a/widget/qt/nsClipboard.cpp b/widget/qt/nsClipboard.cpp index dfac48e4eff..797524fef53 100644 --- a/widget/qt/nsClipboard.cpp +++ b/widget/qt/nsClipboard.cpp @@ -62,7 +62,7 @@ _moz2dformat_to_qformat(SurfaceFormat aFormat) return QImage::Format_ARGB32_Premultiplied; case SurfaceFormat::B8G8R8X8: return QImage::Format_ARGB32; - case SurfaceFormat::R5G6B5: + case SurfaceFormat::R5G6B5_UINT16: return QImage::Format_RGB16; default: return QImage::Format_Invalid;